Home
MogDBMogDB StackUqbar
Ecological Tools
Documentation:v2.0
Supported Versions:

MTK Parameter

Parameter

Parameter parameter configuration

Field Type Group Description
enableTableParallelQuery int How to query table information.
parallelInsert int Parallel Insert Parallelism.
dropSchema bool object Drops the schema if it already exists in the target database
dropExistingObject bool object Drops the object if it already exists in the target database.
truncTable bool object Prevent data conflict use when only migrating data.
colKeyWords map[string]int object Column name keywords.
objKeyWords map[string]int object Reserved object keywords.
quoteMark bool object Whether double quotes or backticks are used for the generated object name.
caseSensitive int object Case conversion for the generated object name.
ignoreTableDDLCompErr bool object Ignore table structure comparison errors
parallelIndex int object Enable parallel creation of indexes for openGauss/MogDB, the maximum parallelism of a single index is 32.
path string file When exporting data as a file, specify the export directory.
schemaPath string file sql script directory
dataPath string file data directory
errDataPath string file error data directory
fileType string file When exporting data as a file, the file type
fileSize string file The size of a single file when data is exported as a file. No limit if not specified.
sqlDBType string file When exporting data to a file, specify the syntax of which database to generate.
csvHeader bool file When the export file is csv, specify whether to include the csv file header. Not exported by default.
csvNullValue string file csv null value display
csvFieldDelimiter string file csv default delimiter.
csvOptionallyEnclosed string file Data wrapper.
timeFormat string file Define the time format
dateFormat string file Define date format
dateTimeFormat string file Define the full format of the time
excludeSysTable []string table Exclude system object definitions. If not configured, use the default value
enableSyncCompTabPro table bool Whether to configure the generated DDL to include table compression attribute syntax. Not generated by default.
tableOptions map[string]string table Configure the option to add table attributes when creating a table. Currently only openGauss/MogDB is supported.
indexOptions map[string]string table The same as the tableOptions option configuration, it only takes effect for the index. The function development has not been completed.
remapSchema map[string]string remap Whether to rename the database schema during migration.
remapTable map[string]string remap Whether to rename the table name during migration
remapTablespace map[string]string remap Whether to rename the tablespace name during migration.
enableSyncTabTbsPro bool remap Whether to configure the generated DDL to include tablespace syntax. Not generated by default
noSupportPartTabToNormalTab bool partition Convert a partition table not supported by the target to a normal table
ignoreDB2PartInclusive bool partition Whether to ignore the inclusion attribute of DB2 partition key value ENDING
igNotSupportIntervalPart bool partition Support ignore part of unsupported intervalpart attribute
ignoreTabPartition bool partition Support migration to target database ignore partition syntax, now only support migration to MySQL.
autoAddMaxvaluePart bool partition The parameter autoAddMaxvaluePart allows a maxvalue partition to be added automatically to a partitioned table that does not already have a maxvalue partition.
igErrorData bool data Ignore failed insert data and log to error file.
enableBatchCommit bool data enable batchSize commit
mySQLSkipErrorDateTimeData bool data Automatically skip mysql error time.
autoAddMySQLAutoIncr bool column Migrating to MySQL automatically adds MySQL AUTO_INCREMENT columns
autoAddMySQLAutoIncrTabList []string column Use with the autoAddMySQLAutoIncr parameter.
ignoreNotSupportDefault bool column The support ignore part does not support column default values. Such as Oracle's sys_guid. MTK will embed a whitelist to ignore
replaceZeroDate string column openGauss/MogDB/PostgreSQL does not support the time format of 0000-00-00, the default replacement is 1970-01-01, this parameter can define the default replacement value, such as 2021-01-01
virtualColToNormalCol bool column Whether to convert the virtual column of the source library to the normal column of the target library.
virtualColConv map[string]string column Virtual column expression conversion function
mySQLToOgCharExpression string column mysql migrates to openGauss to calculate column length expressions for char/varchar columns. By default, no calculation is performed. For example, *3 means the original length is *3
convertOracleIntegerToNumeric bool column Convert Oracle Integer type to NUMERIC. Support openGauss/MogDB/PostgreSQL
enableOgBlobClob bool column Blobs and Clobs migrated from other databases are openGauss Blobs and Clobs.
skipColumnType map[string]int column Skip a data type column when migrating
skipColumnName map[string]int column Skip a column when migrating
charLengthChangeExclude []string column When migrating across character sets, the specified matching expression is ignored, and those column names are ignored without length expansion.
enableCharTrimRightSpace bool column For char migration to varchar, it is allowed to intercept the space on the right side of the char type. Only supports openGauss/MogDB on the target side
convertPackageMethod string plsql How to migrate Oracle Packages to openGauss/MogDB
enableConvertSrid bool gis Enable Convert Srid
defaultSrid string gis PostGis Default Srid
seqLastNumAddNum int sequence How much to increase when synchronizing the sequence last value.
templateSeqName string sequence MySQL auto-incrementing column to sequence, template of sequence name
charAppendEmptyString bool select For ORA-29275: partial multibyte character error. In oracle query is concatenated string
charsetTranscode bool charset Transcode for wrong encoding

