diff --git a/product/en/docs-mtk/v2.0/config/mtk-parameter/mtk-parameter-1.md b/product/en/docs-mtk/v2.0/config/mtk-parameter/mtk-parameter-1.md new file mode 100644 index 0000000000000000000000000000000000000000..1bf35732bb446736abb47702c3d360725bc711e8 --- /dev/null +++ b/product/en/docs-mtk/v2.0/config/mtk-parameter/mtk-parameter-1.md @@ -0,0 +1,684 @@ +--- +title: MTK Parameter +summary: MTK Parameter +author: mtk +date: 2023-02-17 14:26:11 +--- + +# MTK Parameter (1) + +## Parameter + +Parameter parameter configuration + +| Field | Type | Group | Description | +| ------------------------------------------------------------ | ----------------- | --------- | ------------------------------------------------------------ | +| [enableTableParallelQuery](#enabletableparallelquery) | int | | How to query table information. | +| [parallelInsert](#parallelinsert) | int | | Parallel Insert Parallelism. | +| [dropSchema](#dropschema) | bool | object | Drops the schema if it already exists in the target database | +| [dropExistingObject](#dropexistingobject) | bool | object | Drops the object if it already exists in the target database. | +| [truncTable](#trunctable) | bool | object | Prevent data conflict use when only migrating data. | +| [colKeyWords](#colkeywords) | map[string]int | object | Column name keywords. When the target is created, "" will be added automatically or the keyword will be case-converted. The format is: "name": option | +| [objKeyWords](#objkeywords) | map[string]int | object | When the target is created, it will automatically add "" or convert the keywords to upper and lower case. The format is: "name": option | +| [quoteMark](#quotemark) | bool | object | Whether double quotes or backticks are used for the generated object name. | +| [caseSensitive](#casesensitive) | int | object | Case conversion for the generated object name. | +| [ignoreTableDDLCompErr](#ignoretableddlcomperr) | bool | object | Ignore table structure comparison errors | +| [parallelIndex](#parallelindex) | int | object | Enable parallel creation of indexes for openGauss/MogDB, the maximum parallelism of a single index is 32. | +| [enableGlobalIndexToLocal](#enableglobalindextolocal) | bool | object | Convert the GLOBAL index of the non-unique index on the partition table to the LOCAL index. | +| [path](#path) | string | file | When exporting data as a file, specify the export directory. | +| [schemaPath](#schemapath) | string | file | sql script directory | +| [dataPath](#datapath) | string | file | data directory | +| [errDataPath](#errdatapath) | string | file | error data directory | +| [fileType](#filetype) | string | file | When exporting data as a file, the file type | +| [fileSize](#filesize) | string | file | The size of a single file when data is exported as a file. No limit if not specified. | +| [sqlDBType](#sqldbtype) | string | file | When exporting data to a file, specify the syntax of which database to generate. | +| [csvHeader](#csvheader) | bool | file | When the export file is csv, specify whether to include the csv file header. Not exported by default. | +| [csvNullValue](#csvnullvalue) | string | file | csv null value display | +| [csvFieldDelimiter](#csvfielddelimiter) | string | file | csv default delimiter. | +| [csvOptionallyEnclosed](#csvoptionallyenclosed) | string | file | Data wrapper. | +| [timeFormat](#timeformat) | string | file | Define the time format | +| [dateFormat](#dateformat) | string | file | Define date format | +| [dateTimeFormat](#datetimeformat) | string | file | Define the full format of the time | +| [excludeSysTable](#excludesystable) | []string | table | Exclude system object definitions. If not configured, use the default value | +| [enableSyncCompTabPro](#enablesynccomptabpro) | table | bool | Whether to configure the generated DDL to include table compression attribute syntax. Not generated by default. | +| [tableOptions](#tableoptions) | map[string]string | table | Configure the option to add table attributes when creating a table. Currently only openGauss/MogDB is supported. | +| [indexOptions](#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](#remapschema) | map[string]string | remap | Whether to rename the database schema during migration. | +| [remapTable](#remaptable) | map[string]string | remap | Whether to rename the table name during migration | +| [remapTablespace](#remaptablespace) | map[string]string | remap | Whether to rename the tablespace name during migration. | +| [enableSyncTabTbsPro](#enablesynctabtbspro) | bool | remap | Whether to configure the generated DDL to include tablespace syntax. Not generated by default | +| [noSupportPartTabToNormalTab](#nosupportparttabtonormaltab) | bool | partition | Convert a partition table not supported by the target to a normal table | +| [ignoreDB2PartInclusive](#ignoredb2partinclusive) | bool | partition | Whether to ignore the inclusion attribute of DB2 partition key value ENDING | +| [igNotSupportIntervalPart](#ignotsupportintervalpart) | bool | partition | Support ignore part of unsupported `intervalpart` attribute | +| [ignoreTabPartition](#ignoretabpartition) | bool | partition | Support migration to target database ignore partition syntax, now only support migration to MySQL. | +| [ignoreTabPartitionTabList](#ignoretabpartitiontablist) | []string | partition | `ignoreTabPartition` whitelist | +| [autoAddMaxvaluePart](#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](#igerrordata) | bool | data | Ignore failed insert data and log to error file. | +| [enableBatchCommit](#enablebatchcommit) | bool | data | enable batchSize commit | +| [replaceBCDate](#replacebcdate) | string | column | openGauss/MogDB/PostgreSQL time format does not support data before 4713 BC. Configuring this parameter will replace the data accordingly. | +| [mySQLSkipErrorDateTimeData](#mysqlskiperrordatetimedata) | bool | data | Automatically skip mysql error time. | +| [columnNameData](#columnnamedata) | map[string]string | data | Custom processing data conversion method. When the source configures this parameter, it is used to generate a SELECT statement, and when the target configures this parameter, it is used to generate an INSERT/COPY. | +| [autoAddMySQLAutoIncr](#autoaddmysqlautoincr) | bool | column | Migrating to MySQL automatically adds MySQL `AUTO_INCREMENT` columns | +| [autoAddMySQLAutoIncrTabList](#autoaddmysqlautoincrtablist) | []string | column | Use with the `autoAddMySQLAutoIncr` parameter. | +| [ignoreNotSupportDefault](#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](#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](#virtualcoltonormalcol) | bool | column | Whether to convert the virtual column of the source library to the normal column of the target library. | +| [virtualColConv](#virtualcolconv) | map[string]string | column | Virtual column expression conversion function | +| [mySQLToOgCharExpression](#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](#convertoracleintegertonumeric) | bool | column | Convert Oracle Integer type to NUMERIC. Support openGauss/MogDB/PostgreSQL | +| [enableOgBlobClob](#enableogblobclob) | bool | column | Blobs and Clobs migrated from other databases are openGauss Blobs and Clobs. | +| [skipColumnType](#skipcolumntype) | map[string]int | column | Skip a data type column when migrating | +| [skipColumnName](#skipcolumnname) | map[string]int | column | Skip a column when migrating | +| [charLengthChangeExclude](#charlengthchangeexclude) | []string | column | When migrating across character sets, the specified matching expression is ignored, and those column names are ignored without length expansion. | +| [enableCharTrimRightSpace](#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](#convertpackagemethod) | string | plsql | How to migrate Oracle Packages to openGauss/MogDB | +| [customFuncTrans](#customfunctrans) | []TranFunc | plsql | Custom conversion PLSQL regular expression. For example, migrating Oracle without parentheses to call the function internally by adding this parameter to complete the rewriting | +| [enableConvertSrid](#enableconvertsrid) | bool | gis | Enable Convert Srid | +| [defaultSrid](#defaultsrid) | string | gis | PostGis Default Srid | +| [seqLastNumAddNum](#seqlastnumaddnum) | int | sequence | How much to increase when synchronizing the sequence last value. | +| [templateSeqName](#templateseqname) | string | sequence | MySQL auto-incrementing column to sequence, template of sequence name | +| [charAppendEmptyString](#charappendemptystring) | bool | select | For ORA-29275: partial multibyte character error. In oracle query is concatenated string | +| [charsetTranscode](#charsettranscode) | bool | charset | Transcode for wrong encoding | + +Appears in: + +- [`Option`](./mtk-config.md#option).parameter + +**Example**: + +```json +{ + "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, + "ignoreTabPartitionTabList": [], + "autoAddMaxvaluePart": false, + "autoAddMySQLAutoIncr": false, + "autoAddMySQLAutoIncrTabList": [], + "ignoreNotSupportDefault": false, + "replaceZeroDate": "", + "replaceBCDate": "", + "virtualColToNormalCol": false, + "virtualColConv": {}, + "convertPackageMethod": "", + "convertOracleIntegerToNumeric": false, + "enableOgBlobClob": false, + "enableConvertSrid": false, + "defaultSrid": "4326", + "seqLastNumAddNum": 0, + "skipColumnType": {}, + "skipColumnName": {}, + "columnNameData": null, + "templateSeqName": "", + "charAppendEmptyString": false, + "tableOptions": {}, + "indexOptions": {}, + "enableGlobalIndexToLocal": false +} +``` + +### enableTableParallelQuery + +**Type**: int + +**Desc**: Ways to look up table information. + +- 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 + +**Option**: + +- 0 +- 1 + +### parallelInsert + +**Type**: int + +**Desc**: Parallel insert parallelism. + +Test feature. No modification required + +**Default**: `1` + +### dropSchema + +**Type**: bool + +**Desc**: Drops the schema if it already exists in the target database. + +**Default**: `false` + +**Option**: + +- 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 + +- 0 keyword is kept unchanged. +- 1 indicates lowercase. +- 2 indicates uppercase. + +**Option**: + +- 0 +- 1 +- 2 + +**Example**: + +Column KeyWords example + +```json +{ + "colKeyWords": { + "COL_STREAM": 1, + "COL_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. + +- 0 keyword is kept unchanged. +- 1 indicates lowercase. +- 2 indicates uppercase. + +**Option**: + +- 0 +- 1 +- 2 + +**Example**: + +Column KeyWords example + +```json +{ + "objKeyWords": { + "COL_STREAM": 1, + "COL_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. + +```sql +-- MySQl +`a1` +-- Oracle/PostgreSQL/openGauss/MogDB +"a1" +``` + +```sql +-- 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](#casesensitive) for object name case conversion. +Except for special keywords, special keywords use [objKeyWords](#objkeywords) and [colKeyWords](#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 + +### enableGlobalIndexToLocal + +**Type**: bool + +**Desc**: Convert the GLOBAL index of the non-unique index on the partition table to the LOCAL index. Only the target side is openGauss/MogDB + +**Default**: `false` + +**Option**: + +- true +- false + +**Add**: v2.7.3 + +### 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_` directory下 + +**Default**: `./data` + +### schemaPath + +**Type**: string + +**Desc**: sql script directory + +### dataPath + +**Type**: string + +**Desc**: data directory + +### errDataPath + +**Type**: string + +**Desc**: 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 + +```json +{ + "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 + +```json +{ + "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 + +```json +{ + "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 + +```json +{ + "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](#enableSyncTabTbsPro). + +For example, `USERSPACE1` is changed to `TBS01`. + +**Example**: + +remap tablespace example + +```json +{ + "remapTablespace": { + "USERSPACE1": "TBS01" + } +} +``` + +### enableSyncTabTbsPro + +**Type**: bool + +**Desc**: Indicates whether to generate a DDL with the tablespace. + +**Default**: `false` + +### noSupportPartTabToNormalTab + +**Type**: bool + +**Desc**: Convert the partition table not supported by the target end to a normal table, and automatically remove the attributes of the sub-partition table not supported by the target end. Supported methods for checking the partition table + +1. Whether the partition type supports +2. Whether the sub-partition type supports +3. interval partition type. For MogDB/openGauss +4. The partition key contains virtual columns. For MogDB/openGauss \ No newline at end of file diff --git a/product/en/docs-mtk/v2.0/config/mtk-parameter.md b/product/en/docs-mtk/v2.0/config/mtk-parameter/mtk-parameter-2.md similarity index 40% rename from product/en/docs-mtk/v2.0/config/mtk-parameter.md rename to product/en/docs-mtk/v2.0/config/mtk-parameter/mtk-parameter-2.md index 7659715dcf2a22b6014366c4bdd03b95a5518340..52e287cb671176e2665c89980b8dc452ce7d6181 100644 --- a/product/en/docs-mtk/v2.0/config/mtk-parameter.md +++ b/product/en/docs-mtk/v2.0/config/mtk-parameter/mtk-parameter-2.md @@ -1,689 +1,13 @@ --- -title: MTK Configuration File Description -summary: Configuration File Description +title: MTK Parameter +summary: MTK Parameter author: mtk -date: 2022-06-19 18:23:32 +date: 2023-02-17 14:26:11 --- -# MTK Parameter - -## Parameter - -Parameter parameter configuration - -| Field | Type | Group |Description | -|-------|------|-------|-------------| -| [enableTableParallelQuery](#enabletableparallelquery) |int | |How to query table information. | -| [parallelInsert](#parallelinsert) |int | |Parallel Insert Parallelism. | -| [dropSchema](#dropschema) |bool |object |Drops the schema if it already exists in the target database | -| [dropExistingObject](#dropexistingobject) |bool |object |Drops the object if it already exists in the target database. | -| [truncTable](#trunctable) |bool |object | Prevent data conflict use when only migrating data. | -| [colKeyWords](#colkeywords) |map[string]int |object |Column name keywords. When the target is created, "" will be added automatically or the keyword will be case-converted. The format is: "name": option | -| [objKeyWords](#objkeywords) |map[string]int |object |When the target is created, it will automatically add "" or convert the keywords to upper and lower case. The format is: "name": option | -| [quoteMark](#quotemark) |bool |object |Whether double quotes or backticks are used for the generated object name. | -| [caseSensitive](#casesensitive) |int |object |Case conversion for the generated object name. | -| [ignoreTableDDLCompErr](#ignoretableddlcomperr) |bool |object |Ignore table structure comparison errors | -| [parallelIndex](#parallelindex) |int |object |Enable parallel creation of indexes for openGauss/MogDB, the maximum parallelism of a single index is 32. | -| [enableGlobalIndexToLocal](#enableglobalindextolocal) |bool |object |Convert the GLOBAL index of the non-unique index on the partition table to the LOCAL index. | -| [path](#path) |string |file |When exporting data as a file, specify the export directory. | -| [schemaPath](#schemapath) |string |file |sql script directory | -| [dataPath](#datapath) |string |file |data directory | -| [errDataPath](#errdatapath) |string |file | error data directory | -| [fileType](#filetype) |string |file |When exporting data as a file, the file type | -| [fileSize](#filesize) |string |file | The size of a single file when data is exported as a file. No limit if not specified. | -| [sqlDBType](#sqldbtype) |string |file |When exporting data to a file, specify the syntax of which database to generate. | -| [csvHeader](#csvheader) |bool |file |When the export file is csv, specify whether to include the csv file header. Not exported by default. | -| [csvNullValue](#csvnullvalue) |string |file |csv null value display | -| [csvFieldDelimiter](#csvfielddelimiter) |string |file |csv default delimiter. | -| [csvOptionallyEnclosed](#csvoptionallyenclosed) |string |file |Data wrapper. | -| [timeFormat](#timeformat) |string|file |Define the time format | -| [dateFormat](#dateformat) |string |file |Define date format | -| [dateTimeFormat](#datetimeformat) |string |file |Define the full format of the time | -| [excludeSysTable](#excludesystable) |[]string |table |Exclude system object definitions. If not configured, use the default value | -| [enableSyncCompTabPro](#enablesynccomptabpro) |table |bool | Whether to configure the generated DDL to include table compression attribute syntax. Not generated by default. | -| [tableOptions](#tableoptions) |map[string]string |table |Configure the option to add table attributes when creating a table. Currently only openGauss/MogDB is supported. | -| [indexOptions](#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](#remapschema) |map[string]string |remap |Whether to rename the database schema during migration. | -| [remapTable](#remaptable) |map[string]string |remap |Whether to rename the table name during migration | -| [remapTablespace](#remaptablespace) |map[string]string |remap |Whether to rename the tablespace name during migration. | -| [enableSyncTabTbsPro](#enablesynctabtbspro) |bool |remap | Whether to configure the generated DDL to include tablespace syntax. Not generated by default | -| [noSupportPartTabToNormalTab](#nosupportparttabtonormaltab) |bool |partition |Convert a partition table not supported by the target to a normal table | -| [ignoreDB2PartInclusive](#ignoredb2partinclusive) |bool |partition |Whether to ignore the inclusion attribute of DB2 partition key value ENDING | -| [igNotSupportIntervalPart](#ignotsupportintervalpart) |bool |partition |Support ignore part of unsupported `intervalpart` attribute | -| [ignoreTabPartition](#ignoretabpartition) |bool |partition |Support migration to target database ignore partition syntax, now only support migration to MySQL. | -| [ignoreTabPartitionTabList](#ignoretabpartitiontablist) |[]string |partition |`ignoreTabPartition` whitelist | -| [autoAddMaxvaluePart](#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](#igerrordata) |bool |data |Ignore failed insert data and log to error file. | -| [enableBatchCommit](#enablebatchcommit) |bool |data|enable batchSize commit| -| [replaceBCDate](#replacebcdate) |string |column |openGauss/MogDB/PostgreSQL time format does not support data before 4713 BC. Configuring this parameter will replace the data accordingly. | -| [mySQLSkipErrorDateTimeData](#mysqlskiperrordatetimedata) |bool |data| Automatically skip mysql error time. | -| [columnNameData](#columnnamedata) |map[string]string |data |Custom processing data conversion method. When the source configures this parameter, it is used to generate a SELECT statement, and when the target configures this parameter, it is used to generate an INSERT/COPY. | -| [autoAddMySQLAutoIncr](#autoaddmysqlautoincr) |bool |column |Migrating to MySQL automatically adds MySQL `AUTO_INCREMENT` columns | -| [autoAddMySQLAutoIncrTabList](#autoaddmysqlautoincrtablist) |[]string |column |Use with the `autoAddMySQLAutoIncr` parameter. | -| [ignoreNotSupportDefault](#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](#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](#virtualcoltonormalcol) |bool |column |Whether to convert the virtual column of the source library to the normal column of the target library. | -| [virtualColConv](#virtualcolconv) |map[string]string |column |Virtual column expression conversion function | -| [mySQLToOgCharExpression](#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](#convertoracleintegertonumeric) |bool |column |Convert Oracle Integer type to NUMERIC. Support openGauss/MogDB/PostgreSQL | -| [enableOgBlobClob](#enableogblobclob) |bool |column |Blobs and Clobs migrated from other databases are openGauss Blobs and Clobs. | -| [skipColumnType](#skipcolumntype) |map[string]int |column |Skip a data type column when migrating | -| [skipColumnName](#skipcolumnname) |map[string]int |column |Skip a column when migrating | -| [charLengthChangeExclude](#charlengthchangeexclude) |[]string |column |When migrating across character sets, the specified matching expression is ignored, and those column names are ignored without length expansion. | -| [enableCharTrimRightSpace](#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](#convertpackagemethod) |string |plsql |How to migrate Oracle Packages to openGauss/MogDB | -| [customFuncTrans](#customfunctrans) |[]TranFunc |plsql |Custom conversion PLSQL regular expression. For example, migrating Oracle without parentheses to call the function internally by adding this parameter to complete the rewriting | -| [enableConvertSrid](#enableconvertsrid) |bool |gis |Enable Convert Srid | -| [defaultSrid](#defaultsrid) |string |gis |PostGis Default Srid | -| [seqLastNumAddNum](#seqlastnumaddnum) |int |sequence | How much to increase when synchronizing the sequence last value. | -| [templateSeqName](#templateseqname) |string |sequence |MySQL auto-incrementing column to sequence, template of sequence name | -| [charAppendEmptyString](#charappendemptystring) |bool |select |For ORA-29275: partial multibyte character error. In oracle query is concatenated string | -| [charsetTranscode](#charsettranscode) |bool |charset |Transcode for wrong encoding | - -Appears in: - -- [`Option`](./mtk-config.md#option).parameter +# MTK Parameter (2) -**Example**: - -```json -{ - "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, - "ignoreTabPartitionTabList": [], - "autoAddMaxvaluePart": false, - "autoAddMySQLAutoIncr": false, - "autoAddMySQLAutoIncrTabList": [], - "ignoreNotSupportDefault": false, - "replaceZeroDate": "", - "replaceBCDate": "", - "virtualColToNormalCol": false, - "virtualColConv": {}, - "convertPackageMethod": "", - "convertOracleIntegerToNumeric": false, - "enableOgBlobClob": false, - "enableConvertSrid": false, - "defaultSrid": "4326", - "seqLastNumAddNum": 0, - "skipColumnType": {}, - "skipColumnName": {}, - "columnNameData": null, - "templateSeqName": "", - "charAppendEmptyString": false, - "tableOptions": {}, - "indexOptions": {}, - "enableGlobalIndexToLocal": false -} -``` - -### enableTableParallelQuery - -**Type**: int - -**Desc**: Ways to look up table information. - -- 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 - -**Option**: - -- 0 -- 1 - -### parallelInsert - -**Type**: int - -**Desc**: Parallel insert parallelism. - -Test feature. No modification required - -**Default**: `1` - -### dropSchema - -**Type**: bool - -**Desc**: Drops the schema if it already exists in the target database. - -**Default**: `false` - -**Option**: - -- 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 - -- 0 keyword is kept unchanged. -- 1 indicates lowercase. -- 2 indicates uppercase. - -**Option**: - -- 0 -- 1 -- 2 - -**Example**: - -Column KeyWords example - -```json -{ - "colKeyWords": { - "COL_STREAM": 1, - "COL_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. - -- 0 keyword is kept unchanged. -- 1 indicates lowercase. -- 2 indicates uppercase. - -**Option**: - -- 0 -- 1 -- 2 - -**Example**: - -Column KeyWords example - -```json -{ - "objKeyWords": { - "COL_STREAM": 1, - "COL_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. - -```sql --- MySQl -`a1` --- Oracle/PostgreSQL/openGauss/MogDB -"a1" -``` - -```sql --- 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](#casesensitive) for object name case conversion. -Except for special keywords, special keywords use [objKeyWords](#objkeywords) and [colKeyWords](#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 - -### enableGlobalIndexToLocal - -**Type**: bool - -**Desc**: Convert the GLOBAL index of the non-unique index on the partition table to the LOCAL index. Only the target side is openGauss/MogDB - -**Default**: `false` - -**Option**: - -- true -- false - -**Add**: v2.7.3 - -### 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_` directory下 - -**Default**: `./data` - -### schemaPath - -**Type**: string - -**Desc**: sql script directory - -### dataPath - -**Type**: string - -**Desc**: data directory - -### errDataPath - -**Type**: string - -**Desc**: 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 - -```json -{ - "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 - -```json -{ - "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 - -```json -{ - "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 - -```json -{ - "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](#enableSyncTabTbsPro). - -For example, `USERSPACE1` is changed to `TBS01`. - -**Example**: - -remap tablespace example - -```json -{ - "remapTablespace": { - "USERSPACE1": "TBS01" - } -} -``` - -### enableSyncTabTbsPro - -**Type**: bool - -**Desc**: Indicates whether to generate a DDL with the tablespace. - -**Default**: `false` - -### noSupportPartTabToNormalTab - -**Type**: bool - -**Desc**: Convert the partition table not supported by the target end to a normal table, and automatically remove the attributes of the sub-partition table not supported by the target end. Supported methods for checking the partition table - -1. Whether the partition type supports -2. Whether the sub-partition type supports -3. interval partition type. For MogDB/openGauss -4. The partition key contains virtual columns. For MogDB/openGauss - -### ignoreDB2PartInclusive +## ignoreDB2PartInclusive **Type**: bool @@ -709,7 +33,7 @@ CREATE TABLE MTK1.TABLE_TEST_HAOTD **Default**: `false` -### igNotSupportIntervalPart +## igNotSupportIntervalPart **Type**: bool @@ -717,7 +41,7 @@ CREATE TABLE MTK1.TABLE_TEST_HAOTD **Default**: `false` -### ignoreTabPartition +## ignoreTabPartition **Type**: bool @@ -757,7 +81,7 @@ CREATE TABLE mtk.tab_part_list ( **Default**: `false` -### ignoreTabPartitionTabList +## ignoreTabPartitionTabList **Type**: []string @@ -786,7 +110,7 @@ ignore Table Partition Table List Example **Add**: v2.8.0 -### autoAddMaxvaluePart +## autoAddMaxvaluePart **Type**: bool @@ -838,7 +162,7 @@ CREATE TABLE DB2_MTK.PART_TAB_TEST02 ( **Add**: v0.0.36 -### igErrorData +## igErrorData **Type**: bool @@ -848,29 +172,29 @@ 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 | + | 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 | + | 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 +## enableBatchCommit **Type**: bool @@ -883,7 +207,7 @@ Only openGauss/MogDB/PostgreSQL/MySQL. - true - false -### replaceBCDate +## replaceBCDate **Type**: string @@ -903,7 +227,7 @@ Replace BC Date Example **Add**: v2.8.0 -### mySQLSkipErrorDateTimeData +## mySQLSkipErrorDateTimeData **Type**: bool @@ -920,7 +244,7 @@ For example, datetime type: `0000-00-00 13:14:15` - true - false -### columnNameData +## columnNameData **Type**: map[string]string @@ -954,7 +278,7 @@ Target ColumnName Data Process Example } ``` -### autoAddMySQLAutoIncr +## autoAddMySQLAutoIncr **Type**: bool @@ -1009,7 +333,7 @@ Used with [ignoreTabPartition](#ignoretabpartition) parameter. **Add**: v2.1.1 -### autoAddMySQLAutoIncrTabList +## autoAddMySQLAutoIncrTabList **Type**: []string @@ -1039,7 +363,7 @@ autoAddMySQLAutoIncrTabList examples **Add**: v2.2.1 -### ignoreNotSupportDefault +## ignoreNotSupportDefault **Type**: bool @@ -1047,7 +371,7 @@ autoAddMySQLAutoIncrTabList examples **Default**: `false` -### replaceZeroDate +## replaceZeroDate **Type**: string @@ -1065,7 +389,7 @@ autoAddMySQLAutoIncrTabList examples > > You can also use -INFINITY if you don't want to use a fake date. -### virtualColToNormalCol +## virtualColToNormalCol **Type**: bool @@ -1078,7 +402,7 @@ autoAddMySQLAutoIncrTabList examples - true - false -### virtualColConv +## virtualColConv **Type**: map[string]string @@ -1100,7 +424,7 @@ virtualColConv example } ``` -### mySQLToOgCharExpression +## mySQLToOgCharExpression **Type**: string @@ -1110,7 +434,7 @@ This parameter is valid for only the varchar/char field in the source database o **Deprecated**: mtk scales up the length based on the db type,column type, db compatibility mode -### convertOracleIntegerToNumeric +## convertOracleIntegerToNumeric **Type**: bool @@ -1123,7 +447,7 @@ This parameter is valid for only the varchar/char field in the source database o - true - false -### enableOgBlobClob +## enableOgBlobClob **Type**: bool @@ -1136,7 +460,7 @@ This parameter is valid for only the varchar/char field in the source database o - true - false -### skipColumnType +## skipColumnType **Type**: map[string]int @@ -1167,7 +491,7 @@ skipColumnType example } ``` -### skipColumnName +## skipColumnName **Type**: map[string]int @@ -1200,7 +524,7 @@ skipColumnName example } ``` -### charLengthChangeExclude +## charLengthChangeExclude **Type**: []string @@ -1227,7 +551,7 @@ Char Length Change Exclude Example **Add**: v2.5.2 -### enableCharTrimRightSpace +## enableCharTrimRightSpace **Type**: bool @@ -1242,7 +566,7 @@ Char Length Change Exclude Example **Add**: v2.7.1 -### convertPackageMethod +## convertPackageMethod **Type**: string @@ -1261,7 +585,7 @@ openGauss databases smaller than 2.1.0 can only be configured as `schema` - schema - package -### customFuncTrans +## customFuncTrans **Type**: []TranFunc @@ -1288,7 +612,7 @@ Rewrite Oracle Call No args function **Add**: v2.8.1 -### enableConvertSrid +## enableConvertSrid **Type**: bool @@ -1301,7 +625,7 @@ Rewrite Oracle Call No args function - true - false -### defaultSrid +## defaultSrid **Type**: string @@ -1309,7 +633,7 @@ Rewrite Oracle Call No args function **Default**: `4326` -### seqLastNumAddNum +## seqLastNumAddNum **Type**: int @@ -1319,7 +643,7 @@ Only supports openGauss/MogDB targets **Default**: `0` -### templateSeqName +## templateSeqName **Type**: string @@ -1346,7 +670,7 @@ templateSeqName example **Add**: v2.1.6 -### charAppendEmptyString +## charAppendEmptyString **Type**: bool @@ -1378,7 +702,7 @@ select utl_raw.cast_to_varchar2(hextoraw('D6A4C8AFCDB6D6'))||'' from dual; - true - false -### charsetTranscode +## charsetTranscode **Type**: bool @@ -1389,4 +713,4 @@ select utl_raw.cast_to_varchar2(hextoraw('D6A4C8AFCDB6D6'))||'' from dual; **Default**: false -**Add**: v2.5.0 +**Add**: v2.5.0 \ No newline at end of file diff --git a/product/en/docs-mtk/v2.0/config/mtk-parameter/overview-of-mtk-parameter.md b/product/en/docs-mtk/v2.0/config/mtk-parameter/overview-of-mtk-parameter.md new file mode 100644 index 0000000000000000000000000000000000000000..4b2c0be601f1ce1cccfab8d1915688a8ffefe946 --- /dev/null +++ b/product/en/docs-mtk/v2.0/config/mtk-parameter/overview-of-mtk-parameter.md @@ -0,0 +1,12 @@ +--- +title: MTK Parameter +summary: MTK Parameter +author: mtk +date: 2023-02-17 14:26:11 +--- + +# MTK Parameter + +[MTK Parameter (1)](mtk-parameter-1.md) + +[MTK Parameter (2)](mtk-parameter-2.md) \ No newline at end of file diff --git a/product/en/docs-mtk/v2.0/toc.md b/product/en/docs-mtk/v2.0/toc.md index 7f4d524db04727fe266c99d3ceb43cd0f09c9eaa..a2a721b20da73908cddea3ff7aedc0d8376b7282 100644 --- a/product/en/docs-mtk/v2.0/toc.md +++ b/product/en/docs-mtk/v2.0/toc.md @@ -11,7 +11,9 @@ + [Config Overview](./config/mtk-config.md) + [Object](./config/mtk-object.md) + [Limit](./config/mtk-limit.md) - + [Parameter](./config/mtk-parameter.md) + + [Parameter](./config/mtk-parameter/overview-of-mtk-parameter.md) + + [Parameter (1)](./config/mtk-parameter/mtk-parameter-1.md) + + [Parameter (2)](./config/mtk-parameter/mtk-parameter-2.md) + [Data Source Name](./config/mtk-dsn.md) + Commands + [mtk](./commands/mtk.md) diff --git a/product/zh/docs-mogdb-stack/v2.0/references/server/crd-references.md b/product/zh/docs-mogdb-stack/v2.0/references/server/crd-references/crd-references-1.md similarity index 52% rename from product/zh/docs-mogdb-stack/v2.0/references/server/crd-references.md rename to product/zh/docs-mogdb-stack/v2.0/references/server/crd-references/crd-references-1.md index e6b17d5e09a5d48be146b16c9e8719d7811cab4e..cc0d94a2062d62590a34558c0eeae7da5bfa174b 100644 --- a/product/zh/docs-mogdb-stack/v2.0/references/server/crd-references.md +++ b/product/zh/docs-mogdb-stack/v2.0/references/server/crd-references/crd-references-1.md @@ -5,7 +5,7 @@ author: Wang Dong date: 2022-12-14 --- -# CRD 参考 +# CRD 参考(一) ## 资源类型 @@ -185,188 +185,3 @@ MogdbClusterSpec 定义MogdbCluster期望的状态 | StartupInstance | string | 开始实现 | true | | FirstInstance | string | 第一次实现 | true | | HaService | string | ha服务 | true | - -
- -### MogdbCluster.status.conditions - -| 名称 | 类型 | 描述 | 必选项 | -|--------------------|---------|---------|-------| -| type | string | 状况类型 | true | -| status | string | 状况的状态 | true | -| lastTransitionTime | time | 状况发生的时间 | true | -| reason | string | 状况的原因 | true | -| message | string | 状况信息 | true | - -
- -### MogdbCluster.status.RestoreStatus - -| 名称 | 类型 | 描述 | 必选项 | -|----------------|---------|--------|-------| -| id | string | 恢复ID | true | -| finished | bool | 是否已经结束 | true | -| startTime | time | 开始时间 | true | -| completionTime | time | 完成时间 | true | -| active | integer | 进行中数量 | true | -| succeeded | integer | 成功数量 | true | -| Failed | integer | 失败数量 | true | - -
- -### MogdbCluster.status.BackupStatus - -| 名称 | 类型 | 描述 | 必选项 | -|---------------------------|----------|------|-------| -| ManualBackups | []object | 手动备份 | true | -| ScheduledBackups | []object | 自动备份 | true | - -
- -### MogdbCluster.status.BackupStatus.ManualBackups - -| 名称 | 类型 | 描述 | 必选项 | -|-------------------|----------|---------|-------| -| name | string | 备份名称 | true | -| backupType | string | 备份类型 | true | -| backupLevel | string | 备份级别 | true | -| backupFile | string | 备份文件 | true | -| startTime | time | 开始时间 | true | -| completionTime | time | 结束时间动 | true | -| active | integer | 进行中数量 | true | -| succeeded | integer | 成功数量 | true | -| failed | integer | 失败数量 | true | -| finished | bool | 是否已经结束 | true | - -
- -### MogdbCluster.status.BackupStatus.ScheduledBackups - -| 名称 | 类型 | 描述 | 必选项 | -|-------------------|----------|---------|-------| -| name | string | 备份名称 | true | -| backupType | string | 备份类型 | true | -| backupLevel | string | 备份级别 | true | -| backupFile | string | 备份文件 | true | -| startTime | time | 开始时间 | true | -| completionTime | time | 结束时间动 | true | -| active | integer | 进行中数量 | true | -| succeeded | integer | 成功数量 | true | -| failed | integer | 失败数量 | true | -| finished | bool | 是否已经结束 | true | - -
- -### MogdbCluster.status.nodes - -| 名称 | 类型 | 描述 | 必选项 | -|-------------|-----------|-----------|-------| -| name | string | 集群节点状态的名称 | true | -| conditions | []object | 节点状况集合 | true | - -
- -### MogdbCluster.status.nodes.conditions - -| 名称 | 类型 | 描述 | 必选项 | -|---------------------|--------|----------|-------| -| type | string | 状况类型 | true | -| status | string | 状况的状态 | true | -| lastTransitionTime | time | 状况发生的时间 | true | - -
- -## MogdbBackup - -MogdbBackup是MogdbBackup API的简单概要 - -| 名称 | 类型 | 描述 | 必选项 | -|------------|---------|-------------------------|--------| -| apiVersion | string | mogdb.enmotech.io/v1 | true | -| kind | string | MogdbBackup | true | -| metadata | object | 相关字段参考 Kubernetes API文档 | true | -| spec | object | 定义MogdbBackup期望的状态 | false | -| status | object | 定义MogdbBackup观测到的状态 | false | - -
- -### MogdbBackup.spec - -| 名称 | 类型 | 描述 | 必选项 | -|-------------|--------|-------------------|--------| -| clusterName | string | MogDB cluster集群名称 | true | -| image | string | 备份历史保留天数 | false | -| baseBackup | object | 逻辑配分配置 | false | -| dumpAll | object | 物理备份配置 | false | - -
- -### MogdbBackup.spec.BaseBackup - -| 名称 | 类型 | 描述 | 必选项 | -|-------------|----------|----------|--------| -| name | string | 备份名称 | true | -| backupLevel | string | 备份级别 | false | -| fileName | string | 备份文件名称 | false | -| dbName | string | 指定备份数据库 | false | -| tbNames | []string | 指定备份表格 | false | -| s3 | object | s3对象存储配置 | false | - -
- -### MogdbBackup.spec.BaseBackup.S3 - -| 名称 | 类型 | 描述 | 必选项 | -|-------------|----------|---------|-------| -| region | string | regin | false | -| secretName | string | 访问密钥 | true | -| provider | string | s3存储提供者 | true | -| endPoint | string | 节点 | true | -| bucket | string | 存储桶 | true | - -
- -### MogdbBackup.spec.dumpAll - -| 名称 | 类型 | 描述 | 必选项 | -|-------------|----------|----------|--------| -| name | string | 备份名称 | true | -| backupLevel | string | 备份级别 | false | -| fileName | string | 备份文件名称 | false | -| dbName | string | 指定备份数据库 | false | -| tbNames | []string | 指定备份表格 | false | -| s3 | object | s3对象存储配置 | false | - -
- -### MogdbBackup.spec.dumpAll.S3 - -| 名称 | 类型 | 描述 | 必选项 | -|-------------|----------|---------|-------| -| region | string | regin | false | -| secretName | string | 访问密钥 | true | -| provider | string | s3存储提供者 | true | -| endPoint | string | 节点 | true | -| bucket | string | 存储桶 | true | - -
- -### MogdbBackup.status - -| 名称 | 类型 | 描述 | 必选项 | -|--------------------|-----------|---------|-------| -| completed | bool | 备份是否完成 | true | -| completedTimestamp | time | 备份完成的时间 | true | -| conditions | []object | 备份状况列表 | true | - -
- -### MogdbBackup.status.conditions - -| 名称 | 类型 | 描述 | 必选项 | -|--------------------|---------|---------|-------| -| type | string | 状况类型 | true | -| status | string | 状况的状态 | true | -| lastTransitionTime | time | 状况发生的时间 | true | -| reason | string | 状况发生的原因 | true | -| message | string | 状况详情 | true | \ No newline at end of file diff --git a/product/zh/docs-mogdb-stack/v2.0/references/server/crd-references/crd-references-2.md b/product/zh/docs-mogdb-stack/v2.0/references/server/crd-references/crd-references-2.md new file mode 100644 index 0000000000000000000000000000000000000000..38e27d8447af546b382e7a10b2c7ac1faf07a5ff --- /dev/null +++ b/product/zh/docs-mogdb-stack/v2.0/references/server/crd-references/crd-references-2.md @@ -0,0 +1,193 @@ +--- +title: CRD 参考 +summary: CRD 参考 +author: Wang Dong +date: 2022-12-14 +--- + +# CRD 参考 (二) + +## MogdbCluster + +### MogdbCluster.status.conditions + +| 名称 | 类型 | 描述 | 必选项 | +| ------------------ | ------ | -------------- | ------ | +| type | string | 状况类型 | true | +| status | string | 状况的状态 | true | +| lastTransitionTime | time | 状况发生的时间 | true | +| reason | string | 状况的原因 | true | +| message | string | 状况信息 | true | + +
+ +### MogdbCluster.status.RestoreStatus + +| 名称 | 类型 | 描述 | 必选项 | +| -------------- | ------- | ------------ | ------ | +| id | string | 恢复ID | true | +| finished | bool | 是否已经结束 | true | +| startTime | time | 开始时间 | true | +| completionTime | time | 完成时间 | true | +| active | integer | 进行中数量 | true | +| succeeded | integer | 成功数量 | true | +| Failed | integer | 失败数量 | true | + +
+ +### MogdbCluster.status.BackupStatus + +| 名称 | 类型 | 描述 | 必选项 | +| ---------------- | -------- | -------- | ------ | +| ManualBackups | []object | 手动备份 | true | +| ScheduledBackups | []object | 自动备份 | true | + +
+ +### MogdbCluster.status.BackupStatus.ManualBackups + +| 名称 | 类型 | 描述 | 必选项 | +| -------------- | ------- | ------------ | ------ | +| name | string | 备份名称 | true | +| backupType | string | 备份类型 | true | +| backupLevel | string | 备份级别 | true | +| backupFile | string | 备份文件 | true | +| startTime | time | 开始时间 | true | +| completionTime | time | 结束时间动 | true | +| active | integer | 进行中数量 | true | +| succeeded | integer | 成功数量 | true | +| failed | integer | 失败数量 | true | +| finished | bool | 是否已经结束 | true | + +
+ +### MogdbCluster.status.BackupStatus.ScheduledBackups + +| 名称 | 类型 | 描述 | 必选项 | +| -------------- | ------- | ------------ | ------ | +| name | string | 备份名称 | true | +| backupType | string | 备份类型 | true | +| backupLevel | string | 备份级别 | true | +| backupFile | string | 备份文件 | true | +| startTime | time | 开始时间 | true | +| completionTime | time | 结束时间动 | true | +| active | integer | 进行中数量 | true | +| succeeded | integer | 成功数量 | true | +| failed | integer | 失败数量 | true | +| finished | bool | 是否已经结束 | true | + +
+ +### MogdbCluster.status.nodes + +| 名称 | 类型 | 描述 | 必选项 | +| ---------- | -------- | ------------------ | ------ | +| name | string | 集群节点状态的名称 | true | +| conditions | []object | 节点状况集合 | true | + +
+ +### MogdbCluster.status.nodes.conditions + +| 名称 | 类型 | 描述 | 必选项 | +| ------------------ | ------ | -------------- | ------ | +| type | string | 状况类型 | true | +| status | string | 状况的状态 | true | +| lastTransitionTime | time | 状况发生的时间 | true | + +
+ +## MogdbBackup + +MogdbBackup是MogdbBackup API的简单概要 + +| 名称 | 类型 | 描述 | 必选项 | +| ---------- | ------ | ------------------------------- | ------ | +| apiVersion | string | mogdb.enmotech.io/v1 | true | +| kind | string | MogdbBackup | true | +| metadata | object | 相关字段参考 Kubernetes API文档 | true | +| spec | object | 定义MogdbBackup期望的状态 | false | +| status | object | 定义MogdbBackup观测到的状态 | false | + +
+ +### MogdbBackup.spec + +| 名称 | 类型 | 描述 | 必选项 | +| ----------- | ------ | --------------------- | ------ | +| clusterName | string | MogDB cluster集群名称 | true | +| image | string | 备份历史保留天数 | false | +| baseBackup | object | 逻辑配分配置 | false | +| dumpAll | object | 物理备份配置 | false | + +
+ +### MogdbBackup.spec.BaseBackup + +| 名称 | 类型 | 描述 | 必选项 | +| ----------- | -------- | -------------- | ------ | +| name | string | 备份名称 | true | +| backupLevel | string | 备份级别 | false | +| fileName | string | 备份文件名称 | false | +| dbName | string | 指定备份数据库 | false | +| tbNames | []string | 指定备份表格 | false | +| s3 | object | s3对象存储配置 | false | + +
+ +### MogdbBackup.spec.BaseBackup.S3 + +| 名称 | 类型 | 描述 | 必选项 | +| ---------- | ------ | ------------ | ------ | +| region | string | regin | false | +| secretName | string | 访问密钥 | true | +| provider | string | s3存储提供者 | true | +| endPoint | string | 节点 | true | +| bucket | string | 存储桶 | true | + +
+ +### MogdbBackup.spec.dumpAll + +| 名称 | 类型 | 描述 | 必选项 | +| ----------- | -------- | -------------- | ------ | +| name | string | 备份名称 | true | +| backupLevel | string | 备份级别 | false | +| fileName | string | 备份文件名称 | false | +| dbName | string | 指定备份数据库 | false | +| tbNames | []string | 指定备份表格 | false | +| s3 | object | s3对象存储配置 | false | + +
+ +### MogdbBackup.spec.dumpAll.S3 + +| 名称 | 类型 | 描述 | 必选项 | +| ---------- | ------ | ------------ | ------ | +| region | string | regin | false | +| secretName | string | 访问密钥 | true | +| provider | string | s3存储提供者 | true | +| endPoint | string | 节点 | true | +| bucket | string | 存储桶 | true | + +
+ +### MogdbBackup.status + +| 名称 | 类型 | 描述 | 必选项 | +| ------------------ | -------- | -------------- | ------ | +| completed | bool | 备份是否完成 | true | +| completedTimestamp | time | 备份完成的时间 | true | +| conditions | []object | 备份状况列表 | true | + +
+ +### MogdbBackup.status.conditions + +| 名称 | 类型 | 描述 | 必选项 | +| ------------------ | ------ | -------------- | ------ | +| type | string | 状况类型 | true | +| status | string | 状况的状态 | true | +| lastTransitionTime | time | 状况发生的时间 | true | +| reason | string | 状况发生的原因 | true | +| message | string | 状况详情 | true | \ No newline at end of file diff --git a/product/zh/docs-mogdb-stack/v2.0/references/server/crd-references/overview-of-crd-references.md b/product/zh/docs-mogdb-stack/v2.0/references/server/crd-references/overview-of-crd-references.md new file mode 100644 index 0000000000000000000000000000000000000000..d47a3c658b40b4d94ae25a0c62b0228d4a6d8966 --- /dev/null +++ b/product/zh/docs-mogdb-stack/v2.0/references/server/crd-references/overview-of-crd-references.md @@ -0,0 +1,12 @@ +--- +title: CRD 参考 +summary: CRD 参考 +author: Wang Dong +date: 2022-12-14 +--- + +# CRD 参考 + +[CRD 参考(一)](crd-references-1.md) + +[CRD 参考(二)](crd-references-2.md) \ No newline at end of file diff --git a/product/zh/docs-mogdb-stack/v2.0/toc.md b/product/zh/docs-mogdb-stack/v2.0/toc.md index 05ccd51db8e419a841eb68062d611ec6bdf5c00e..2bc525569bec384a99777d30a8a6275d6851decf 100644 --- a/product/zh/docs-mogdb-stack/v2.0/toc.md +++ b/product/zh/docs-mogdb-stack/v2.0/toc.md @@ -59,7 +59,9 @@ + [mgo minio object stat](references/client/mgo-minio-object-stat.md) + [mgo minio object getf](references/client/mgo-minio-object-getf.md) + 服务端 - + [CRD参考](references/server/crd-references.md) + + [CRD参考](references/server/crd-references/overview-of-crd-references.md) + + [CRD参考(一)](references/server/crd-references/crd-references-1.md) + + [CRD参考(二)](references/server/crd-references/crd-references-2.md) + [MogDB集群参考](references/server/mogdbcluster-sample.md) + [MogDB备份参考](references/server/mogdbbackup-sample.md) + [FAQ](faq.md) diff --git a/product/zh/docs-mtk/v2.0/config/mtk-parameter.md b/product/zh/docs-mtk/v2.0/config/mtk-parameter/mtk-parameter-1.md similarity index 55% rename from product/zh/docs-mtk/v2.0/config/mtk-parameter.md rename to product/zh/docs-mtk/v2.0/config/mtk-parameter/mtk-parameter-1.md index 97a62168317286c6bc4fbe3073be989039fb755d..d9a7f4a359efe2ed6d2b2fdd6efc362308dda435 100644 --- a/product/zh/docs-mtk/v2.0/config/mtk-parameter.md +++ b/product/zh/docs-mtk/v2.0/config/mtk-parameter/mtk-parameter-1.md @@ -5,7 +5,7 @@ author: mtk date: 2023-02-17 14:26:11 --- -# MTK Parameter +# MTK 参数(一) ## Parameter @@ -681,704 +681,3 @@ Remap Tablespace Example 2. 子分区类型是否支持 3. interval分区类型. 针对MogDB/openGauss 4. 分区键包含虚拟列. 针对MogDB/openGauss - -### ignoreDB2PartInclusive - -**类型**: bool - -**描述**: 是否忽略DB2分区键值ENDING的包含属性 - -如下面DB2建表语句分区语法中`ENDING`包含属性`INCLUSIVE`定义则此分区包含`20180101`数据 - -但是在openGauss数据库中范围分区不支持包含属性只能`less than` - -这种情况下会遇到报错 `the part DATAMIN is included high value for db2 inclusive option` 可以配置此参数忽略上面错误 - -```sql -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 -) -``` - -**默认值**: `false` - -### igNotSupportIntervalPart - -**类型**: bool - -**描述**: 支持忽略部分不支持的`interval分`区属性 - -**默认值**: `false` - -### ignoreTabPartition - -**类型**: bool - -**描述**: 支持迁移到目标端数据库忽略分区语法. - -如Oracle分区表迁移到MySQL变成非分区表 - -Oracle - -```sql -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 - -```sql -CREATE TABLE mtk.tab_part_list ( - deptno BIGINT NOT NULL, - deptname VARCHAR(20), - quarterly_sales DECIMAL(10,2), - state VARCHAR(2) -) -``` - -**默认值**: `false` - -### ignoreTabPartitionTabList - -**类型**: []string - -**描述**: `ignoreTabPartition`白名单 - -参数区分大小写 - -- "Schema1.TABLE_1" 迁移对象中Schema1下的TABLE_1的表 -- "Schema1.TABLE*" 迁移对象中Schema1下的TABLE*的表 - -**默认值**: 空 - -**示例**: - -ignore Table Partition Table List Example - -```json -{ - "ignoreTabPartitionTabList": [ - "SCHEMA1.TABLE_1", - "SCHEMA1.TABLE_DUTY_LOG*", - "SCHEMA1.^TABLE_DUTY_LOG.*$" - ] -} -``` - -**新增于**: v2.8.0 - -### autoAddMaxvaluePart - -**类型**: bool - -**描述**: 参数`autoAddMaxvaluePart`允许不存在`maxvalue`分区的分区表自动添加`maxvalue`分区. - -如 DB2分区表迁移到openGauss - -DB2允许定义`minvalue`分区,openGauss不支持. - -DB2在定义`minvalue`分区未定义`maxvalue`分区时null值可以插入到`minvalue`分区,openGauss会报错. - -但是openGauss分区允许null插入到`maxvalue`分区. 可通过此参数开启自动添加`maxvalue`分区 - -DB2未定义`maxvalue`分区 - -```sql -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 - -```sql -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) -) -``` - -**新增于**: v0.0.36 - -### igErrorData - -**类型**: bool - -**描述**: 忽略插入失败的数据并记录到错误文件. - -只支持 openGauss/MogDB/PostgreSQL/MySQL - -- openGauss/MogDB/PostgreSQL - - | batchCommit | igErrorData | copy Savepoint | 描述 | - |:------------|:------------|:---------------|:-----------| - | false | false | false | 全部rollback | - | false | false | true | 全部rollback | - | false | true | true | 失败数据未迁移 | - | true | false | false | 保留成功Commit数据 | - | true | false | true | 保留成功Commit数据 | - | true | true | true | 失败数据未迁移 | - -- MySQL - - | batchCommit | igErrorData | 描述 | - |:------------|:------------|:-----------| - | false | false | 全部rollback | - | false | true | 失败数据未迁移 | - | true | false | 保留成功Commit数据 | - | true | true | 失败数据未迁移 | - -**默认值**: `false` - -**新增于**: v2.2.3 - -### enableBatchCommit - -**类型**: bool - -**描述**: 启用分批次Commit - -**默认值**: `false` - -**可选值**: - -- true -- false - -### replaceBCDate - -**类型**: string - -**描述**: openGauss/MogDB/PostgreSQL 时间格式不支持公元前4713年之前的数据. 配置此参数会对数据进行对应替换. - -如 `9192-01-07 01:02:03 BC` 替换成 `1970-01-01 00:00:00`. - -**示例**: - -Replace BC Date Example - -```json -{ - "replaceBCDate": "1970-01-01 00:00:00" -} -``` - -**新增于**: v2.8.0 - -### mySQLSkipErrorDateTimeData - -**类型**: bool - -**描述**: 自动跳过mysql错误时间。 - -如 `datetime` 类型里 `0000-00-00 13:14:15` - -**默认值**: `false` - -**Deprecated**: 从2.3.4以后版本已不再支持. - -**可选值**: - -- true -- false - -### columnNameData - -**类型**: map[string]string - -**描述**: 自定义处理数据转换方法. 源配置此参数时生成SELECT语句使用,目标配置此参数时在生成INSERT/COPY使用. - -如源配置 `"S1.T1.COL1": S_DECODER({{.ColName}})` 则生成查询语句为`SELECT S_DECODER(COL1) AS COL1 FROM S1.T1` - -如目标配置 `"S1.T1.COL1": S_ENCODER({{.ColName}})` 则生成查询语句为`INSERT INTO S1.T1 (COL1) VALUES(S_DECODER(:1))` 或 `COPY S1.T1(col1) from stdin TRANSFORM(col1 AS S_ENCODER(COL1))` - -{{.ColName}}会自动替换成列.也可以直接写列名 - -**示例**: - -Source ColumnName Data Process Example - -```json -{ - "columnNameData": { - "ora_mtk.tab_dbms_des.col2": "ora_mtk.s_decoder({{.ColName}})" - } -} -``` - -Target ColumnName Data Process Example - -```json -{ - "columnNameData": { - "ora_mtk.tab_dbms_des.col2": "ora_mtk.s_encoder({{.ColName}})" - } -} -``` - -### autoAddMySQLAutoIncr - -**类型**: bool - -**描述**: 迁移到MySQL自动添加MySQL `AUTO_INCREMENT` 列 - -v2.8.0之前参数为`true`,当原表不存在自增列,自动增加`AUTO_INCREMENT`列,并把新增列设置为主键,原来主键改为唯一键. - -v2.8.0之后参数为`true`,当原表不存在自增列,自动增加`AUTO_INCREMENT`列,并把新增列设置为UNIQUE键,原来主键保持不变. - -```sql -PK_ID BIGINT UNSIGNED UNIQUE KEY AUTO_INCREMENT NOT NULL [INVISIBLE] -``` - -- MySQl 8.0.23 之前为 `visible` -- MySQl 8.0.23 为 `invisible column` -- 原表存在`PK_ID`列,不在处理 - -> 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. - -在某下场景下需要配合[ignoreTabPartition](#ignoretabpartition)参数使用. 如分区表分区键不包含主键 - -- DB2迁移到MySQL - - - DB2 - - ```sql - 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 - - ```sql - CREATE TABLE db2_mtk.tab_pk_test ( - -- 自动增加自增列并设置唯一健约束 - pk_id BIGINT UNSIGNED UNIQUE KEY AUTO_INCREMENT NOT NULL INVISIBLE, - col1 VARCHAR(10) NOT NULL, - id BIGINT NOT NULL, - col2 VARCHAR(10), - col3 VARCHAR(10), - PRIMARY KEY ( col1 ) - ) - ``` - -**默认值**: `false` - -**新增于**: v2.1.1 - -### autoAddMySQLAutoIncrTabList - -**类型**: []string - -**描述**: 配合`autoAddMySQLAutoIncr`参数使用. - -配置哪些表自动增加`auto_incr`列. 默认为空代表为全部表. - -参数不区分大小写 - -- "TABLE_1" 迁移对象中所有表名为TABLE_1的表 -- "Schema1.TABLE_1" 迁移对象中Schema1下的TABLE_1的表 - -**默认值**: 空 - -**示例**: - -autoAddMySQLAutoIncrTabList Example - -```json -{ - "autoAddMySQLAutoIncrTabList": [ - "TABLE_1", - "SCHEMA1.TABLE_1" - ] -} -``` - -**新增于**: v2.2.1 - -### ignoreNotSupportDefault - -**类型**: bool - -**描述**: 支持忽略部分不支持列默认值.如Oracle的`sys_guid`。MTK会内嵌白名单进行忽略 - -**默认值**: `false` - -### replaceZeroDate - -**类型**: string - -**描述**: openGauss/MogDB/PostgreSQL 时间格式不支持 `0000-00-00`. 配置此参数会进行对应替换. 替换的范围如下: - -- 列默认值 -- 存储过程/函数中的SQL语句 - -> 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 - -**类型**: bool - -**描述**: 是否把源库虚拟列转成目标库的正常列。 - -**默认值**: `false` - -**可选值**: - -- true -- false - -### virtualColConv - -**类型**: map[string]string - -**描述**: 虚拟列表达转换功能 - -**示例**: - -virtualColConv example - -```json -{ - "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'" - } -} -``` - -### mySQLToOgCharExpression - -**类型**: string - -**描述**: mysql 迁移到 openGauss 针对 char/varchar列进行计算列长表达式. 默认不计算 如 `* 3` 表示原来到长度`*3` - -**Deprecated**: mtk scales up the length based on the db type,column type, db compatibility mode - -### convertOracleIntegerToNumeric - -**类型**: bool - -**描述**: 转换Oracle的Integer类型为NUMERIC. 支持openGauss/MogDB/PostgreSQL - -**默认值**: `false` - -**可选值**: - -- true -- false - -### enableOgBlobClob - -**类型**: bool - -**描述**: 迁移其他数据库的Blob、Clob为openGauss的Blob、Clob. - -**默认值**: `false` - -**可选值**: - -- true -- false - -### skipColumnType - -**类型**: map[string]int - -**描述**: 迁移时跳过某个数据类型列 - -格式为: "列类型": option - -- 1 不创建列并不迁移数据 -- 2 创建列但不迁移数据 - -**可选值**: - -- 0 -- 1 -- 2 - -**示例**: - -Skip ColumnType Example - -```json -{ - "skipColumnType": { - "COL_TYPE_1": 1, - "COL_TYPE_2": 2 - } -} -``` - -### skipColumnName - -**类型**: map[string]int - -**描述**: 迁移时跳过某个列 - -优先级高于 `skipColumnType` - -格式为 "schema.table_name.column": option - -- 1 不创建列并不迁移数据 -- 2 创建列但不迁移数据 - -**可选值**: - -- 0 -- 1 -- 2 - -**示例**: - -Skip ColumnName Example - -```json -{ - "skipColumnName": { - "SCHEMA1.TAB_01.COL1": 1, - "SCHEMA1.TAB_01.COL2": 2 - } -} -``` - -### charLengthChangeExclude - -**类型**: []string - -**描述**: 跨字符集迁移时,针对CHAR类型指定表达式,对列名进行匹配并不进行长度扩充. -注意忽略大小写问题. - -- `^update_time*` 忽略列名开头为 `update_time` 的列 -- `^update_time` 忽略列名为 `update_time` 的列 -- `(?i)^update_time$` 忽略列名大小写的情况下 `update_time` 的列 - -**示例**: - -Char Length Change Exclude Example - -```json -{ - "charLengthChangeExclude": [ - "^update_time*", - "^visit_date$", - "(?i)^visit_date$" - ] -} -``` - -**新增于**: v2.5.2 - -### enableCharTrimRightSpace - -**类型**: bool - -**描述**: 针对char迁移为varchar允许截取`char`类型右侧空格. 只支持目标端为openGauss/MogDB - -**默认值**: `false` - -**可选值**: - -- true -- false - -**新增于**: v2.7.1 - -### convertPackageMethod - -**类型**: string - -**描述**: 迁移 Oracle Package 到 openGauss/MogDB 的方式 - -openGauss数据库版本大于等于3.0.0且datCompatibility为A默认为 `package` - -openGauss数据库版本大于等于2.1.0可配置为 `package` 或 `schema` - -openGauss数据库小于2.1.0 只能配置为 `schema` - -**默认值**: `schema` - -**可选值**: - -- schema -- package - -### customFuncTrans - -**类型**: []TranFunc - -**描述**: 自定义转换PLSQL正则表达式. 如迁移Oracle不带括号调用函数内部通过增加此参数来完成改写 - -**示例**: - -Rewrite Oracle Call No args function - -```json -{ - "customFuncTrans": [ - { - "regStr": "(?i)\\b(ORA_MTK\\s*\\.PROC_TEST_002)(\\s*[^\\(]\\b)", - "replace": "${1}()${2}" - }, - { - "regStr": "(?i)\\b(ORA_MTK\\s*\\.F_NO_ARGS)(\\s*[^\\(]\\b)", - "replace": "${1}()${2}" - } - ] -} -``` - -**新增于**: v2.8.1 - -### enableConvertSrid - -**类型**: bool - -**描述**: Enable Convert Srid - -**默认值**: `false` - -**可选值**: - -- true -- false - -### defaultSrid - -**类型**: string - -**描述**: PostGis Default Srid - -**默认值**: `4326` - -### seqLastNumAddNum - -**类型**: int - -**描述**: 同步序录最后值时增加多少. - -仅支持openGauss/MogDB 目标端 - -**默认值**: `0` - -### templateSeqName - -**类型**: string - -**描述**: MySQL 自增列转为序列,序列名的模版 - -{{.TabName}}_{{.ColName}}_SEQ - -仅支持以下两个变量 - -- {{.TabName}} 表名 -- {{.ColName}} 列名 - -**默认值**: SEQ_{{.TabName}}_{{.ColName}} - -**示例**: - -Template SeqName Example - -```json -{ - "templateSeqName": "{{.TabName}}_{{.ColName}}_SEQ" -} -``` - -**新增于**: v2.1.6 - -### charAppendEmptyString - -**类型**: bool - -**描述**: 针对ORA-29275: partial multibyte character 错误. 在oracle查询是拼接字符串 - -主要针对以下列类型 - -- Char -- Character -- NChar -- Varchar -- NVarchar -- Varchar2 -- NVarchar2 - -```sql -select chr(195) from dual; -- 报错 -select chr(195)||'' from dual; -- 不报错 - --- 中文GBK编码 证券投 -select utl_raw.cast_to_varchar2(hextoraw('D6A4C8AFCDB6D6')) from dual; -- 报错 -select utl_raw.cast_to_varchar2(hextoraw('D6A4C8AFCDB6D6'))||'' from dual; -- 不报错 -``` - -**默认值**: `false` - -**可选值**: - -- true -- false - -### charsetTranscode - -**类型**: bool - -**描述**: 针对错误的编码进行转码. - -- 表里异常数据. UTF8数据库存在GBK编码 -- 存储过程中文乱码 -- 暂时未支持 - -**默认值**: false - -**新增于**: v2.5.0 diff --git a/product/zh/docs-mtk/v2.0/config/mtk-parameter/mtk-parameter-2.md b/product/zh/docs-mtk/v2.0/config/mtk-parameter/mtk-parameter-2.md new file mode 100644 index 0000000000000000000000000000000000000000..4893fb027899c4435abbe797f7e48f0b41148ab0 --- /dev/null +++ b/product/zh/docs-mtk/v2.0/config/mtk-parameter/mtk-parameter-2.md @@ -0,0 +1,709 @@ +--- +title: MTK Parameter +summary: MTK Parameter +author: mtk +date: 2023-02-17 14:26:11 +--- + +# MTK 参数(二) + +## ignoreDB2PartInclusive + +**类型**: bool + +**描述**: 是否忽略DB2分区键值ENDING的包含属性 + +如下面DB2建表语句分区语法中`ENDING`包含属性`INCLUSIVE`定义则此分区包含`20180101`数据 + +但是在openGauss数据库中范围分区不支持包含属性只能`less than` + +这种情况下会遇到报错 `the part DATAMIN is included high value for db2 inclusive option` 可以配置此参数忽略上面错误 + +```sql +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 +) +``` + +**默认值**: `false` + +## igNotSupportIntervalPart + +**类型**: bool + +**描述**: 支持忽略部分不支持的`interval分`区属性 + +**默认值**: `false` + +## ignoreTabPartition + +**类型**: bool + +**描述**: 支持迁移到目标端数据库忽略分区语法. + +如Oracle分区表迁移到MySQL变成非分区表 + +Oracle + +```sql +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 + +```sql +CREATE TABLE mtk.tab_part_list ( + deptno BIGINT NOT NULL, + deptname VARCHAR(20), + quarterly_sales DECIMAL(10,2), + state VARCHAR(2) +) +``` + +**默认值**: `false` + +## ignoreTabPartitionTabList + +**类型**: []string + +**描述**: `ignoreTabPartition`白名单 + +参数区分大小写 + +- "Schema1.TABLE_1" 迁移对象中Schema1下的TABLE_1的表 +- "Schema1.TABLE*" 迁移对象中Schema1下的TABLE*的表 + +**默认值**: 空 + +**示例**: + +ignore Table Partition Table List Example + +```json +{ + "ignoreTabPartitionTabList": [ + "SCHEMA1.TABLE_1", + "SCHEMA1.TABLE_DUTY_LOG*", + "SCHEMA1.^TABLE_DUTY_LOG.*$" + ] +} +``` + +**新增于**: v2.8.0 + +## autoAddMaxvaluePart + +**类型**: bool + +**描述**: 参数`autoAddMaxvaluePart`允许不存在`maxvalue`分区的分区表自动添加`maxvalue`分区. + +如 DB2分区表迁移到openGauss + +DB2允许定义`minvalue`分区,openGauss不支持. + +DB2在定义`minvalue`分区未定义`maxvalue`分区时null值可以插入到`minvalue`分区,openGauss会报错. + +但是openGauss分区允许null插入到`maxvalue`分区. 可通过此参数开启自动添加`maxvalue`分区 + +DB2未定义`maxvalue`分区 + +```sql +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 + +```sql +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) +) +``` + +**新增于**: v0.0.36 + +## igErrorData + +**类型**: bool + +**描述**: 忽略插入失败的数据并记录到错误文件. + +只支持 openGauss/MogDB/PostgreSQL/MySQL + +- openGauss/MogDB/PostgreSQL + + | batchCommit | igErrorData | copy Savepoint | 描述 | + | :---------- | :---------- | :------------- | :----------------- | + | false | false | false | 全部rollback | + | false | false | true | 全部rollback | + | false | true | true | 失败数据未迁移 | + | true | false | false | 保留成功Commit数据 | + | true | false | true | 保留成功Commit数据 | + | true | true | true | 失败数据未迁移 | + +- MySQL + + | batchCommit | igErrorData | 描述 | + | :---------- | :---------- | :----------------- | + | false | false | 全部rollback | + | false | true | 失败数据未迁移 | + | true | false | 保留成功Commit数据 | + | true | true | 失败数据未迁移 | + +**默认值**: `false` + +**新增于**: v2.2.3 + +## enableBatchCommit + +**类型**: bool + +**描述**: 启用分批次Commit + +**默认值**: `false` + +**可选值**: + +- true +- false + +## replaceBCDate + +**类型**: string + +**描述**: openGauss/MogDB/PostgreSQL 时间格式不支持公元前4713年之前的数据. 配置此参数会对数据进行对应替换. + +如 `9192-01-07 01:02:03 BC` 替换成 `1970-01-01 00:00:00`. + +**示例**: + +Replace BC Date Example + +```json +{ + "replaceBCDate": "1970-01-01 00:00:00" +} +``` + +**新增于**: v2.8.0 + +## mySQLSkipErrorDateTimeData + +**类型**: bool + +**描述**: 自动跳过mysql错误时间。 + +如 `datetime` 类型里 `0000-00-00 13:14:15` + +**默认值**: `false` + +**Deprecated**: 从2.3.4以后版本已不再支持. + +**可选值**: + +- true +- false + +## columnNameData + +**类型**: map[string]string + +**描述**: 自定义处理数据转换方法. 源配置此参数时生成SELECT语句使用,目标配置此参数时在生成INSERT/COPY使用. + +如源配置 `"S1.T1.COL1": S_DECODER({{.ColName}})` 则生成查询语句为`SELECT S_DECODER(COL1) AS COL1 FROM S1.T1` + +如目标配置 `"S1.T1.COL1": S_ENCODER({{.ColName}})` 则生成查询语句为`INSERT INTO S1.T1 (COL1) VALUES(S_DECODER(:1))` 或 `COPY S1.T1(col1) from stdin TRANSFORM(col1 AS S_ENCODER(COL1))` + +{{.ColName}}会自动替换成列.也可以直接写列名 + +**示例**: + +Source ColumnName Data Process Example + +```json +{ + "columnNameData": { + "ora_mtk.tab_dbms_des.col2": "ora_mtk.s_decoder({{.ColName}})" + } +} +``` + +Target ColumnName Data Process Example + +```json +{ + "columnNameData": { + "ora_mtk.tab_dbms_des.col2": "ora_mtk.s_encoder({{.ColName}})" + } +} +``` + +## autoAddMySQLAutoIncr + +**类型**: bool + +**描述**: 迁移到MySQL自动添加MySQL `AUTO_INCREMENT` 列 + +v2.8.0之前参数为`true`,当原表不存在自增列,自动增加`AUTO_INCREMENT`列,并把新增列设置为主键,原来主键改为唯一键. + +v2.8.0之后参数为`true`,当原表不存在自增列,自动增加`AUTO_INCREMENT`列,并把新增列设置为UNIQUE键,原来主键保持不变. + +```sql +PK_ID BIGINT UNSIGNED UNIQUE KEY AUTO_INCREMENT NOT NULL [INVISIBLE] +``` + +- MySQl 8.0.23 之前为 `visible` +- MySQl 8.0.23 为 `invisible column` +- 原表存在`PK_ID`列,不在处理 + +> 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. + +在某下场景下需要配合[ignoreTabPartition](#ignoretabpartition)参数使用. 如分区表分区键不包含主键 + +- DB2迁移到MySQL + + - DB2 + + ```sql + 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 + + ```sql + CREATE TABLE db2_mtk.tab_pk_test ( + -- 自动增加自增列并设置唯一健约束 + pk_id BIGINT UNSIGNED UNIQUE KEY AUTO_INCREMENT NOT NULL INVISIBLE, + col1 VARCHAR(10) NOT NULL, + id BIGINT NOT NULL, + col2 VARCHAR(10), + col3 VARCHAR(10), + PRIMARY KEY ( col1 ) + ) + ``` + +**默认值**: `false` + +**新增于**: v2.1.1 + +## autoAddMySQLAutoIncrTabList + +**类型**: []string + +**描述**: 配合`autoAddMySQLAutoIncr`参数使用. + +配置哪些表自动增加`auto_incr`列. 默认为空代表为全部表. + +参数不区分大小写 + +- "TABLE_1" 迁移对象中所有表名为TABLE_1的表 +- "Schema1.TABLE_1" 迁移对象中Schema1下的TABLE_1的表 + +**默认值**: 空 + +**示例**: + +autoAddMySQLAutoIncrTabList Example + +```json +{ + "autoAddMySQLAutoIncrTabList": [ + "TABLE_1", + "SCHEMA1.TABLE_1" + ] +} +``` + +**新增于**: v2.2.1 + +## ignoreNotSupportDefault + +**类型**: bool + +**描述**: 支持忽略部分不支持列默认值.如Oracle的`sys_guid`。MTK会内嵌白名单进行忽略 + +**默认值**: `false` + +## replaceZeroDate + +**类型**: string + +**描述**: openGauss/MogDB/PostgreSQL 时间格式不支持 `0000-00-00`. 配置此参数会进行对应替换. 替换的范围如下: + +- 列默认值 +- 存储过程/函数中的SQL语句 + +> 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 + +**类型**: bool + +**描述**: 是否把源库虚拟列转成目标库的正常列。 + +**默认值**: `false` + +**可选值**: + +- true +- false + +## virtualColConv + +**类型**: map[string]string + +**描述**: 虚拟列表达转换功能 + +**示例**: + +virtualColConv example + +```json +{ + "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'" + } +} +``` + +## mySQLToOgCharExpression + +**类型**: string + +**描述**: mysql 迁移到 openGauss 针对 char/varchar列进行计算列长表达式. 默认不计算 如 `* 3` 表示原来到长度`*3` + +**Deprecated**: mtk scales up the length based on the db type,column type, db compatibility mode + +## convertOracleIntegerToNumeric + +**类型**: bool + +**描述**: 转换Oracle的Integer类型为NUMERIC. 支持openGauss/MogDB/PostgreSQL + +**默认值**: `false` + +**可选值**: + +- true +- false + +## enableOgBlobClob + +**类型**: bool + +**描述**: 迁移其他数据库的Blob、Clob为openGauss的Blob、Clob. + +**默认值**: `false` + +**可选值**: + +- true +- false + +## skipColumnType + +**类型**: map[string]int + +**描述**: 迁移时跳过某个数据类型列 + +格式为: "列类型": option + +- 1 不创建列并不迁移数据 +- 2 创建列但不迁移数据 + +**可选值**: + +- 0 +- 1 +- 2 + +**示例**: + +Skip ColumnType Example + +```json +{ + "skipColumnType": { + "COL_TYPE_1": 1, + "COL_TYPE_2": 2 + } +} +``` + +## skipColumnName + +**类型**: map[string]int + +**描述**: 迁移时跳过某个列 + +优先级高于 `skipColumnType` + +格式为 "schema.table_name.column": option + +- 1 不创建列并不迁移数据 +- 2 创建列但不迁移数据 + +**可选值**: + +- 0 +- 1 +- 2 + +**示例**: + +Skip ColumnName Example + +```json +{ + "skipColumnName": { + "SCHEMA1.TAB_01.COL1": 1, + "SCHEMA1.TAB_01.COL2": 2 + } +} +``` + +## charLengthChangeExclude + +**类型**: []string + +**描述**: 跨字符集迁移时,针对CHAR类型指定表达式,对列名进行匹配并不进行长度扩充. +注意忽略大小写问题. + +- `^update_time*` 忽略列名开头为 `update_time` 的列 +- `^update_time` 忽略列名为 `update_time` 的列 +- `(?i)^update_time$` 忽略列名大小写的情况下 `update_time` 的列 + +**示例**: + +Char Length Change Exclude Example + +```json +{ + "charLengthChangeExclude": [ + "^update_time*", + "^visit_date$", + "(?i)^visit_date$" + ] +} +``` + +**新增于**: v2.5.2 + +## enableCharTrimRightSpace + +**类型**: bool + +**描述**: 针对char迁移为varchar允许截取`char`类型右侧空格. 只支持目标端为openGauss/MogDB + +**默认值**: `false` + +**可选值**: + +- true +- false + +**新增于**: v2.7.1 + +## convertPackageMethod + +**类型**: string + +**描述**: 迁移 Oracle Package 到 openGauss/MogDB 的方式 + +openGauss数据库版本大于等于3.0.0且datCompatibility为A默认为 `package` + +openGauss数据库版本大于等于2.1.0可配置为 `package` 或 `schema` + +openGauss数据库小于2.1.0 只能配置为 `schema` + +**默认值**: `schema` + +**可选值**: + +- schema +- package + +## customFuncTrans + +**类型**: []TranFunc + +**描述**: 自定义转换PLSQL正则表达式. 如迁移Oracle不带括号调用函数内部通过增加此参数来完成改写 + +**示例**: + +Rewrite Oracle Call No args function + +```json +{ + "customFuncTrans": [ + { + "regStr": "(?i)\\b(ORA_MTK\\s*\\.PROC_TEST_002)(\\s*[^\\(]\\b)", + "replace": "${1}()${2}" + }, + { + "regStr": "(?i)\\b(ORA_MTK\\s*\\.F_NO_ARGS)(\\s*[^\\(]\\b)", + "replace": "${1}()${2}" + } + ] +} +``` + +**新增于**: v2.8.1 + +## enableConvertSrid + +**类型**: bool + +**描述**: Enable Convert Srid + +**默认值**: `false` + +**可选值**: + +- true +- false + +## defaultSrid + +**类型**: string + +**描述**: PostGis Default Srid + +**默认值**: `4326` + +## seqLastNumAddNum + +**类型**: int + +**描述**: 同步序录最后值时增加多少. + +仅支持openGauss/MogDB 目标端 + +**默认值**: `0` + +## templateSeqName + +**类型**: string + +**描述**: MySQL 自增列转为序列,序列名的模版 + +{{.TabName}}_{{.ColName}}_SEQ + +仅支持以下两个变量 + +- {{.TabName}} 表名 +- {{.ColName}} 列名 + +**默认值**: SEQ_{{.TabName}}_{{.ColName}} + +**示例**: + +Template SeqName Example + +```json +{ + "templateSeqName": "{{.TabName}}_{{.ColName}}_SEQ" +} +``` + +**新增于**: v2.1.6 + +## charAppendEmptyString + +**类型**: bool + +**描述**: 针对ORA-29275: partial multibyte character 错误. 在oracle查询是拼接字符串 + +主要针对以下列类型 + +- Char +- Character +- NChar +- Varchar +- NVarchar +- Varchar2 +- NVarchar2 + +```sql +select chr(195) from dual; -- 报错 +select chr(195)||'' from dual; -- 不报错 + +-- 中文GBK编码 证券投 +select utl_raw.cast_to_varchar2(hextoraw('D6A4C8AFCDB6D6')) from dual; -- 报错 +select utl_raw.cast_to_varchar2(hextoraw('D6A4C8AFCDB6D6'))||'' from dual; -- 不报错 +``` + +**默认值**: `false` + +**可选值**: + +- true +- false + +## charsetTranscode + +**类型**: bool + +**描述**: 针对错误的编码进行转码. + +- 表里异常数据. UTF8数据库存在GBK编码 +- 存储过程中文乱码 -- 暂时未支持 + +**默认值**: false + +**新增于**: v2.5.0 \ No newline at end of file diff --git a/product/zh/docs-mtk/v2.0/config/mtk-parameter/overview-of-mtk-parameter.md b/product/zh/docs-mtk/v2.0/config/mtk-parameter/overview-of-mtk-parameter.md new file mode 100644 index 0000000000000000000000000000000000000000..86496406fca843cbd5eb3964241f6180162b71f5 --- /dev/null +++ b/product/zh/docs-mtk/v2.0/config/mtk-parameter/overview-of-mtk-parameter.md @@ -0,0 +1,12 @@ +--- +title: MTK Parameter +summary: MTK Parameter +author: mtk +date: 2023-02-17 14:26:11 +--- + +# MTK 参数 + +[MTK Parameter(一)](mtk-parameter-1.md) + +[MTK Parameter(二)](mtk-parameter-2.md) \ No newline at end of file diff --git a/product/zh/docs-mtk/v2.0/toc.md b/product/zh/docs-mtk/v2.0/toc.md index 2d3c33ed428bb359d4b669473eab7c0885963193..7a571502a1b5abd1c0dfefa5d346a8545dec0d1b 100644 --- a/product/zh/docs-mtk/v2.0/toc.md +++ b/product/zh/docs-mtk/v2.0/toc.md @@ -11,7 +11,9 @@ + [配置概述](./config/mtk-config.md) + [Object](./config/mtk-object.md) + [Limit](./config/mtk-limit.md) - + [Parameter](./config/mtk-parameter.md) + + [参数](./config/mtk-parameter/overview-of-mtk-parameter.md) + + [MTK参数(一)](./config/mtk-parameter/mtk-parameter-1.md) + + [MTK参数(二)](./config/mtk-parameter/mtk-parameter-2.md) + [数据源(DSN)说明](./config/mtk-dsn.md) + 命令介绍 + [mtk](./commands/mtk.md)