HomeMogDBMogDB StackUqbar

Documentation:v2.0

Supported Versions:

MTK Configuration File Description

Config

Config

Field Type Group Description
source Option Source Database configuration information.
target Option Target Database configuration information.
object Object Object definition.
limit Limit Concurrency configuration.
dataOnly bool Indicates whether to migrate only data.
schemaOnly bool Indicates whether to migration only the data structure.
disableTableDataComp bool Disables the table data comparison function.
disableCollStatistics bool Disables the collection statistics function.
reportFile string Indicates the migration report directory.
debug bool Indicates whether to enable the log debug mode.
preRun bool pre Run.
test bool Try migration..
disableIgnoreCase bool Disables ignoring case queries.
disableSelectPart bool Disable the partition table migration data by partition feature.
disableFKCons bool Disables synchronization of table foreign key constraints.
disableSyncIdxAfterData bool disable the synchronization of table data and create this table index immediately.
disableSequence bool Disables synchronization of sequence.

Example:

{
  "source": {
    "type": "oracle",
    "connect": {
      "version": "",
      "host": "127.0.0.1",
      "user": "system",
      "port": 1521,
      "password": "******",
      "dbName": "orcl",
      "clientCharset": "",
      "pureDriverClientCharset": ""
    }
  },
  "target": {
    "type": "opengauss",
    "connect": {
      "version": "3.0.0",
      "host": "127.0.0.1",
      "user": "gaussdb",
      "port": 26000,
      "password": "******",
      "dbName": "postgres",
      "clientCharset": "",
      "pureDriverClientCharset": ""
    },
    "parameter": {
      "parallelInsert": 1,
      "dropSchema": false,
      "dropExistingObject": false,
      "skipExistPLSQL": false,
      "truncTable": false,
      "colKeyWords": {},
      "objKeyWords": {},
      "caseSensitive": 0,
      "quoteMark": false,
      "path": "./data",
      "schemaPath": "",
      "dataPath": "",
      "errDataPath": "",
      "fileType": "",
      "fileSize": "",
      "csvHeader": false,
      "csvNullValue": "",
      "csvFieldDelimiter": ",",
      "csvOptionallyEnclosed": "\"",
      "excludeSysTable": [],
      "remapSchema": {},
      "remapTable": {},
      "remapTablespace": {},
      "enableSyncTabTbsPro": false,
      "enableSyncCompTabPro": false,
      "timeFormat": "HH:MI:SS",
      "dateFormat": "YYYY-MM-DD",
      "dateTimeFormat": "YYYY-MM-DD HH24:MI:SS",
      "timeStampFormat": "YYYY-MM-DD HH24:MI:SSXFFFFFF",
      "timeStampZoneFormat": "YYYY-MM-DD HH24:MI:SSXFFFFFF TZR",
      "noSupportPartTabToNormalTab": false,
      "ignoreDB2PartInclusive": false,
      "igNotSupportIntervalPart": false,
      "igErrorData": false,
      "enableBatchCommit": false,
      "ignoreTabPartition": false,
      "ignoreTabPartitionTabList": [],
      "autoAddMaxvaluePart": false,
      "autoAddMySQLAutoIncr": false,
      "autoAddMySQLAutoIncrTabList": [],
      "ignoreNotSupportDefault": false,
      "replaceZeroDate": "",
      "replaceBCDate": "",
      "virtualColToNormalCol": false,
      "virtualColConv": {},
      "convertOracleIntegerToNumeric": false,
      "enableOgBlobClob": false,
      "enableConvertSrid": false,
      "defaultSrid": "4326",
      "seqLastNumAddNum": 0,
      "skipColumnType": {},
      "skipColumnName": {},
      "columnTypeData": {},
      "columnNameData": {},
      "templateSeqName": "",
      "charAppendEmptyString": false,
      "tableOptions": {},
      "indexOptions": {},
      "enableGlobalIndexToLocal": false,
      "convertPackageMethod": "",
      "enableAutoAddParenthesesForFunc": false,
      "largeSequence": "",
      "enableConvEmptyStringToSpace": false,
      "customColMap": null,
      "compatibleIlLegaLChars": false
    }
  },
  "object": {
    "tables": [
      "MTK.TAB1",
      "MTK.TAB111%",
      "MTK1.*",
      "MTK1.TAB_PART:P1,P2"
    ],
    "schemas": [
      "SCHEMA1",
      "SCHEMA2"
    ],
    "excludeTable": {
      "SCHEMA1": [
        "TABLE_SKIP1",
        "TABLE_DUTY_LOG*",
        "^TABLE_DUTY_LOG*",
        "^TABLE_DUTY_LOG.*$"
      ],
      "SCHEMA2": [
        "TABLE_SKIP1"
      ]
    },
    "tableSplit": {
      "SCHEMA1": {
        "TAB_1": [
          "ID < 10000",
          "ID < 90000 AND ID >=10000",
          "ID >= 90000"
        ]
      }
    }
  },
  "limit": {
    "parallel": 2,
    "fetchSize": 1000,
    "batchSize": 1000,
    "bufferSize": 8,
    "cpBufferSize": 8,
    "oracleSelectParallel": 2,
    "channelCacheNum": 2000,
    "limit": 0,
    "splitTabSize": 5120,
    "splitTabMethod": "",
    "splitTabTaskNum": 0,
    "splitTabSamplePercentage": 0.1
  },
  "dataOnly": false,
  "schemaOnly": false,
  "disableTableDataComp": false,
  "disableCollStatistics": false,
  "reportFile": "./report/",
  "debug": false,
  "disableIgnoreCase": false,
  "disableSelectPart": false,
  "disableFKCons": false,
  "disableSyncIdxAfterData": false,
  "disableSequence": false
}