Appears in:

Example:

{
  "parallelInsert": 1,
  "dropSchema": false,
  "dropExistingObject": 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,
  "autoAddMaxvaluePart": false,
  "autoAddMySQLAutoIncr": false,
  "autoAddMySQLAutoIncrTabList": [],
  "ignoreNotSupportDefault": false,
  "replaceZeroDate": "",
  "virtualColToNormalCol": false,
  "virtualColConv": {},
  "convertPackageMethod": "",
  "convertOracleIntegerToNumeric": false,
  "enableOgBlobClob": false,
  "enableConvertSrid": false,
  "defaultSrid": "4326",
  "seqLastNumAddNum": 0,
  "skipColumnType": {},
  "skipColumnName": {},
  "templateSeqName": "",
  "charAppendEmptyString": false,
  "tableOptions": {},
  "indexOptions": {}
}

enableTableParallelQuery

Type: int

Desc: Ways to look up table information.

Test feature. No modification required

Option:

  • 0 is queried at one time, and then created concurrently
  • 1 Parallel query, first query the basic information of the table, then concurrent query + target creation

parallelInsert

Type: int

Desc: Parallel insert parallelism.

Test feature. No modification required

Default: false

dropSchema

类型: bool

描述: Drops the schema if it already exists in the target database.

默认值: false

可选值:

  • true
  • false

新增于: v2.7.0

dropExistingObject

Type: bool

Desc: If the object already exists in the target database, delete the object.

Generally used when data is reinitialized. Please use it with caution. Drop schema is not supported after 2.7.0

Default: false

Option:

  • true
  • false

truncTable

Type: bool

Desc: Prevent data conflict usage when only migrating data.

Default: false

Option:

  • true
  • false

colKeyWords

Type: map[string]int

Desc: Column name keyword.

When the target is created, "" will be automatically added or the keyword will be case-converted

Option:

  • 1 indicates lowercase.
  • 2 indicates uppercase.
  • Others indicate that the keyword is kept unchanged.

Example:

Column KeyWords example

{
  "colKeyWords": {
    "STREAM": 1,
    "TID": 1
  }
}

objKeyWords

Type: map[string]int

Desc: Reserves the object keyword.

During creation in the target database, "" or '' will be automatically added and the keyword will be operated with case conversion automatically.

Option:

  • 1 indicates lowercase.
  • 2 indicates uppercase.
  • Others indicate that the keyword is kept unchanged.

Example:

Column KeyWords example

{
  "objKeyWords": {
    "STREAM": 1,
    "TID": 1
  }
}

caseSensitive

Type: int

Desc: Case conversion for generated object names.

Default: 0

Option:

  • 0 indicates that no operation is needed.
  • 1 indicates lowercase.
  • 2 indicates uppercase.
  • Others indicates that the names are kept unchanged.

quoteMark

Type: bool

Desc: Use double or backquote inclusion for object names in SQL statements.

-- MySQl
`a1`
-- Oracle/PostgreSQL/openGauss/MogDB
"a1"
-- quoteMark: false
CREATE TABLE mtk.t_pri (
  id DECIMAL(38) NOT NULL,
  id2 DECIMAL(38) NOT NULL,
  id3 DECIMAL(38),
  id4 DECIMAL(38),
  id5 DECIMAL(38)
);

-- quoteMark: true
CREATE TABLE "mtk"."t_pri" (
  "id" DECIMAL(38) NOT NULL,
  "id2" DECIMAL(38) NOT NULL,
  "id3" DECIMAL(38),
  "id4" DECIMAL(38),
  "id5" DECIMAL(38)
);

