v2.0
- Overview
- Environment
- Quick Start
- Configuration
- Commands
- mtk
- init-project
- config
- license
- mig
- show
- sync
- sync-schema
- sync-sequence
- sync-object-type
- sync-domain
- sync-wrapper
- sync-server
- sync-user-mapping
- sync-queue
- sync-table
- sync-nickname
- sync-rule
- sync-table-data
- sync-table-data-estimate
- sync-index
- sync-constraint
- sync-db-link
- sync-view
- sync-mview
- sync-function
- sync-procedure
- sync-package
- sync-trigger
- sync-synonym
- sync-table-data-com
- sync-alter-sequence
- sync-coll-statistics
- check-table-data
- gen
- gen completion
- encrypt
- convert-plsql
- report
- self
- mvd
- usql
- Graphical
- Faqs
- Release
mtk
Database Migration Toolkit
Synopsis
The MTK(Database Migration Toolkit) helps you migrate your database
mtk [flags]
Examples
# init project
./mtk init-project -n ora2og
# Generate configuration file.
# edit connection information and migration objects (tables/schemas).
# the directory definition does not need to be modified
vi ora2og/config/mtk.json
# Run
./mtk -c ora2og/config/mtk.json
# Specify migration report
./mtk -c ora2og/config/mtk.json
# Specify debug mode
./mtk -c ora2og/config/mtk.json --debug
# Migrate to a file
./mtk -c ora2og/config/mtk.json --file
# Only Schema is migrated
./mtk -c ora2og/config/mtk.json --schemaOnly
# Only Data is migrated
./mtk -c ora2og/config/mtk.json --dataOnly
# Defining the migration table overrides the contents of the configuration file
./mtk -c ora2og/config/mtk.json --tables schema1.table1,schema2.table2
# Defining the migration schema overrides the contents of the configuration file
./mtk -c ora2og/config/mtk.json --schemas schema1,schema2
# Exclude specific object types
./mtk -c ora2og/config/mtk.json --exclude sequence,package
Options
--batchSize int Specify the batch size to be used for bulk/copy insert.
Valid values are 1-50000, default batch size is 1000
for MySQL,Oracle,openGauss,PostgreSQL.
--bufferSize int Specify the Buffer size in MB, to be used inserting or querying.
Valid value is from 1 to 1024, default Buffer size is 8 MB
for postgres,openGauss,mysql.
--caseSensitive int Object case parameters in SQL statements.
1 - lower case
2 - upper case
3 - Keep it the same as the source database.
-c, --config string Set mtk config file. Support json,yaml. [env MTK_CONFIG] (default "mtk.json")
--cpBufferSize int Specify the Copy Buffer size in MB, to be used in the Copy Command.
Valid value is from 1 to 1024, default Copy Buffer Size is 8 MB
for PostgreSQL,openGauss.
--dataOnly the only Migrate table data
-d, --debug Set the debug mode.
Not necessary for the normal usage. [env MTK_DEBUG]
--disableCollStatistics disable Collect table statistics.
--disableFKCons Disable table foreign key sync
--disableIgnoreCase Disable ignoring case queries
--disableSelectPart Disable the select by partition
--disableTableDataComp disable table select count compare.
--enableSyncCompTabPro Enable Synchronize table compressed properties
-e, --exclude strings Exclude specific object types.
For example, exclude=sequence,table
--fetchSize int Specify fetch size in terms of number of rows should be fetched in result set at a time.
Valid values are 1-50000, default fetch size is 1000
for Oracle.
--file export to file
--fileType string Indicates the type of a file when data is to be exported to a file.
support csv,sql
-h, --help help for mtk
--httpAddr string Set mtk run Http Service Address [env MTK_HTTP_ADDR]
--license string Specify the license file
--limit int Define how many rows of data to migrate.
Specify that test does not specify that this parameter defaults to 10000
--logDir string Set mtk run Http Service log dir [env MTK_LOG_DIR]
--logfile string Set mtk log file. Default value is reportFile dir.
--noTerminalReport The terminal does not print an overview of the migration report
-p, --parallel int Specify the parallelism.
the degree of parallelism is now only useful when migrating table data and parallelism when creating an index. (default 1)
--path string Indicates the directory of a file to which data is to be exported.
Default value is config.target.parameter.path. If not configured, the system default value ./data
Command Value > Config Value > MTK Default Value
--preRun preRun check.
-r, --reportFile string Set mtk report file or dir. If it is a file, use the file directory.
Default value is ./report
report directory format [./report/reportYYYYMMDDHHMISS] ./report/report20210101121314
--reportServer string reportServer [env MTK_REPORT_SERVER]
--schemaOnly the only Migrate schema ddl
--schemas string the Migrate schema,Separated by commas.(schema1,schema2,db1)
--scn string Consistency point in time. For Oracle Flashback Query SCN
--seqLastNumAddNum int The last value of the sequence is increased
--splitTabMethod string Define the split method.
Option: rowid,mod,ora_hash,auto
Oracle defaults to auto(sample,mod), other databases default to mod
--splitTabSamplePercentage float Percentage sampled
--splitTabSize int When the table size or partition size is larger than this value, the query task is split. Unit MB
--splitTabTaskNum int The number of single-table/single-partition split tasks
--tableSkip stringArray Define table split. Can be specified multiple times.
format schema.tableName --tableSkip MTK.TABLE01 --tableSkip MTK.TABLE02
--tableSplit stringArray Define table split. Can be specified multiple times.
format schema.tableName:where:where:where
--tableSplit 'MTK.TABLE01: "ID">100 AND ID<=200: ID>200 AND ID<=300:ID>300'
--tableSplit "MTK.TABLE02: \"ID\">100 AND ID<=200: ID>200 AND ID<=300:ID>300 AND COL1='1'"
--tables string the Migrate tables,Separated by commas.(tab1,schema1.tab1)
--test Whether to carry out migration testing, with the parameter limit migration part of the data.
Test migration data is not commit, just testing whether the data is inserted properly
-v, --version MTK Version
SEE ALSO
- mtk init-project - Initialise a typical mtk project tree. Top directory will be created under project base dir.
- mtk config-check - check configuration file has errors
- mtk config-gen - Interactively generate configuration files
- mtk gen - gen command docs, shell autocompletion script
- mtk license - manage license
- mtk mig-tab-pre - mig database object Schema,Sequence,ObjectType,Domain,Queue,Wrapper,Server,UserMapping,Table,NickName,Rule
- mtk mig-tab-data - mig database object TableData,TableDataEstimate,CheckTableData
- mtk mig-tab-post - mig database object Index,Constraint,AlterSequence,TableDataCom,CollStatistics
- mtk mig-tab-other - mig database object DBLink,View,MaterializedView,Function,Procedure,Package,Trigger,Synonym
- mtk mig-select - migrate custom query statements to csv or target table
- mtk mig-selects - migrate custom query statements to csv or target table
- mtk show-schema - Show Source Database schema.
- mtk show-db-info - show database Information.
- mtk show-type - show support database type.
- mtk show-table - display size of the top n table to be migrated
- mtk show-table-split - split large tables in parallel according to user defined parallelism
- mtk show-support-db - show support database version.
- mtk show-table-data-estimate - estimate table data migration time.
- mtk report - Convert mtk report file to sql script.
- mtk sync-schema - sync schema.
- mtk sync-object-type - sync object-type.
- mtk sync-domain - sync domain.
- mtk sync-sequence - sync sequence.
- mtk sync-queue - sync queue.
- mtk sync-wrapper - sync db2 wrapper.
- mtk sync-server - sync db2 server.
- mtk sync-user-mapping - sync db2 user mapping.
- mtk sync-table - sync table.
- mtk sync-nickname - sync db2 nickname.
- mtk sync-table-data - sync table data.
- mtk sync-table-data-estimate - estimate table data migration time.
- mtk sync-index - sync index.
- mtk sync-constraint - sync constraint.
- mtk sync-view - sync view.
- mtk sync-mview - sync materialized view.
- mtk sync-trigger - sync trigger.
- mtk sync-procedure - sync procedure.
- mtk sync-function - sync function.
- mtk sync-package - sync package.
- mtk sync-synonym - sync synonym.
- mtk sync-db-link - sync db link.
- mtk sync-rule - sync rule.
- mtk sync-table-data-com - table rows count comparison.
- mtk sync-alter-sequence - modify sequence start value.
- mtk sync-coll-statistics - collect table statistics.
- mtk check-table-data - Check the table data for exception data
- mtk show-drop-index - generate drop index sql
- mtk show-drop-cons - generate drop constraint sql
- mtk version - mtk version
- mtk encrypt - Provides a convenient way to encrypt your text/password
- mtk convert-plsql - Convert PLSQL Statements
- mtk self - Modify the mtk installation
- mtk mvd - Run the MVD for data verification
- mtk usql - The universal command-line interface for SQL databases