source

Type: Option

Desc: Source Database configuration information.

Example:

Source Database Config Example

{
  "source": {
    "type": "oracle",
    "connect": {
      "version": "",
      "host": "127.0.0.1",
      "user": "system",
      "port": 1521,
      "password": "******",
      "dbName": "orcl",
      "clientCharset": "",
      "pureDriverClientCharset": ""
    }
  }
}

target

Type: Option

Desc: Target Database configuration information.

Example:

Target Database Config Example

{
  "target": {
    "type": "opengauss",
    "connect": {
      "version": "3.0.0",
      "host": "127.0.0.1",
      "user": "gaussdb",
      "port": 26000,
      "password": "******",
      "dbName": "postgres",
      "clientCharset": "",
      "pureDriverClientCharset": ""
    },
    "parameter": {
      "parallelInsert": 1,
      "dropSchema": false,
      "dropExistingObject": false,
      "skipExistPLSQL": false,
      "truncTable": false,
      "colKeyWords": {},
      "objKeyWords": {},
      "caseSensitive": 0,
      "quoteMark": false,
      "path": "./data",
      "schemaPath": "",
      "dataPath": "",
      "errDataPath": "",
      "fileType": "",
      "fileSize": "",
      "csvHeader": false,
      "csvNullValue": "",
      "csvFieldDelimiter": ",",
      "csvOptionallyEnclosed": "\"",
      "excludeSysTable": [],
      "remapSchema": {},
      "remapTable": {},
      "remapTablespace": {},
      "enableSyncTabTbsPro": false,
      "enableSyncCompTabPro": false,
      "timeFormat": "HH:MI:SS",
      "dateFormat": "YYYY-MM-DD",
      "dateTimeFormat": "YYYY-MM-DD HH24:MI:SS",
      "timeStampFormat": "YYYY-MM-DD HH24:MI:SSXFFFFFF",
      "timeStampZoneFormat": "YYYY-MM-DD HH24:MI:SSXFFFFFF TZR",
      "noSupportPartTabToNormalTab": false,
      "ignoreDB2PartInclusive": false,
      "igNotSupportIntervalPart": false,
      "igErrorData": false,
      "enableBatchCommit": false,
      "ignoreTabPartition": false,
      "ignoreTabPartitionTabList": [],
      "autoAddMaxvaluePart": false,
      "autoAddMySQLAutoIncr": false,
      "autoAddMySQLAutoIncrTabList": [],
      "ignoreNotSupportDefault": false,
      "replaceZeroDate": "",
      "replaceBCDate": "",
      "virtualColToNormalCol": false,
      "virtualColConv": {},
      "convertOracleIntegerToNumeric": false,
      "enableOgBlobClob": false,
      "enableConvertSrid": false,
      "defaultSrid": "4326",
      "seqLastNumAddNum": 0,
      "skipColumnType": {},
      "skipColumnName": {},
      "columnTypeData": {},
      "columnNameData": {},
      "templateSeqName": "",
      "charAppendEmptyString": false,
      "tableOptions": {},
      "indexOptions": {},
      "enableGlobalIndexToLocal": false,
      "convertPackageMethod": "",
      "enableAutoAddParenthesesForFunc": false,
      "largeSequence": "",
      "enableConvEmptyStringToSpace": false,
      "customColMap": null,
      "compatibleIlLegaLChars": false
    }
  }
}

object

Type: Object

Desc: Object definition.

Example:

Object Example