Can be used with the parameter caseSensitive for object name case conversion. Except for special keywords, special keywords use objKeyWords and colKeyWords

quoteMark caseSensitive describe
false 0 create statement without double or backquotes,
the case of object names is determined by the database default configuration
false 1 create statement without double or backquotes,
the case of object names is determined by the database default configuration
false 2 create statement without double or backquotes,
the case of object names is determined by the database default configuration
true 0 create statement with double or backquotes,
the object name is the same as the original
true 1 create statement with double or backquoted,
the object names are all lowercase
true 2 create statement with double or backquotes,
the object names are all uppercase

Default: false

Option:

  • true
  • false

ignoreTableDDLCompErr

Type: bool

Desc: Indicates whether to ignore the table structure comparison error.

Default: false

Deprecated: Functional obsolescence

Option:

  • true
  • false

parallelIndex

Type: int

Desc: Enable parallel creation of indexes for openGauss/MogDB, and the maximum parallelism of a single index is 32. The total parallelism limit.parallel * parallelIndex should be less than max_connections*1/4. If the maximum number of database connections is 400, the maximum number of threads provided to create an index at the database level is 400*1/4, which is 100 If limit.parallel * parallelIndex is greater than 100, the database will be automatically converted to serial creation. That is, configure parallelIndex=8, then limit.parallel can be up to 12

Default: 0

Add: v2.7.1

path

Type: string

Desc: Indicates the directory of a file to which data is to be exported.

During data migration, the error data will be recorded in this directory to the err_data_<YYYYDDMMHH24MISS> directory下

Default: ./data

schemaPath

Type: string

Desc: sql script directory

dataPath

类型: string

描述: data directory

errDataPath

类型: string

描述: error data directory

fileType

Type: string

Desc: Indicates the type of a file when data is to be exported to a file. The supported file types include:

Option:

  • csv
  • sql

fileSize

Type: string

Desc: Indicates the size of a file when data is to be exported to a file. If this parameter is not configured, the file size is not limited.

The supported formats of the file size includes:

  • KiB
  • MiB
  • GiB
  • TiB
  • PiB
  • KB
  • MB
  • GB
  • TB
  • PB

KB == 1000

KiB == 1024

Example:

fileSize example

{
  "fileSize": "2048MiB"
}

sqlDBType

Type: string

Desc: Indicates the data insert syntax in the target database when data is to be exported to a file.

For example, if data is migrated from Oracle to MySQL, the MySQL data insert syntax is generated by default.

csvHeader

Type: bool

Desc: Indicates whether the CSV file header is included when data is to be exported to a CSV file. The CSV header is not exported by default.。

Default: false

csvNullValue

Type: string

Desc: csv empty value display

csvFieldDelimiter

Type: string

Desc: Indicates the default CSV delimiter.。

Default: ,

csvOptionallyEnclosed

Type: string

Desc: Indicates the data wrapper.

Default: "

timeFormat

Type: string

Desc: define time format

Default: HH:MI:SS

dateFormat

Type: string

Desc: define date format

Default: YYYY-MM-DD

dateTimeFormat

Type: string

Desc: define dateTime format

Default: YYYY-MM-DD HH24:MI:SS

excludeSysTable

Type: []string

Desc: Excludes the system object definition. If this parameter is not configured, the default value applies.

Example:

DB2 Exclude System Table example

{
  "excludeSysTable": [
    "EXPLAIN_ACTUALS",
    "ADVISE_TABLE",
    "ADVISE_PARTITION",
    "ADVISE_MQT",
    "ADVISE_WORKLOAD",
    "ADVISE_INDEX",
    "ADVISE_INSTANCE",
    "OBJECT_METRICS",
    "EXPLAIN_DIAGNOSTIC_DATA",
    "EXPLAIN_DIAGNOSTIC",
    "EXPLAIN_STREAM",
    "EXPLAIN_PREDICATE",
    "EXPLAIN_OPERATOR",
    "EXPLAIN_OBJECT",
    "EXPLAIN_ARGUMENT",
    "EXPLAIN_STATEMENT",
    "EXPLAIN_INSTANCE"
  ]
}

enableSyncCompTabPro

Type: bool

Desc: Indicates whether to generate a DDL with the table compression.

Default: false