{
  "object": {
    "tables": [
      "MTK.TAB1",
      "MTK.TAB111%",
      "MTK1.*",
      "MTK1.TAB_PART:P1,P2"
    ],
    "schemas": [
      "SCHEMA1",
      "SCHEMA2"
    ],
    "excludeTable": {
      "SCHEMA1": [
        "TABLE_SKIP1",
        "TABLE_DUTY_LOG*",
        "^TABLE_DUTY_LOG*",
        "^TABLE_DUTY_LOG.*$"
      ],
      "SCHEMA2": [
        "TABLE_SKIP1"
      ]
    },
    "tableSplit": {
      "SCHEMA1": {
        "TAB_1": [
          "ID < 10000",
          "ID < 90000 AND ID >=10000",
          "ID >= 90000"
        ]
      }
    }
  }
}

limit

Type: Limit

Desc: Concurrency configuration.

Example:

Limit Example

{
  "limit": {
    "parallel": 2,
    "fetchSize": 1000,
    "batchSize": 1000,
    "bufferSize": 8,
    "cpBufferSize": 8,
    "oracleSelectParallel": 2,
    "channelCacheNum": 2000,
    "limit": 0,
    "splitTabSize": 5120,
    "splitTabMethod": "",
    "splitTabTaskNum": 0,
    "splitTabSamplePercentage": 0.1
  }
}

dataOnly

Type: bool

Desc: Indicates whether to migrate only data.

Default: false

Option:

  • true
  • false

schemaOnly

Type: bool

Desc: Indicates whether to migration only the data structure.

Default: false

Option:

  • true
  • false

disableTableDataComp

Type: bool

Desc: Disables the table data comparison function. After data migration is complete, MTK will count and compare the number of rows in the source and target databases.

Default: false

Option:

  • true
  • false

disableCollStatistics

Type: bool

Desc: Disables the collection statistics function. After data migration is complete, MTK will collect statistics information from the target database.

Default: false

Option:

  • true
  • false

reportFile

Type: string

Desc: Indicates the migration report directory. For MTK of a version earlier than v0.0.18, the migration report is shown in HTML. For MTK v0.0.18 or later, the migration report is stored in a directory.

debug

Type: bool

Desc: Indicates whether to enable the log debug mode.

Default: false

Option:

  • true
  • false

preRun

Type: bool

Desc: pre Run.

Default: false

Option:

  • true
  • false

test

Type: bool

Desc: Try migration.. Migration parameter limit.limit row data. In this mode, the data can be submitted without any data, and the data will be automatically rolled back. Just to test if the data is inserted normally.

Default: false

Option:

  • true
  • false

disableIgnoreCase

Type: bool

Desc: Disables ignoring case queries.

Default: false

Option:

  • true
  • false

disableSelectPart

Type: bool

Desc: Disable the partition table migration data by partition feature.

Default: false

Option:

  • true
  • false

disableFKCons

Type: bool

Desc: Disables synchronization of table foreign key constraints.

Default: false

Option:

  • true
  • false

disableSyncIdxAfterData

Type: bool

Desc: disable the synchronization of table data and create this table index immediately.

Default: false

Option:

  • true
  • false

disableSequence

Type: bool

Desc: Disables synchronization of sequence.

Default: false

Option:

  • true
  • false

Add: v2.9.3

Connect

Field Type Group Description
version string Database version.
vendor string Database publisher.
host string database host
user string database user
port int database port
password Password database user password
dbName string database name
dsn string User-specified connection string.
timeout int64 connection timeout. Maximum 600s, more than 600s is the default value
charset string database character set..
datCompatibility string Compatibility mode for the openGauss database.
sqlMode string sql_mode for MySQL databases.
clientCharset string It is used for database encoding conversion scenarios, and generally does not need to be set.

Appears in:

version

Type: string

Desc: Database version.

No need to specify. Automatic query when connecting to database

Migrating into a file requires manually specifying the version

Example:

Version Example

{
  "version": "2.1.0"
}

vendor

Type: string

Desc: Database publisher.

No need to specify. Automatic query when connecting to database.

Example:

Vendor Example

{
  "vendor": "MySQL"
}

host

Type: string

Desc: database host

Option:

  • ip
  • 域名

Example:

Host Example

{
  "host": "127.0.0.1"
}

user

Type: string

Desc: database user

Example:

User Example

{
  "user": "system"
}

port

Type: int

Desc: database port

Example:

Port Example

{
  "port": 1521
}

password

Type: Password

Desc: database user password

dbName

Type: string

Desc: database name

Example:

DBName Example

{
  "dbName": "orcl"
}

dsn

Type: string

Desc: User-specified connection string.

No need to specify by default. Reserve functions for special scenarios.

timeout

Type: int64

Desc: connection timeout. Maximum 600s, more than 600s is the default value

No configuration required

Default: 30s

charset

Type: string

Desc: database character set..

No configuration by default, connect to database query.

Option:

  • gbk
  • utf8

Example:

Charset Example

{
  "charset": "gbk"
}

datCompatibility

Type: string

Desc: Compatibility mode for the openGauss database.

By default, no configuration is required, and the database query is connected.

Migrating into a file requires configuration.

Option:

  • A
  • B
  • PG

Example:

DatCompatibility Example

{
  "datCompatibility": "A"
}

sqlMode

Type: string

Desc: sql_mode for MySQL databases.

By default, no configuration is required, and the database query is connected.

Migrating into a file requires configuration.

clientCharset

Type: string

Desc: It is used for database encoding conversion scenarios, and generally does not need to be set.

  1. Under active configuration, it will check whether the source and target are consistent.

If they are not consistent, the source settings will be synchronized. If they are consistent, they will not be processed. 2. By default, it is set according to the source character set to minimize the number of transcoding times. If the source Oracle is ZHS16GBK, it will be read in GBK, and the target will be inserted in GBK. If the target is GBK, no transcoding is required. If it is UTF8, it will be transcoded at the database kernel layer and not at the driver layer.

Such as Oracle ZHS16GBK encoding migrated to openGauss UTF8. Encountered ORA-29275: partial multibyte character.

Option

database config

Field Type Group Description
type string database type, case insensitive
connect Connect Database connection information
parameter Parameter Parameter configuration

Appears in:

Example:

Source Database Config Example

{
  "type": "oracle",
  "connect": {
    "version": "",
    "host": "127.0.0.1",
    "user": "system",
    "port": 1521,
    "password": "******",
    "dbName": "orcl",
    "clientCharset": "",
    "pureDriverClientCharset": ""
  }
}

Target Database Config Example

{
  "type": "opengauss",
  "connect": {
    "version": "3.0.0",
    "host": "127.0.0.1",
    "user": "gaussdb",
    "port": 26000,
    "password": "******",
    "dbName": "postgres",
    "clientCharset": "",
    "pureDriverClientCharset": ""
  },
  "parameter": {
    "parallelInsert": 1,
    "dropSchema": false,
    "dropExistingObject": false,
    "skipExistPLSQL": false,
    "truncTable": false,
    "colKeyWords": {},
    "objKeyWords": {},
    "caseSensitive": 0,
    "quoteMark": false,
    "path": "./data",
    "schemaPath": "",
    "dataPath": "",
    "errDataPath": "",
    "fileType": "",
    "fileSize": "",
    "csvHeader": false,
    "csvNullValue": "",
    "csvFieldDelimiter": ",",
    "csvOptionallyEnclosed": "\"",
    "excludeSysTable": [],
    "remapSchema": {},
    "remapTable": {},
    "remapTablespace": {},
    "enableSyncTabTbsPro": false,
    "enableSyncCompTabPro": false,
    "timeFormat": "HH:MI:SS",
    "dateFormat": "YYYY-MM-DD",
    "dateTimeFormat": "YYYY-MM-DD HH24:MI:SS",
    "timeStampFormat": "YYYY-MM-DD HH24:MI:SSXFFFFFF",
    "timeStampZoneFormat": "YYYY-MM-DD HH24:MI:SSXFFFFFF TZR",
    "noSupportPartTabToNormalTab": false,
    "ignoreDB2PartInclusive": false,
    "igNotSupportIntervalPart": false,
    "igErrorData": false,
    "enableBatchCommit": false,
    "ignoreTabPartition": false,
    "ignoreTabPartitionTabList": [],
    "autoAddMaxvaluePart": false,
    "autoAddMySQLAutoIncr": false,
    "autoAddMySQLAutoIncrTabList": [],
    "ignoreNotSupportDefault": false,
    "replaceZeroDate": "",
    "replaceBCDate": "",
    "virtualColToNormalCol": false,
    "virtualColConv": {},
    "convertOracleIntegerToNumeric": false,
    "enableOgBlobClob": false,
    "enableConvertSrid": false,
    "defaultSrid": "4326",
    "seqLastNumAddNum": 0,
    "skipColumnType": {},
    "skipColumnName": {},
    "columnTypeData": {},
    "columnNameData": {},
    "templateSeqName": "",
    "charAppendEmptyString": false,
    "tableOptions": {},
    "indexOptions": {},
    "enableGlobalIndexToLocal": false,
    "convertPackageMethod": "",
    "enableAutoAddParenthesesForFunc": false,
    "largeSequence": "",
    "enableConvEmptyStringToSpace": false,
    "customColMap": null,
    "compatibleIlLegaLChars": false
  }
}

type

Type: string

Desc: database type, case insensitive

Option:

  • MySQL
  • Oracle
  • Postgres/PostgreSQL
  • openGauss
  • MogDB
  • DB2
  • SqlServer
  • file
  • Informix
  • DM

Example:

Type Example

{
  "type": "Oracle"
}

connect

Type: Connect

Desc: Database connection information

parameter

Type: Parameter

Desc: Parameter configuration

Copyright © 2011-2024 www.enmotech.com All rights reserved.