tableOptions

Type: map[string]string

Desc: Configure the Add table attributes when creating a table option. For the time being, only openGauss/MogDB is supported.

  • openGauss/MogDB create table xxx() with (xx);

Parameters are not case-sensitive

  • "*", // Migrate all tables in the object
  • "Schema1.*" // Migrate all tables under Schema1 in the object
  • "Schema1.TABLE_1" // only Schema1.TABLE_1 table add option

Option special value remove

compression=remove The compression attribute is removed

Default: null

Example:

tableOptions example

{
  "tableOptions": {
    "*": "orientation=row, compression=no",
    "Schema1.*": "orientation=row, compression=no",
    "Schema1.TABLE_1": "orientation=row, compression=no"
  }
}

Add: v2.3.2

indexOptions

Type: map[string]string

Desc: As with the tableOptions option configuration, it only takes effect for indexes.

Default: null

Add: v2.3.2

remapSchema

Type: map[string]string

Desc: Indicates whether to modify the name of schema during migration.

Format: Name of the original solution : Name of the new solution

For example, MTK1 is changed to MTK1_NEW, and SOE is changed to SOE_NEW.

Example:

Remap Schema Example

{
  "remapSchema": {
    "DB_APP_01": "APP_01",
    "DB_APP_02": "APP_02"
  }
}

remapTable

Type: map[string]string

Desc: Indicates whether to modify the table name during migration

Deprecated: This parameter is already not supported

remapTablespace

Type: map[string]string

Desc: Indicates whether to modify the name of the tablespace during migration.

This parameter is used together with enableSyncTabTbsPro.

For example, USERSPACE1 is changed to TBS01.

Example:

remap tablespace example

{
  "remapTablespace": {
    "USERSPACE1": "TBS01"
  }
}

enableSyncTabTbsPro

Type: bool

Desc: Indicates whether to generate a DDL with the tablespace.

Default: false

noSupportPartTabToNormalTab

Type: bool

Desc: Convert a partition table that is not supported by the target to a normal table

Automatically remove subpartition table attributes that are not supported by the target

Oracle's List partition and Hash partition table are ordinary tables in MogDB.

Oracle's Range List composite partition table is a Range partition table in MogDB, and the sub-partition table is automatically removed

ignoreDB2PartInclusive

Type: bool

Desc: Indicates whether to ignore the INCLUSIVE property of the key value ENDING in the DB2 partition.

For example, in the table creation syntax of the DB2 partition, if ENDING contains the definition of the INCLUSIVE property, the DB2 partition will contain 20180101.

However, the openGauss range partitions do not support the INCLUSIVE but only less than property. In this case, the error "the part DATAMIN is included high value for db2 inclusive option" will occur. You can ignore the error by configuring the ignoreDB2PartInclusive parameter.

CREATE TABLE MTK1.TABLE_TEST_HAOTD
(
    DATADATE VARCHAR(8) NOT NULL,
    DATA1    VARCHAR(10),
    DATA2    VARCHAR(10)
) PARTITION BY RANGE(DATADATE) (
  PART "DATAMIN" STARTING(MINVALUE) ENDING('20180101') INCLUSIVE ,
  PART "P20180101" STARTING('20180101') ENDING('20180102') INCLUSIVE
)

Default: false

igNotSupportIntervalPart

Type: bool

Desc: Supports ignoring of some unsupported interval partition properties.

Default: false

ignoreTabPartition

Type: bool

Desc: Supports migration to the target database and ignoring of partition syntax.

Currently, this parameter supports only migration to MySQL.

Oracle

CREATE TABLE "MTK"."TAB_PART_LIST" (
  "DEPTNO" NUMBER(10,0) NOT NULL,
  "DEPTNAME" VARCHAR2(20 BYTE),
  "QUARTERLY_SALES" NUMBER(10,2),
  "STATE" VARCHAR2(2 BYTE)
) PARTITION BY LIST ("STATE")
(
  PARTITION "Q1_NORTHWEST" VALUES ('OR', 'WA') TABLESPACE "USERS",
  PARTITION "Q1_SOUTHWEST" VALUES ('AZ', 'CA', 'NM') TABLESPACE "USERS",
  PARTITION "Q1_NORTHEAST" VALUES ('NY', 'VT', 'NJ') TABLESPACE "USERS",
  PARTITION "Q1_SOUTHEAST" VALUES ('FL', 'GA') TABLESPACE "USERS",
  PARTITION "Q1_NORTHCENT" VALUES ('MN', 'WI') TABLESPACE "USERS",
  PARTITION "Q1_SOUTHCENT" VALUES ('OK', 'TX') TABLESPACE "USERS"
)

MySQL

CREATE TABLE mtk.tab_part_list (
  deptno BIGINT NOT NULL,
  deptname VARCHAR(20),
  quarterly_sales DECIMAL(10,2),
  state VARCHAR(2)
)

Default: false

autoAddMaxvaluePart

Type: bool

Desc: The parameter autoAddMaxvaluePart allows to automatically add a maxvalue partition to a partition table where no maxvalue partition exists.

For example, DB2 partitioned tables are migrated to openGauss.

DB2 allows defining minvalue partitions, which openGauss does not support.

When DB2 defines the minvalue partition without defining the maxvalue partition, the null value can be inserted into the minvalue partition, and openGauss will report an error.

But openGauss allows null value to be inserted into the maxvalue partition. This parameter can be used to enable automatic addition of maxvalue partitions.

DB2 does not define the maxvalue partition.

CREATE TABLE MTK1.PART_TAB_TEST02 (
 ID INTEGER NOT NULL,
 SALES_PERSON VARCHAR(50),
 REGION VARCHAR(50),
 SALES_DATE DATE
)
PARTITION BY RANGE(SALES_DATE)
(
 PART PJAN STARTING('2017-01-01') ENDING('2017-03-31') INCLUSIVE IN USERSPACE1,
 PART PFEB STARTING('2017-04-01') ENDING('2017-07-31') INCLUSIVE IN USERSPACE1,
 PART PMAR STARTING('2017-08-01') ENDING('2017-12-31') INCLUSIVE IN USERSPACE1,
 PART PAPR STARTING('2018-01-01') ENDING('2018-12-31') INCLUSIVE IN USERSPACE1
) ORGANIZE BY ROW

openGauss

CREATE TABLE DB2_MTK.PART_TAB_TEST02 (
 ID INTEGER NOT NULL,
 SALES_PERSON VARCHAR(50),
 REGION VARCHAR(50),
 SALES_DATE DATE
) PARTITION BY RANGE (SALES_DATE)
(
    PARTITION PJAN VALUES LESS THAN('2017-03-31'),
    PARTITION PFEB VALUES LESS THAN('2017-07-31'),
    PARTITION PMAR VALUES LESS THAN('2017-12-31'),
    PARTITION PAPR VALUES LESS THAN('2018-12-31'),
    PARTITION PART_MAXVALUE VALUES LESS THAN(MAXVALUE)
)

Add: v0.0.36

igErrorData

Type: bool

Desc:Ignores the data that failed to insert and logs to a file.

Only openGauss/MogDB/PostgreSQL/MySQL.

  • openGauss/MogDB/PostgreSQL

    batchCommit igErrorData copy Savepoint desc
    false false false all rollback
    false false true all rollback
    false true true Failed data not migrated
    true false false Keep successful Commit data
    true false true Keep successful Commit data
    true true true Failed data not migrated
  • MySQL

    batchCommit igErrorData desc
    false false all rollback
    false true Failed data not migrated
    true false Keep successful Commit data
    true true Failed data not migrated

Default: false

Add: v2.2.3

enableBatchCommit

Type: bool

Desc: enabel bactch commit

Default: false

Option:

  • true
  • false

mySQLSkipErrorDateTimeData

Type: bool

Desc: Automatically skips the wrong time of MySQL.

For example, datetime type: 0000-00-00 13:14:15

Default: false

Deprecated: Versions from 2.3.4 onwards are no longer supported.

Option:

  • true
  • false

autoAddMySQLAutoIncr

Type: bool

Desc: Migrate to MySQL to automatically add MySQL AUTO_INCREMENT column.

If the value is true, when the table does not have a AUTO_INCREMENT primary key column,automatically add the AUTO_INCREMENT column and change the original primary key to a unique key.

PK_ID BIGINT UNSIGNED PRIMARY KEY AUTO_INCREMENT NOT NULL [INVISIBLE]
  • Prior to MySQL 8.0.23 column are visible
  • MySQL 8.0.23 column are invisible column

MySQL supports invisible columns as of MySQL 8.0.23.
An invisible column is normally hidden to queries, but can be accessed if explicitly referenced.
Prior to MySQL 8.0.23, all columns are visible.

Used with ignoreTabPartition parameter.

  • Mig DB2 to MySQL

    • DB2

      CREATE TABLE MTK1.TAB_PK_TEST (
          COL1 VARCHAR(10) NOT NULL,
          ID BIGINT NOT NULL,
          COL2 VARCHAR(10),
          COL3 VARCHAR(10)
      ) IN USERSPACE1 ORGANIZE BY ROW
    • MySQL

      CREATE TABLE db2_mtk.tab_pk_test (
          -- auto increment primary key column
          pk_id BIGINT UNSIGNED PRIMARY KEY AUTO_INCREMENT NOT NULL INVISIBLE,
          col1 VARCHAR(10) NOT NULL,
          id BIGINT NOT NULL,
          col2 VARCHAR(10),
          col3 VARCHAR(10),
          -- The original primary key becomes the unique key
          UNIQUE KEY ( col1 )
      )

Default: false

Add: v2.1.1

autoAddMySQLAutoIncrTabList

Type: []string

Desc: Used with the AutoAddMySQLAutoIncr parameter.

Configure which tables automatically increment the auto_incr column. Ignored if the table already has a self-incrementing column. The default is empty to represent all tables.

Parameters are not case-sensitive

  • "TABLE_1"

    Allows all tables in the object named TABLE_1 to add auto_incr column

  • "Schema1.TABLE_1"

    Allows the object to add auto_incr column to TABLE_1 tables under Schema1

Default: null

Example:

autoAddMySQLAutoIncrTabList examples

{
  "autoAddMySQLAutoIncrTabList": [
    "TABLE_1",
    "Schema1.TABLE_1"
  ]
}

Add: v2.2.1

ignoreNotSupportDefault

Type: bool

Desc: Supports ignoring of some default values of some unsupported columns. For example, the sys_guid.

MTK of Oracle is embedded with a whitelist that will be ignored.

Default: false

replaceZeroDate

Type: string

Desc: openGauss/MogDB/PostgreSQL time format does not support 0000-00-00. Configuring this parameter will perform corresponding replacement. The replacement range is as follows:

  • Column default value
  • SQL statements in stored procedures/functions

When find a "zero" date: 0000-00-00 00:00:00 it is replaced by a NULL.

This could be a problem if your column is defined with NOT NULL constraint. If you can not remove the constraint,

use this directive to set an arbitral date that will be used instead.

You can also use -INFINITY if you don't want to use a fake date.

virtualColToNormalCol

Type: bool

Desc: Indicates whether to convert virtual columns in the source database into normal columns in the target database.

Default: false

Option:

  • true
  • false

virtualColConv

Type: map[string]string

Desc: Indicates the virtual column expression conversion function.

Example:

virtualColConv example

{
  "virtualColConv": {
    "LEFT(HOST,POSSTR(HOST,':')-1)": "SPLIT_PART(HOST,':',1)",
    "TRUNC_TIMESTAMP(SNAPTIME, 'HH') + (MINUTE(SNAPTIME) / 10 * 10 + 10) MINUTES": "date_trunc('hour',snaptime) + (date_part('minute',snaptime) / 10 +1)::int * interval '10 min'",
    "TRUNC_TIMESTAMP(SNAPTIME,'HH') + (MINUTE(SNAPTIME) / 10 * 10 + 10) minutes": "date_trunc('hour',snaptime) + (date_part('minute',snaptime) / 10 +1)::int * interval '10 min'",
    "TRUNC_TIMESTAMP(SNAPTIME,'HH')+ (MINUTE(SNAPTIME)/10*10 +10) MINUTES": "date_trunc('hour',snaptime) + (date_part('minute',snaptime) / 10 +1)::int * interval '10 min'",
    "TRUNC_TIMESTAMP(SNAPTIME,'HH')+ (MINUTE(SNAPTIME)/10*10 +10) minutes": "date_trunc('hour',snaptime) + (date_part('minute',snaptime) / 10 +1)::int * interval '10 min'"
  }
}

mySQLToOgCharExpression

Type: string

Desc:The length of fields in the original database is automatically multiplied by 3.

This parameter is valid for only the varchar/char field in the source database of MySQL

Deprecated: mtk scales up the length based on the db type,column type, db compatibility mode

convertOracleIntegerToNumeric

类型: bool

描述: Convert Oracle Integer type to NUMERIC. Support openGauss/MogDB/PostgreSQL

默认值: false

可选值:

  • true
  • false

enableOgBlobClob

Type: bool

Desc: Migrate other databases 'blob', 'blob' to openGaus 'blob', 'Clob'.

Default: false

Option:

  • true
  • false

skipColumnType

Type: map[string]int

Desc: This parameter allows you to control skip a data type column during migration.

Format: "column type name": int

Default: 0

Option:

  • 1 Do not create columns and do not migrate data
  • 2 Create columns but do not migrate data

Example:

skipColumnType example

{
  "skipColumnType": {
    "blob": 1,
    "clob": 2
  }
}

skipColumnName

Type: map[string]int

Desc: This parameter allows you to control skip a table column name during migration.

Priority over skipColumnType

Format: "schema.table_name.column": int

Default: 0

Option:

  • 1 Do not create columns and do not migrate data
  • 2 Create columns but do not migrate data

Example:

skipColumnName example

{
  "skipColumnName": {
    "schema1.tab_01.col1": 1,
    "schema1.tab_01.col2": 2
  }
}

charLengthChangeExclude

Type: []string

Desc: When migrating across character sets, specify an expression for the CHAR type, match column names without length expansion. Be careful to ignore capitalization issues.

  • ^update_time* ignore column name starts with update_time
  • ^update_time ignore column name for update_time
  • (?i)^update_time$ ignore column name for update_time. ignore case

示例:

Char Length Change Exclude Example

{
  "charLengthChangeExclude": [
    "^update_time*",
    "^visit_date$",
    "(?i)^visit_date$"
  ]
}

Add: v2.5.2

enableCharTrimRightSpace

Type: bool

Desc: For char migration to varchar, it is allowed to intercept the space on the right side of the char type. Only supports openGauss/MogDB on the target side

Default: false

Option:

  • true
  • false

Add: v2.7.1

convertPackageMethod

Type: string

Desc: How to migrate Oracle Package to openGauss/MogDB

openGauss database version greater than or equal to 3.0.0 Default package

openGauss database version greater than or equal to 2.1.0 can be configured as package or schema

openGauss databases smaller than 2.1.0 can only be configured as schema

Default: schema

Option:

  • schema
  • package

enableConvertSrid

Type: bool

Desc: Enable Convert Srid

Default: false

Option:

  • true
  • false

defaultSrid

Type: string

Desc: PostGis Default Srid

Default: 4326

seqLastNumAddNum

Type: int

Desc: How much to increase when synchronizing sequenced the last value.

Only supports openGauss/MogDB targets

Default: 0

templateSeqName

Type: string

Desc: MySQL automatically increments columns convert sequences, templates for sequence names

Default: SEQ_{{.TabName}}_{{.ColName}}

Only the following two variables are supported

仅支持以下两个变量

  • {{.TabName}} table name
  • {{.ColName}} column name

Default: SEQ_{{.TabName}}_{{.ColName}}

Example:

templateSeqName example

{
  "templateSeqName": "{{.TabName}}_{{.ColName}}_SEQ"
}

Add: v2.1.6

charAppendEmptyString

Type: bool

Desc: For ORA-29275: Partial multibyte character error.

When parameters are enabled, the Oracle query statement stitches the empty string. Primarily for the following types

  • Char
  • Character
  • NChar
  • Varchar
  • NVarchar
  • Varchar2
  • NVarchar2
select chr(195) from dual;         -- ORA-29275
select chr(195)||'' from dual;     -- normal

-- Chinese "证券投" GBK encoding
select utl_raw.cast_to_varchar2(hextoraw('D6A4C8AFCDB6D6')) from dual;          -- ORA-29275
select utl_raw.cast_to_varchar2(hextoraw('D6A4C8AFCDB6D6'))||'' from dual;      -- normal

Default: false

Option:

  • true
  • false

charsetTranscode

Type: bool

Desc: Transcode for wrong encoding.

  • Abnormal data in the table. GBK encoding exists in the UTF8 database
  • Chinese garbled characters in stored procedures -- not supported yet

Default: false

Add: v2.5.0

Copyright © 2009-2022 www.enmotech.com All rights reserved.