Documentation ¶
Overview ¶
Copyright © 2020 Marvin
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright © 2020 Marvin ¶
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright © 2020 Marvin ¶
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright © 2020 Marvin ¶
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright © 2020 Marvin ¶
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright © 2020 Marvin ¶
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright © 2020 Marvin ¶
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Index ¶
Constants ¶
const ( BuildInMySQLDatatypeBigint = "BIGINT" BuildInMySQLDatatypeDecimal = "DECIMAL" BuildInMySQLDatatypeDouble = "DOUBLE" BuildInMySQLDatatypeDoublePrecision = "DOUBLE PRECISION" BuildInMySQLDatatypeFloat = "FLOAT" BuildInMySQLDatatypeInt = "INT" BuildInMySQLDatatypeInteger = "INTEGER" BuildInMySQLDatatypeMediumint = "MEDIUMINT" BuildInMySQLDatatypeNumeric = "NUMERIC" BuildInMySQLDatatypeReal = "REAL" BuildInMySQLDatatypeSmallint = "SMALLINT" BuildInMySQLDatatypeTinyint = "TINYINT" BuildInMySQLDatatypeBit = "BIT" BuildInMySQLDatatypeDate = "DATE" BuildInMySQLDatatypeDatetime = "DATETIME" BuildInMySQLDatatypeTimestamp = "TIMESTAMP" BuildInMySQLDatatypeTime = "TIME" BuildInMySQLDatatypeYear = "YEAR" BuildInMySQLDatatypeBlob = "BLOB" BuildInMySQLDatatypeChar = "CHAR" BuildInMySQLDatatypeLongBlob = "LONGBLOB" BuildInMySQLDatatypeLongText = "LONGTEXT" BuildInMySQLDatatypeMediumBlob = "MEDIUMBLOB" BuildInMySQLDatatypeMediumText = "MEDIUMTEXT" BuildInMySQLDatatypeText = "TEXT" BuildInMySQLDatatypeTinyBlob = "TINYBLOB" BuildInMySQLDatatypeTinyText = "TINYTEXT" BuildInMySQLDatatypeVarchar = "VARCHAR" BuildInMySQLDatatypeBinary = "BINARY" BuildInMySQLDatatypeVarbinary = "VARBINARY" // ORACLE ISN'T SUPPORT BuildInMySQLDatatypeSet = "SET" BuildInMySQLDatatypeEnum = "ENUM" )
MYSQL datatype
const ( BuildInRuleNameColumnDatatype = "COLUMN_DATA_TYPE" BuildInRuleNameColumnDefaultValue = "COLUMN_DEFAULT_VALUE" BuildInRuleNameObjectCompatible = "OBJECT_COMPATIBLE" BuildInRuleInitSuccess = "Y" )
Database init
const ( BuildInOracleColumnDefaultValueSysdate = "SYSDATE" BuildInOracleColumnDefaultValueSYSGUID = "SYS_GUID()" BuildInOracleColumnDefaultValueNULL = "" )
Database Default Value Map
ORACLE TO MYSQL column default value mapping rule
const ( BuildInMySQLColumnDefaultValueCurrentTimestamp = "CURRENT_TIMESTAMP" BuildInMySQLColumnDefaultValueNULL = "NULL" )
MySQL TO ORACLE column default value mapping rule
const ( BuildInOracleDatatypeNumber = "NUMBER" BuildInOracleDatatypeBfile = "BFILE" BuildInOracleDatatypeChar = "CHAR" BuildInOracleDatatypeCharacter = "CHARACTER" BuildInOracleDatatypeClob = "CLOB" BuildInOracleDatatypeBlob = "BLOB" BuildInOracleDatatypeDate = "DATE" BuildInOracleDatatypeDecimal = "DECIMAL" BuildInOracleDatatypeDec = "DEC" BuildInOracleDatatypeDoublePrecision = "DOUBLE PRECISION" BuildInOracleDatatypeFloat = "FLOAT" BuildInOracleDatatypeInteger = "INTEGER" BuildInOracleDatatypeInt = "INT" BuildInOracleDatatypeLong = "LONG" BuildInOracleDatatypeLongRAW = "LONG RAW" BuildInOracleDatatypeBinaryFloat = "BINARY_FLOAT" BuildInOracleDatatypeBinaryDouble = "BINARY_DOUBLE" BuildInOracleDatatypeNchar = "NCHAR" BuildInOracleDatatypeNcharVarying = "NCHAR VARYING" BuildInOracleDatatypeNclob = "NCLOB" BuildInOracleDatatypeNumeric = "NUMERIC" BuildInOracleDatatypeNvarchar2 = "NVARCHAR2" BuildInOracleDatatypeRaw = "RAW" BuildInOracleDatatypeReal = "REAL" BuildInOracleDatatypeRowid = "ROWID" BuildInOracleDatatypeSmallint = "SMALLINT" BuildInOracleDatatypeUrowid = "UROWID" BuildInOracleDatatypeVarchar2 = "VARCHAR2" BuildInOracleDatatypeVarchar = "VARCHAR" BuildInOracleDatatypeXmltype = "XMLTYPE" BuildInOracleDatatypeIntervalYearMonth0 = "INTERVAL YEAR(0) TO MONTH" BuildInOracleDatatypeIntervalYearMonth1 = "INTERVAL YEAR(1) TO MONTH" BuildInOracleDatatypeIntervalYearMonth2 = "INTERVAL YEAR(2) TO MONTH" BuildInOracleDatatypeIntervalYearMonth3 = "INTERVAL YEAR(3) TO MONTH" BuildInOracleDatatypeIntervalYearMonth4 = "INTERVAL YEAR(4) TO MONTH" BuildInOracleDatatypeIntervalYearMonth5 = "INTERVAL YEAR(5) TO MONTH" BuildInOracleDatatypeIntervalYearMonth6 = "INTERVAL YEAR(6) TO MONTH" BuildInOracleDatatypeIntervalYearMonth7 = "INTERVAL YEAR(7) TO MONTH" BuildInOracleDatatypeIntervalYearMonth8 = "INTERVAL YEAR(8) TO MONTH" BuildInOracleDatatypeIntervalYearMonth9 = "INTERVAL YEAR(9) TO MONTH" BuildInOracleDatatypeTimestamp = "TIMESTAMP" BuildInOracleDatatypeTimestamp0 = "TIMESTAMP(0)" BuildInOracleDatatypeTimestamp1 = "TIMESTAMP(1)" BuildInOracleDatatypeTimestamp2 = "TIMESTAMP(2)" BuildInOracleDatatypeTimestamp3 = "TIMESTAMP(3)" BuildInOracleDatatypeTimestamp4 = "TIMESTAMP(4)" BuildInOracleDatatypeTimestamp5 = "TIMESTAMP(5)" // datatype timestamp with pricision,view query show default timestamp(6) BuildInOracleDatatypeTimestamp6 = "TIMESTAMP(6)" BuildInOracleDatatypeTimestamp7 = "TIMESTAMP(7)" BuildInOracleDatatypeTimestamp8 = "TIMESTAMP(8)" BuildInOracleDatatypeTimestamp9 = "TIMESTAMP(9)" BuildInOracleDatatypeTimestampWithTimeZone0 = "TIMESTAMP(0) WITH TIME ZONE" BuildInOracleDatatypeTimestampWithTimeZone1 = "TIMESTAMP(1) WITH TIME ZONE" BuildInOracleDatatypeTimestampWithTimeZone2 = "TIMESTAMP(2) WITH TIME ZONE" BuildInOracleDatatypeTimestampWithTimeZone3 = "TIMESTAMP(3) WITH TIME ZONE" BuildInOracleDatatypeTimestampWithTimeZone4 = "TIMESTAMP(4) WITH TIME ZONE" BuildInOracleDatatypeTimestampWithTimeZone5 = "TIMESTAMP(5) WITH TIME ZONE" BuildInOracleDatatypeTimestampWithTimeZone6 = "TIMESTAMP(6) WITH TIME ZONE" BuildInOracleDatatypeTimestampWithTimeZone7 = "TIMESTAMP(7) WITH TIME ZONE" BuildInOracleDatatypeTimestampWithTimeZone8 = "TIMESTAMP(8) WITH TIME ZONE" BuildInOracleDatatypeTimestampWithTimeZone9 = "TIMESTAMP(9) WITH TIME ZONE" BuildInOracleDatatypeTimestampWithLocalTimeZone0 = "TIMESTAMP(0) WITH LOCAL TIME ZONE" BuildInOracleDatatypeTimestampWithLocalTimeZone1 = "TIMESTAMP(1) WITH LOCAL TIME ZONE" BuildInOracleDatatypeTimestampWithLocalTimeZone2 = "TIMESTAMP(2) WITH LOCAL TIME ZONE" BuildInOracleDatatypeTimestampWithLocalTimeZone3 = "TIMESTAMP(3) WITH LOCAL TIME ZONE" BuildInOracleDatatypeTimestampWithLocalTimeZone4 = "TIMESTAMP(4) WITH LOCAL TIME ZONE" BuildInOracleDatatypeTimestampWithLocalTimeZone5 = "TIMESTAMP(5) WITH LOCAL TIME ZONE" BuildInOracleDatatypeTimestampWithLocalTimeZone6 = "TIMESTAMP(6) WITH LOCAL TIME ZONE" BuildInOracleDatatypeTimestampWithLocalTimeZone7 = "TIMESTAMP(7) WITH LOCAL TIME ZONE" BuildInOracleDatatypeTimestampWithLocalTimeZone8 = "TIMESTAMP(8) WITH LOCAL TIME ZONE" BuildInOracleDatatypeTimestampWithLocalTimeZone9 = "TIMESTAMP(9) WITH LOCAL TIME ZONE" // INTERVAL DAY(p) TO SECOND(s) are too many combinations, matching within the code // p and s value max 9 -> INTERVAL DAY(9) TO SECOND(9) BuildInOracleDatatypeIntervalDay = "INTERVAL DAY" )
Database Datatype
Oracle column datatype
const ( BuildInOracleCharsetAL32UTF8 = "AL32UTF8" BuildInOracleCharsetZHS16GBK = "ZHS16GBK" )
Database Object Name
ORACLE charset
const ( BuildInOracleTableTypeHeap = "HEAP" BuildInOracleTableTypeClustered = "CLUSTERED" BuildInOracleTableTypeTemporary = "TEMPORARY" BuildInOracleTableTypePartition = "PARTITIONED" BuildInOracleConstraintTypePrimary = "P" BuildInOracleConstraintTypeCheck = "C" BuildInOracleConstraintTypeUnique = "U" BuildInOracleConstraintTypeForeign = "F" BuildInOracleIndexTypeNormal = "NORMAL" BuildInOracleIndexTypeFunctionBasedNormal = "FUNCTION-BASED NORMAL" BuildInOracleIndexTypeBitmap = "BITMAP" BuildInOracleIndexTypeFunctionBasedBitmap = "FUNCTION-BASED BITMAP" BuildInOracleIndexTypeDomain = "DOMAIN" BuildInOracleViewTypeView = "VIEW" BuildInOracleCodeTypeMaterializedView = "MATERIALIZED VIEW" BuildInOracleCodeTypeCluster = "CLUSTER" BuildInOracleCodeTypeConsumerGroup = "CONSUMER GROUP" BuildInOracleCodeTypeContext = "CONTEXT" BuildInOracleCodeTypeDestination = "DESTINATION" BuildInOracleCodeTypeDirectory = "DIRECTORY" BuildInOracleCodeTypeEdition = "EDITION" BuildInOracleCodeTypeEvaluationContext = "EVALUATION CONTEXT" BuildInOracleCodeTypeFunction = "FUNCTION" BuildInOracleCodeTypeIndexPartition = "INDEX PARTITION" BuildInOracleCodeTypeIndexType = "INDEXTYPE" BuildInOracleCodeTypeJavaClass = "JAVA CLASS" BuildInOracleCodeTypeJavaData = "JAVA DATA" BuildInOracleCodeTypeJavaResource = "JAVA RESOURCE" BuildInOracleCodeTypeJavaSource = "JAVA SOURCE" BuildInOracleCodeTypeJob = "JOB" BuildInOracleCodeTypeJobClass = "JOB CLASS" BuildInOracleCodeTypeLibrary = "LIBRARY" BuildInOracleCodeTypeLob = "LOB" BuildInOracleCodeTypeLobPartition = "LOB PARTITION" BuildInOracleCodeTypeLockdownProfile = "LOCKDOWN PROFILE" BuildInOracleCodeTypeOperator = "OPERATOR" BuildInOracleCodeTypePackage = "PACKAGE" BuildInOracleCodeTypePackageBody = "PACKAGE BODY" BuildInOracleCodeTypeProcedure = "PROCEDURE" BuildInOracleCodeTypeProgram = "PROGRAM" BuildInOracleCodeTypeQueue = "QUEUE" BuildInOracleCodeTypeResourcePlan = "RESOURCE PLAN" BuildInOracleCodeTypeRule = "RULE" BuildInOracleCodeTypeRuleSet = "RULE SET" BuildInOracleCodeTypeSchedule = "SCHEDULE" BuildInOracleCodeTypeSchedulerGroup = "SCHEDULER GROUP" BuildInOracleCodeTypeSequence = "SEQUENCE" BuildInOracleCodeTypeTrigger = "TRIGGER" BuildInOracleCodeTypeType = "TYPE" BuildInOracleCodeTypeTypeBody = "TYPE BODY" BuildInOracleCodeTypeUndefined = "UNDEFINED" BuildInOracleCodeTypeUnifiedAuditPolicy = "UNIFIED AUDIT POLICY" BuildInOracleCodeTypeWindow = "WINDOW" BuildInOracleCodeTypeXMLSchema = "XML SCHEMA" BuildInOracleCodeTypeDatabaseLink = "DATABASE LINK" BuildInOracleCodeTypeSynonym = "SYNONYM" BuildInOraclePartitionTypeRange = "RANGE" BuildInOraclePartitionTypeHash = "HASH" BuildInOraclePartitionTypeList = "LIST" BuildInOraclePartitionTypeInterval = "INTERVAL" BuildInOraclePartitionTypeReference = "REFERENCE" BuildInOraclePartitionTypeComposite = "COMPOSITE" BuildInOraclePartitionTypeSystem = "SYSTEM" BuildInOraclePartitionTypeRangeHash = "RANGE-HASH" BuildInOraclePartitionTypeRangeList = "RANGE-LIST" BuildInOraclePartitionTypeRangeRange = "RANGE-RANGE" BuildInOraclePartitionTypeListList = "LIST-LIST" BuildInOraclePartitionTypeListHash = "LIST-HASH" BuildInOraclePartitionTypeListRange = "LIST-RANGE" BuildInOracleTemporaryTypeSession = "SYS$SESSION" BuildInOracleTemporaryTypeTransaction = "SYS$TRANSACTION" )
ORACLE object name
const ( AssessYesCompatible = "Y" AssessNoCompatible = "N" AssessYesConvertible = "Y" AssessNoConvertible = "N" AssessYesEquivalent = "Y" AssessNoEquivalent = "N" )
Assess Status
const ( AssessTypeDatabaseOverview = "DATABASE_OVERVIEW" AssessTypeObjectTypeCompatible = "OBJECT_TYPE_COMPATIBLE" AssessTypeObjectTypeCheck = "OBJECT_TYPE_CHECK" AssessTypeObjectTypeRelated = "OBJECT_TYPE_RELATED" )
Assess Type
const ( AssessNameDatabaseOverview = "DATABASE_OVERVIEW" AssessNameTableTypeCompatible = "TABLE_TYPE_COMPATIBLE" AssessNameColumnTypeCompatible = "COLUMN_TYPE_COMPATIBLE" AssessNameConstraintTypeCompatible = "CONSTRAINT_TYPE_COMPATIBLE" AssessNameIndexTypeCompatible = "INDEX_TYPE_COMPATIBLE" AssessNameDefaultValueCompatible = "DEFAULT_VALUE_COMPATIBLE" AssessNameViewTypeCompatible = "VIEW_TYPE_COMPATIBLE" AssessNameObjectTypeCompatible = "OBJECT_TYPE_COMPATIBLE" AssessNamePartitionTypeCompatible = "PARTITION_TYPE_COMPATIBLE" AssessNameSubPartitionTypeCompatible = "SUBPARTITION_TYPE_COMPATIBLE" AssessNameTemporaryTableTypeCompatible = "TEMPORARY_TABLE_TYPE_COMPATIBLE" AssessNamePartitionTableCountsCheck = "PARTITION_TABLE_COUNTS_CHECK" AssessNameTableColumnCountsCheck = "TABLE_COLUMN_COUNTS_CHECK" AssessNameTableIndexCountsCheck = "TABLE_INDEX_COUNTS_CHECK" AssessNameTableRowLengthCheck = "TABLE_ROW_LENGTH_CHECK" AssessNameIndexRowLengthCheck = "INDEX_ROW_LENGTH_CHECK" AssessNameUsernameLengthCheck = "USERNAME_LENGTH_CHECK" AssessNameTableNameLengthCheck = "TABLE_NAME_LENGTH_CHECK" AssessNameColumnNameLengthCheck = "COLUMN_NAME_LENGTH_CHECK" AssessNameIndexNameLengthCheck = "INDEX_NAME_LENGTH_CHECK" AssessNameViewNameLengthCheck = "VIEW_NAME_LENGTH_CHECK" AssessNameSequenceNameLengthCheck = "SEQUENCE_NAME_LENGTH_CHECK" AssessNameSchemaDataSizeRelated = "SCHEMA_DATA_SIZE_RELATED" AssessNameSchemaActiveSessionRelated = "SCHEMA_ACTIVE_SESSION_RELATED" AssessNameSchemaTableRowsTopRelated = "SCHEMA_TABLE_ROWS_TOP_RELATED" AssessNameSchemaCodeObjectRelated = "SCHEMA_CODE_OBJECT_RELATED" AssessNameSchemaSynonymObjectRelated = "SCHEMA_SYNONYM_OBJECT_RELATED" AssessNameSchemaMaterializedViewRelated = "SCHEMA_MATERIALIZED_VIEW_OBJECT_RELATED" AssessNameSchemaTableAvgRowLengthTopRelated = "SCHEMA_TABLE_AVG_ROW_LENGTH_TOP_RELATED" AssessNameSchemaTableNumberTypeEqual0 = "SCHEMA_TABLE_NUMBER_TYPE_EQUAL0" )
Assess Name
const ( DataCompareFixStmtTypeDelete = "D" DataCompareFixStmtTypeInsert = "I" DataCompareFixStmtTypeRows = "R" // row counts compare DataCompareRepairStmtFlowUpstream = "UPSTREAM" DataCompareRepairStmtFlowDownstream = "DOWNSTREAM" // DataCompareDisabledCollationSettingFillEmptyString represent disabled collation setting and the column name is not support collation setting DataCompareDisabledCollationSettingFillEmptyString = "" )
const ( DatabaseTypeOracle = "ORACLE" DatabaseTypeMySQL = "MYSQL" DatabaseTypeTiDB = "TIDB" DatabaseTypePostgresql = "POSTGRESQL" )
Database Type
const ( DefaultRecordCreateBatchSize = 50 DefaultRecordCreateWriteThread = 4 )
DefaultRecordCreateBatchSize Model Create Record Default Batch Size
const ( StringSeparatorComma = "," StringSeparatorDot = "." StringSeparatorBacktick = "`" StringSeparatorSlash = "/" StringSeparatorAite = "@" StringSplicingSymbol = "||" StringSeparatorSemicolon = ";" StringSeparatorUnderline = "_" StringSeparatorCenterLine = "-" StringSeparatorComplexSymbol = "|+|" StringSeparatorDoubleQuotes = "\"" StringSeparatorDoubleColon = ":" )
const ( MigrateTaskTableIsExclude = "YES" MigrateTaskTableIsNotExclude = "NO" )
const ( DefaultMYSQLCompatibleBigintLowBound = "-9223372036854775808" DefaultMYSQLCompatibleBigintUpperBound = "9223372036854775807" DefaultMYSQLCompatibleBigintUnsignedLowBound = "9223372036854775808" DefaultMYSQLCompatibleBigintUnsignedUpperBound = "18446744073709551615" DefaultMYSQLCompatibleDecimalLowerBound = "18446744073709551616" )
MYSQL Compatible Database Bigint/Bigint unsigned Bound
const ( // DefaultMasterDatabaseDBMSKey is used for saving dbms meta database infos DefaultMasterDatabaseDBMSKey = "/dbms-master/database" DefaultMasterCrontabExpressPrefixKey = "/dbms-master/crontab/express/" // DefaultMasterLeaderAddressKey is the dbms-master leader address key DefaultMasterLeaderAddressKey = "/dbms-master/leader-addr" )
Master
const ( DefaultWorkerServerDialTimeout = 5 * time.Second DefaultWorkerServerBackoffMaxDelay = 5 * time.Second )
Worker
const ( DefaultInstanceTaskReferencesPrefixKey = "/dbms-instance/reference/" DefaultInstanceServiceRegisterPrefixKey = "/dbms-instance/register/" DefaultInstanceBoundState = "BOUND" DefaultInstanceFreeState = "FREE" DefaultInstanceStoppedState = "STOPPED" DefaultInstanceFailedState = "FAILED" )
Instance
const ( DefaultInstanceRoleMaster = "MASTER" DefaultInstanceRoleWorker = "WORKER" DefaultInstanceServiceRetryCounts = 1440 DefaultInstanceServiceRetryInterval = 5 * time.Second )
Instance
const ( // Allow Oracle database role PRIMARY、LOGICAL STANDBY、PHYSICAL STANDBY OracleDatabasePrimaryRole = "PRIMARY" // Allow Oracle table migrate rowid require version OracleDatabaseTableMigrateRowidRequireVersion = "11" // Allow Oracle table, field Collation, requires oracle 12.2g and above OracleDatabaseTableAndColumnSupportVersion = "12.2" // Oracle database table type OracleDatabaseTableTypeHeapTable = "HEAP" OracleDatabaseTableTypePartitionTable = "PARTITIONED" OracleDatabaseTableTypeSessionTemporaryTable = "SESSION TEMPORARY" OracleDatabaseTableTypeTransactionTemporaryTable = "TRANSACTION TEMPORARY" OracleDatabaseTableTypeClusteredTable = "CLUSTERED" OracleDatabaseTableTypeMaterializedView = "MATERIALIZED VIEW" // specify processing for oracle table attr null、nullstring() and "" // nullstring -> n01 varchar2(10) // null -> n02 varcahr2 default null OracleDatabaseTableColumnDefaultValueWithNULL = "NULL" OracleDatabaseTableColumnDefaultValueWithNULLSTRING = "NULLSTRING" OracleDatabaseTableColumnDefaultValueWithEmptyString = "" OracleDatabaseColumnDatatypeMatchRuleNotFound = "NOT FOUND" // MYSQL database check constraint support version > 8.0.15 MYSQLDatabaseCheckConstraintSupportVersion = "8.0.15" TIDBDatabaseCheckConstraintSupportVersion = "7.2.0" MYSQLDatabaseTableColumnDefaultValueWithEmptyString = "" MYSQLDatabaseTableColumnDefaultValueWithNULLSTRING = "NULLSTRING" MYSQLDatabaseTableColumnDefaultValueWithNULL = "NULL" MYSQLCompatibleDatabaseVersionDelimiter = "-" // MYSQL database expression index support version > 8.0.0 MYSQLDatabaseExpressionIndexSupportVersion = "8.0.0" MYSQLDatabaseSequenceSupportVersion = "8.0" TIDBDatabaseSequenceSupportVersion = "4.0" TIDBDatabaseImportIntoSupportVersion = "7.5" // pg's transaction snapshot export function was initially supported in version 9.3 // which allows multiple transactions to share a consistent view of the same current database state that has been obtained // but pg 9.5 begins to support insert on conflict update syntax, similar to mysql replace into, so unified version requirements pg 9.5 // PostgresqlDatabaseSnapshotReadSupportVersion = "9.3" PostgresqlDatabaseSupportVersionRequire = "9.5" PostgresqlDatabasePartitionTableSupportVersionRequire = "10.0" // struct migrate type DatabaseMigrateSequenceCompatible = "Y" DatabaseMigrateSequenceNotCompatible = "N" // struct compare StructCompareColumnsStructureJSONFormat = "COLUMN" StructCompareIndexStructureJSONFormat = "INDEX" StructComparePrimaryStructureJSONFormat = "PK" StructCompareUniqueStructureJSONFormat = "UK" StructCompareForeignStructureJSONFormat = "FK" StructCompareCheckStructureJSONFormat = "CK" StructComparePartitionStructureJSONFormat = "PARTITION" )
const ( CharsetUTF8MB4 = "UTF8MB4" CharsetGB18030 = "GB18030" CharsetBIG5 = "BIG5" CharsetGBK = "GBK" )
Data migration, data verification, table structure default values, comments Character type data mapping rules 1. Used by the program to connect to the source database to read character type data and write it to the downstream database in the corresponding character set. 2. Used for data table default values or comments
const ( ParamValueRuleCaseFieldNameOrigin = "0" ParamValueRuleCaseFieldNameLower = "1" ParamValueRuleCaseFieldNameUpper = "2" )
const ( ParamNameStructMigrateMigrateThread = "migrateThread" ParamNameStructMigrateCreateIfNotExist = "createIfNotExist" ParamNameStructMigrateEnableDirectCreate = "enableDirectCreate" ParamNameStructMigrateEnableCheckpoint = "enableCheckpoint" ParamNameStructMigrateCallTimeout = "callTimeout" // ParamValueStructMigrateCaseFieldRuleOrigin case-field-name params value // - 0 represent keeping origin // - 1 represent keeping lower // - 2 represent keeping upper ParamValueStructMigrateCaseFieldRuleOrigin = "0" ParamValueStructMigrateCaseFieldRuleLower = "1" ParamValueStructMigrateCaseFieldRuleUpper = "2" )
migrate parameters struct migrate parameters
const ( ParamNameStructCompareCompareThread = "compareThread" ParamNameStructCompareEnableCheckpoint = "enableCheckpoint" ParamNameStructCompareCallTimeout = "callTimeout" ParamNameStructCompareIgnoreCaseCompare = "ignoreCaseCompare" // ParamValueStructCompareCaseFieldRuleOrigin case-field-name params value // - 0 represent keeping origin // - 1 represent keeping lower // - 2 represent keeping upper ParamValueStructCompareCaseFieldRuleOrigin = "0" ParamValueStructCompareCaseFieldRuleLower = "1" ParamValueStructCompareCaseFieldRuleUpper = "2" )
struct compare parameters
const ( ParamNameStmtMigrateTableThread = "tableThread" ParamNameStmtMigrateWriteThread = "writeThread" ParamNameStmtMigrateBatchSize = "batchSize" ParamNameStmtMigrateChunkSize = "chunkSize" ParamNameStmtMigrateSqlThreadS = "sqlThreadS" ParamNameStmtMigrateSqlHintS = "sqlHintS" ParamNameStmtMigrateSqlThreadT = "sqlThreadT" ParamNameStmtMigrateSqlHintT = "sqlHintT" ParamNameStmtMigrateCallTimeout = "callTimeout" ParamNameStmtMigrateEnableCheckpoint = "enableCheckpoint" ParamNameStmtMigrateEnableConsistentRead = "enableConsistentRead" ParamNameStmtMigrateEnableSafeMode = "enableSafeMode" // ParamValueDataMigrateCaseFieldRuleOrigin case-field-name params value // - 0 represent keeping origin // - 1 represent keeping lower // - 2 represent keeping upper ParamValueDataMigrateCaseFieldRuleOrigin = "0" ParamValueDataMigrateCaseFieldRuleLower = "1" ParamValueDataMigrateCaseFieldRuleUpper = "2" )
statement migrate parameters
const ( ParamNameCsvMigrateTableThread = "tableThread" ParamNameCsvMigrateWriteThread = "writeThread" ParamNameCsvMigrateBatchSize = "batchSize" ParamNameCsvMigrateDiskUsageFactor = "diskUsageFactor" ParamNameCsvMigrateHeader = "header" ParamNameCsvMigrateSeparator = "separator" ParamNameCsvMigrateTerminator = "terminator" ParamNameCsvMigrateDataCharsetT = "dataCharsetT" ParamNameCsvMigrateDelimiter = "delimiter" ParamNameCsvMigrateNullValue = "nullValue" ParamNameCsvMigrateEscapeBackslash = "escapeBackslash" ParamNameCsvMigrateChunkSize = "chunkSize" ParamNameCsvMigrateOutputDir = "outputDir" ParamNameCsvMigrateSqlThreadS = "sqlThreadS" ParamNameCsvMigrateSqlHintS = "sqlHintS" ParamNameCsvMigrateCallTimeout = "callTimeout" ParamNameCsvMigrateEnableCheckpoint = "enableCheckpoint" ParamNameCsvMigrateEnableConsistentRead = "enableConsistentRead" ParamNameCsvMigrateEnableImportFeature = "enableImportFeature" ParamNameCsvMigrateImportParams = "csvImportParams" )
csv migrate parameters
const ( ParamNameSqlMigrateBatchSize = "batchSize" ParamNameSqlMigrateWriteThread = "writeThread" ParamNameSqlMigrateSqlThreadS = "sqlThreadS" ParamNameSqlMigrateSqlThreadT = "sqlThreadT" ParamNameSqlMigrateSqlHintT = "sqlHintT" ParamNameSqlMigrateCallTimeout = "callTimeout" ParamNameSqlMigrateEnableConsistentRead = "enableConsistentRead" ParamNameSqlMigrateEnableSafeMode = "enableSafeMode" ParamNameSqlMigrateEnableCheckpoint = "enableCheckpoint" // ParamValueSqlMigrateCaseFieldRuleOrigin case-field-name params value // - 0 represent keeping origin // - 1 represent keeping lower // - 2 represent keeping upper ParamValueSqlMigrateCaseFieldRuleOrigin = "0" ParamValueSqlMigrateCaseFieldRuleLower = "1" ParamValueSqlMigrateCaseFieldRuleUpper = "2" )
sql migrate parameters
const ( ParamNameDataCompareTableThread = "tableThread" ParamNameDataCompareBatchSize = "batchSize" ParamNameDataCompareSqlThread = "sqlThread" ParamNameDataCompareWriteThread = "writeThread" ParamNameDataCompareSqlHintS = "sqlHintS" ParamNameDataCompareSqlHintT = "sqlHintT" ParamNameDataCompareCallTimeout = "callTimeout" ParamNameDataCompareEnableCheckpoint = "enableCheckpoint" ParamNameDataCompareEnableConsistentRead = "enableConsistentRead" ParamNameDataCompareOnlyCompareRow = "onlyCompareRow" ParamNameDataCompareConsistentReadPointS = "consistentReadPointS" ParamNameDataCompareConsistentReadPointT = "consistentReadPointT" ParamNameDataCompareChunkSize = "chunkSize" ParamNameDataCompareIgnoreConditionFields = "ignoreConditionFields" ParamNameDataCompareRepairStmtFlow = "repairStmtFlow" ParamNameDataCompareEnableCollationSetting = "enableCollationSetting" ParamNameDataCompareDisableMd5Checksum = "disableMd5Checksum" ParamNameDataCompareSeparator = "separator" // ParamValueDataCompareCaseFieldRuleOrigin case-field-name params value // - 0 represent keeping origin // - 1 represent keeping lower // - 2 represent keeping upper ParamValueDataCompareCaseFieldRuleOrigin = "0" ParamValueDataCompareCaseFieldRuleLower = "1" ParamValueDataCompareCaseFieldRuleUpper = "2" )
data compare parameters
const ( ParamNameAssessMigrateCaseFieldRuleS = "caseFieldRuleS" ParamNameAssessMigrateSchemaNameS = "schemaNameS" ParamNameAssessMigrateCallTimeout = "callTimeout" // ParamValueAssessMigrateCaseFieldRuleOrigin case-field-name params value // - 0 represent keeping origin // - 1 represent keeping lower // - 2 represent keeping upper ParamValueAssessMigrateCaseFieldRuleOrigin = "0" ParamValueAssessMigrateCaseFieldRuleLower = "1" ParamValueAssessMigrateCaseFieldRuleUpper = "2" )
assess migrate parameters
const ( ParamNameDataScanTableThread = "tableThread" ParamNameDataScanWriteThread = "writeThread" ParamNameDataScanBatchSize = "batchSize" ParamNameDataScanChunkSize = "chunkSize" ParamNameDataScanSqlThreadS = "sqlThreadS" ParamNameDataScanSqlHintS = "sqlHintS" ParamNameDataScanCallTimeout = "callTimeout" ParamNameDataScanTableSamplerateS = "tableSamplerateS" ParamNameDataScanEnableCheckpoint = "enableCheckpoint" ParamNameDataScanEnableConsistentRead = "enableConsistentRead" // ParamValueDataScanCaseFieldRuleOrigin case-field-name params value // - 0 represent keeping origin // - 1 represent keeping lower // - 2 represent keeping upper ParamValueDataScanCaseFieldRuleOrigin = "0" ParamValueDataScanCaseFieldRuleLower = "1" ParamValueDataScanCaseFieldRuleUpper = "2" )
data scan parameters
const ( TaskModeAssessMigrate = "ASSESS_MIGRATE" TaskModeStructMigrate = "STRUCT_MIGRATE" TaskModeSequenceMigrate = "SEQUENCE_MIGRATE" TaskModeStmtMigrate = "STMT_MIGRATE" TaskModeSqlMigrate = "SQL_MIGRATE" TaskModeIncrMigrate = "INCR_MIGRATE" TaskModeCSVMigrate = "CSV_MIGRATE" TaskModeDataCompare = "DATA_COMPARE" TaskModeStructCompare = "STRUCT_COMPARE" TaskModeDataScan = "DATA_SCAN" )
TaskMode represents a certain type of task
const ( TaskModeDataCompareMethodTableCRC32 = "TABLE_CRC32_COMPARE" TaskModeDataCompareMethodTableCount = "TABLE_COUNT_COMPARE" TaskModeDataCompareMethodTableMD5 = "TABLE_MD5_COMPARE" TaskModeDataMigrateMethodTableChunk = "TABLE_CHUNK_SPLIT" TaskModeCsvMigrateMethodTableChunk = "TABLE_CHUNK_SPLIT" )
Task represents a certain type of task run method
const ( TaskDatabaseStatusWaiting = "WAITING" TaskDatabaseStatusRunning = "RUNNING" TaskDatabaseStatusStopped = "STOPPED" TaskDatabaseStatusFailed = "FAILED" TaskDatabaseStatusSuccess = "SUCCESS" TaskDatabaseStatusEqual = "EQUAL" TaskDatabaseStatusNotEqual = "NOT_EQUAL" )
const ( TaskFlowOracleToMySQL = "ORACLE@MYSQL" TaskFlowOracleToTiDB = "ORACLE@TIDB" TaskFlowMySQLToOracle = "MYSQL@ORACLE" TaskFlowTiDBToOracle = "TIDB@ORACLE" TaskFlowPostgresToTiDB = "POSTGRES@TIDB" )
const ( TaskOperationStart = "START" TaskOperationStop = "STOP" TaskOperationCrontabSubmit = "CRONTAB SUBMIT" TaskOperationCrontabClear = "CRONTAB CLEAR" TaskOperationCrontabDisplay = "CRONTAB DISPLAY" TaskOperationDelete = "DELETE" TaskOperationStatus = "STATUS" )
const ( TaskInitStatusFinished = "Y" TaskInitStatusNotFinished = "N" TaskMigrateStatusFinished = "Y" TaskMigrateStatusNotFinished = "N" TaskMigrateStatusSkipped = "S" TaskMigrateStatusImporting = "I" TaskScanStatusFinished = "Y" TaskScanStatusNotFinished = "N" TaskScanStatusSkipped = "S" TaskCompareStatusFinished = "Y" TaskCompareStatusNotFinished = "N" TaskCompareStatusSkipped = "S" TaskAssessStatusFinished = "Y" TaskAssessStatusNotFinished = "N" )
const (
BuildInMYSQLCharsetUTF8MB4 = "UTF8MB4"
)
MYSQL Charset
const DefaultDataEncryptDecryptKey = "marvin@jwt!#$123qwer9797"
DefaultDataEncryptDecryptKey used for data encrypt and decrypt key
const DefaultMigrateTaskBufferIOSize = 4096
DefaultMigrateTaskBufferIOSize used for buffer io size
const DefaultMigrateTaskQueueSize = 1024
DefaultMigrateTaskQueueSize used for queue channel size
const ServiceDatabaseSqlQueryCallTimeout = 300
ServiceDatabaseSqlQueryCallTimeout represent package service database request sql query timeout, uint: seconds
Variables ¶
var ( DataCompareOracleDatabaseSupportNumberSubtypes = []string{ BuildInOracleDatatypeNumber, BuildInOracleDatatypeDecimal, BuildInOracleDatatypeDec, BuildInOracleDatatypeDoublePrecision, BuildInOracleDatatypeNumeric, BuildInOracleDatatypeReal, BuildInOracleDatatypeInteger, BuildInOracleDatatypeInt, BuildInOracleDatatypeSmallint, BuildInOracleDatatypeFloat, BuildInOracleDatatypeBinaryDouble, BuildInOracleDatatypeBinaryFloat, } DataCompareOracleDatabaseSupportVarcharSubtypes = []string{ BuildInOracleDatatypeVarchar, BuildInOracleDatatypeVarchar2, BuildInOracleDatatypeChar, BuildInOracleDatatypeNchar, BuildInOracleDatatypeNvarchar2, BuildInOracleDatatypeCharacter, BuildInOracleDatatypeNcharVarying, } DataCompareOracleDatabaseSupportDateSubtypes = []string{ BuildInOracleDatatypeDate, } DataCompareOracleDatabaseSupportTimestampSubtypes = []string{ BuildInOracleDatatypeTimestamp, BuildInOracleDatatypeTimestamp0, BuildInOracleDatatypeTimestamp1, BuildInOracleDatatypeTimestamp2, BuildInOracleDatatypeTimestamp3, BuildInOracleDatatypeTimestamp4, BuildInOracleDatatypeTimestamp5, BuildInOracleDatatypeTimestamp6, BuildInOracleDatatypeTimestamp7, BuildInOracleDatatypeTimestamp8, BuildInOracleDatatypeTimestamp9, BuildInOracleDatatypeTimestampWithTimeZone0, BuildInOracleDatatypeTimestampWithTimeZone1, BuildInOracleDatatypeTimestampWithTimeZone2, BuildInOracleDatatypeTimestampWithTimeZone3, BuildInOracleDatatypeTimestampWithTimeZone4, BuildInOracleDatatypeTimestampWithTimeZone5, BuildInOracleDatatypeTimestampWithTimeZone6, BuildInOracleDatatypeTimestampWithTimeZone7, BuildInOracleDatatypeTimestampWithTimeZone8, BuildInOracleDatatypeTimestampWithTimeZone9, BuildInOracleDatatypeTimestampWithLocalTimeZone0, BuildInOracleDatatypeTimestampWithLocalTimeZone1, BuildInOracleDatatypeTimestampWithLocalTimeZone2, BuildInOracleDatatypeTimestampWithLocalTimeZone3, BuildInOracleDatatypeTimestampWithLocalTimeZone4, BuildInOracleDatatypeTimestampWithLocalTimeZone5, BuildInOracleDatatypeTimestampWithLocalTimeZone6, BuildInOracleDatatypeTimestampWithLocalTimeZone7, BuildInOracleDatatypeTimestampWithLocalTimeZone8, BuildInOracleDatatypeTimestampWithLocalTimeZone9, } DataCompareORACLECompatibleDatabaseColumnDatatypeSupportCollation = []string{ BuildInOracleDatatypeChar, BuildInOracleDatatypeNchar, BuildInOracleDatatypeVarchar, BuildInOracleDatatypeVarchar2, BuildInOracleDatatypeNvarchar2, BuildInOracleDatatypeCharacter, BuildInOracleDatatypeNcharVarying} DataCompareSymbolLt = "<" DataCompareSymbolLte = "<=" DataCompareSymbolGt = ">" DataCompareMethodDatabaseCheckMD5 = "DATABASE_MD5" DataCompareMethodDatabaseCheckCRC32 = "DATABASE_CRC32" DataCompareMethodDatabaseCheckRows = "DATABASE_ROWS" DataCompareMethodProgramCheckCRC32 = "PROGRAM_CRC32" DataCompareMethodCheckMD5ValueLength = 32 DataCompareMYSQLCompatibleDatabaseSupportDecimalSubtypes = []string{ BuildInMySQLDatatypeTinyint, BuildInMySQLDatatypeSmallint, BuildInMySQLDatatypeInt, BuildInMySQLDatatypeInteger, BuildInMySQLDatatypeMediumint, BuildInMySQLDatatypeBigint, BuildInMySQLDatatypeFloat, BuildInMySQLDatatypeDecimal, BuildInMySQLDatatypeDoublePrecision, BuildInMySQLDatatypeNumeric, BuildInMySQLDatatypeReal, BuildInMySQLDatatypeDouble, } DataCompareMYSQLCompatibleDatabaseColumnTimeSubtypes = []string{ BuildInMySQLDatatypeDatetime, BuildInMySQLDatatypeTimestamp, BuildInMySQLDatatypeDate, } DataCompareMYSQLCompatibleDatabaseColumnDatatypeSupportCollation = []string{ BuildInMySQLDatatypeChar, BuildInMySQLDatatypeVarchar, BuildInMySQLDatatypeText, BuildInMySQLDatatypeTinyText, BuildInMySQLDatatypeMediumText, BuildInMySQLDatatypeLongText} )
var ( MYSQLCharsetUTF8MB4 = "UTF8MB4" MYSQLCharsetUTF8 = "UTF8" MYSQLCharsetBIG5 = "BIG5" MYSQLCharsetGBK = "GBK" MYSQLCharsetGB18030 = "GB18030" ORACLECharsetAL32UTF8 = "AL32UTF8" ORACLECharsetZHT16BIG5 = "ZHT16BIG5" ORACLECharsetZHS16GBK = "ZHS16GBK" ORACLECharsetZHS32GB18030 = "ZHS32GB18030" )
string data support charset list
var BuildInMySQLM2OColumnDefaultValueMap = map[string]string{ BuildInMySQLColumnDefaultValueCurrentTimestamp: "SYSDATE", BuildInMySQLColumnDefaultValueNULL: "NULL", }
var BuildInMySQLM2ODatatypeNameMap = map[string]string{ BuildInMySQLDatatypeSmallint: "NUMBER", BuildInMySQLDatatypeTinyint: "NUMBER", BuildInMySQLDatatypeBigint: "NUMBER", BuildInMySQLDatatypeDecimal: "DECIMAL", BuildInMySQLDatatypeDouble: "BINARY_DOUBLE", BuildInMySQLDatatypeDoublePrecision: "BINARY_DOUBLE", BuildInMySQLDatatypeFloat: "BINARY_FLOAT", BuildInMySQLDatatypeInt: "NUMBER", BuildInMySQLDatatypeInteger: "NUMBER", BuildInMySQLDatatypeMediumint: "NUMBER", BuildInMySQLDatatypeNumeric: "NUMBER", BuildInMySQLDatatypeReal: "BINARY_FLOAT", BuildInMySQLDatatypeBit: "RAW", BuildInMySQLDatatypeDate: "DATE", BuildInMySQLDatatypeDatetime: "DATE", BuildInMySQLDatatypeTimestamp: "TIMESTAMP", BuildInMySQLDatatypeTime: "DATE", BuildInMySQLDatatypeYear: "NUMBER", BuildInMySQLDatatypeBlob: "BLOB", BuildInMySQLDatatypeChar: "CHAR", BuildInMySQLDatatypeLongBlob: "BLOB", BuildInMySQLDatatypeLongText: "CLOB", BuildInMySQLDatatypeMediumBlob: "BLOB", BuildInMySQLDatatypeMediumText: "CLOB", BuildInMySQLDatatypeText: "CLOB", BuildInMySQLDatatypeTinyBlob: "BLOB", BuildInMySQLDatatypeTinyText: "VARCHAR2", BuildInMySQLDatatypeVarchar: "VARCHAR2", BuildInMySQLDatatypeBinary: "RAW", BuildInMySQLDatatypeVarbinary: "RAW", }
MYSQL TO ORACLE column datatype mapping rule
var BuildInOracleO2MColumnDefaultValueMap = map[string]string{ BuildInOracleColumnDefaultValueSysdate: "NOW()", BuildInOracleColumnDefaultValueSYSGUID: "UUID()", BuildInOracleColumnDefaultValueNULL: "NULL", }
var BuildInOracleO2MDatatypeNameMap = map[string]string{ BuildInOracleDatatypeNumber: "TINYINT/SMALLINT/INT/BIGINT/DECIMAL", BuildInOracleDatatypeBfile: "VARCHAR", BuildInOracleDatatypeChar: "VARCHAR", BuildInOracleDatatypeCharacter: "VARCHAR", BuildInOracleDatatypeClob: "LONGTEXT", BuildInOracleDatatypeBlob: "BLOB", BuildInOracleDatatypeDate: "DATETIME", BuildInOracleDatatypeDecimal: "DECIMAL", BuildInOracleDatatypeDec: "DECIMAL", BuildInOracleDatatypeDoublePrecision: "DOUBLE PRECISION", BuildInOracleDatatypeFloat: "DOUBLE", BuildInOracleDatatypeInteger: "INT", BuildInOracleDatatypeInt: "INT", BuildInOracleDatatypeLong: "LONGTEXT", BuildInOracleDatatypeLongRAW: "LONGBLOB", BuildInOracleDatatypeBinaryFloat: "DOUBLE", BuildInOracleDatatypeBinaryDouble: "DOUBLE", BuildInOracleDatatypeNchar: "CHAR", BuildInOracleDatatypeNcharVarying: "NCHAR VARYING", BuildInOracleDatatypeNclob: "LONGTEXT", BuildInOracleDatatypeNumeric: "NUMERIC", BuildInOracleDatatypeNvarchar2: "VARCHAR", BuildInOracleDatatypeRaw: "VARBINARY", BuildInOracleDatatypeReal: "DOUBLE", BuildInOracleDatatypeRowid: "VARCHAR", BuildInOracleDatatypeSmallint: "SMALLINT", BuildInOracleDatatypeUrowid: "VARCHAR", BuildInOracleDatatypeVarchar2: "VARCHAR", BuildInOracleDatatypeVarchar: "VARCHAR", BuildInOracleDatatypeXmltype: "LONGTEXT", BuildInOracleDatatypeIntervalYearMonth0: "VARCHAR", BuildInOracleDatatypeIntervalYearMonth1: "VARCHAR", BuildInOracleDatatypeIntervalYearMonth2: "VARCHAR", BuildInOracleDatatypeIntervalYearMonth3: "VARCHAR", BuildInOracleDatatypeIntervalYearMonth4: "VARCHAR", BuildInOracleDatatypeIntervalYearMonth5: "VARCHAR", BuildInOracleDatatypeIntervalYearMonth6: "VARCHAR", BuildInOracleDatatypeIntervalYearMonth7: "VARCHAR", BuildInOracleDatatypeIntervalYearMonth8: "VARCHAR", BuildInOracleDatatypeIntervalYearMonth9: "VARCHAR", BuildInOracleDatatypeTimestamp: "TIMESTAMP", BuildInOracleDatatypeTimestamp0: "TIMESTAMP", BuildInOracleDatatypeTimestamp1: "TIMESTAMP", BuildInOracleDatatypeTimestamp2: "TIMESTAMP", BuildInOracleDatatypeTimestamp3: "TIMESTAMP", BuildInOracleDatatypeTimestamp4: "TIMESTAMP", BuildInOracleDatatypeTimestamp5: "TIMESTAMP", BuildInOracleDatatypeTimestamp6: "TIMESTAMP", BuildInOracleDatatypeTimestamp7: "TIMESTAMP", BuildInOracleDatatypeTimestamp8: "TIMESTAMP", BuildInOracleDatatypeTimestamp9: "TIMESTAMP", BuildInOracleDatatypeTimestampWithTimeZone0: "DATETIME", BuildInOracleDatatypeTimestampWithTimeZone1: "DATETIME", BuildInOracleDatatypeTimestampWithTimeZone2: "DATETIME", BuildInOracleDatatypeTimestampWithTimeZone3: "DATETIME", BuildInOracleDatatypeTimestampWithTimeZone4: "DATETIME", BuildInOracleDatatypeTimestampWithTimeZone5: "DATETIME", BuildInOracleDatatypeTimestampWithTimeZone6: "DATETIME", BuildInOracleDatatypeTimestampWithTimeZone7: "DATETIME", BuildInOracleDatatypeTimestampWithTimeZone8: "DATETIME", BuildInOracleDatatypeTimestampWithTimeZone9: "DATETIME", BuildInOracleDatatypeTimestampWithLocalTimeZone0: "DATETIME", BuildInOracleDatatypeTimestampWithLocalTimeZone1: "DATETIME", BuildInOracleDatatypeTimestampWithLocalTimeZone2: "DATETIME", BuildInOracleDatatypeTimestampWithLocalTimeZone3: "DATETIME", BuildInOracleDatatypeTimestampWithLocalTimeZone4: "DATETIME", BuildInOracleDatatypeTimestampWithLocalTimeZone5: "DATETIME", BuildInOracleDatatypeTimestampWithLocalTimeZone6: "DATETIME", BuildInOracleDatatypeTimestampWithLocalTimeZone7: "DATETIME", BuildInOracleDatatypeTimestampWithLocalTimeZone8: "DATETIME", BuildInOracleDatatypeTimestampWithLocalTimeZone9: "DATETIME", BuildInOracleDatatypeIntervalDay: "VARCHAR", }
ORACLE TO MYSQL column datatype mapping rule
var BuildInOracleO2TNumberDatatypeNameMap = map[string]string{ BuildInOracleDatatypeNumber: "DECIMAL", }
var MYSQLCompatibleDatabaseTableBigTextColumnCollation = []string{"TINYTEXT",
"TEXT",
"MEDIUMTEXT",
"LONGTEXT"}
MYSQL compatibe database table datatype reverse oracle CLOB or NCLOB configure collation error, need configure columnCollation = "" ORA-43912: invalid collation specified for a CLOB or NCLOB value
var MYSQLCompatibleDatabaseTableColumnDatatypeStringDefaultValueApostrophe = []string{"TIME",
"DATE",
"DATETIME",
"TIMESTAMP",
"CHAR",
"VARCHAR",
"TINYTEXT",
"TEXT", "MEDIUMTEX", "LONGTEXT", "BIT", "BINARY", "VARBINARY", "TINYBLOB", "BLOB", "MEDIUMBLOB", "LONGBLOB"}
The default value of mysql is not differentiated between character data and numerical data. It is used to match the default value of mysql string and determine whether single quotes are required. 1, The default value uuid() matches the end of xxx() brackets, no single quotes are required 2, The default value CURRENT_TIMESTAMP does not require parentheses and is converted to ORACLE SYSDATE built-in 3, Default value skp or 1 requires single quotes
var MYSQLCompatibleDatabaseTableIntegerColumnDatatypeExcludeDecimal = map[string]string{
"TINYINT": "4",
"SMALLINT": "6",
"MEDIUMINT": "9",
"INT": "11",
"BIGINT": "20",
}
var MigrateDataSupportCharset = []string{CharsetUTF8MB4, CharsetGBK, CharsetBIG5, CharsetGB18030}
var MigrateMySQLCompatibleCharsetStringConvertMapping = map[string]string{ MYSQLCharsetUTF8MB4: CharsetUTF8MB4, MYSQLCharsetUTF8: CharsetUTF8MB4, MYSQLCharsetBIG5: CharsetBIG5, MYSQLCharsetGBK: CharsetGBK, MYSQLCharsetGB18030: CharsetGB18030, }
var MigrateOracleCharsetStringConvertMapping = map[string]string{ ORACLECharsetAL32UTF8: CharsetUTF8MB4, ORACLECharsetZHT16BIG5: CharsetBIG5, ORACLECharsetZHS16GBK: CharsetGBK, ORACLECharsetZHS32GB18030: CharsetGB18030, }
var MigrateTableStructureDatabaseCharsetMap = map[string]map[string]string{ TaskFlowOracleToMySQL: { ORACLECharsetAL32UTF8: MYSQLCharsetUTF8MB4, ORACLECharsetZHT16BIG5: MYSQLCharsetBIG5, ORACLECharsetZHS16GBK: MYSQLCharsetGBK, ORACLECharsetZHS32GB18030: MYSQLCharsetGB18030, }, TaskFlowOracleToTiDB: { ORACLECharsetAL32UTF8: MYSQLCharsetUTF8MB4, ORACLECharsetZHT16BIG5: MYSQLCharsetUTF8MB4, ORACLECharsetZHS16GBK: MYSQLCharsetUTF8MB4, ORACLECharsetZHS32GB18030: MYSQLCharsetUTF8MB4, }, TaskFlowMySQLToOracle: { MYSQLCharsetUTF8MB4: ORACLECharsetAL32UTF8, MYSQLCharsetUTF8: ORACLECharsetAL32UTF8, MYSQLCharsetBIG5: ORACLECharsetZHT16BIG5, MYSQLCharsetGBK: ORACLECharsetZHS16GBK, MYSQLCharsetGB18030: ORACLECharsetZHS32GB18030, }, TaskFlowTiDBToOracle: { MYSQLCharsetUTF8MB4: ORACLECharsetAL32UTF8, MYSQLCharsetUTF8: ORACLECharsetAL32UTF8, MYSQLCharsetGBK: ORACLECharsetZHS16GBK, }, }
table structure migration and table structure verification character set and sorting rules
var MigrateTableStructureDatabaseCollationMap = map[string]map[string]map[string]string{ TaskFlowOracleToMySQL: { "BINARY_CI": { MYSQLCharsetUTF8MB4: "UTF8MB4_0900_AS_CI", MYSQLCharsetUTF8: "UTF8_0900_AS_CI", MYSQLCharsetBIG5: "BIG5_CHINESE_CI", MYSQLCharsetGBK: "GBK_CHINESE_CI", MYSQLCharsetGB18030: "GB18030_CHINESE_CI", }, "BINARY_AI": { MYSQLCharsetUTF8MB4: "UTF8MB4_GENERAL_CI", MYSQLCharsetUTF8: "UTF8_GENERAL_CI", MYSQLCharsetBIG5: "BIG5_CHINESE_CI", MYSQLCharsetGBK: "GBK_CHINESE_CI", MYSQLCharsetGB18030: "GB18030_CHINESE_CI", }, "BINARY_CS": { MYSQLCharsetUTF8MB4: "UTF8MB4_BIN", MYSQLCharsetUTF8: "UTF8_BIN", MYSQLCharsetBIG5: "BIG5_BIN", MYSQLCharsetGBK: "GBK_BIN", MYSQLCharsetGB18030: "GB18030_BIN", }, "BINARY": { MYSQLCharsetUTF8MB4: "UTF8MB4_BIN", MYSQLCharsetUTF8: "UTF8_BIN", MYSQLCharsetBIG5: "BIG5_BIN", MYSQLCharsetGBK: "GBK_BIN", MYSQLCharsetGB18030: "GB18030_BIN", }, }, TaskFlowOracleToTiDB: { "BINARY_CI": { MYSQLCharsetUTF8MB4: "UTF8MB4_0900_AS_CI", MYSQLCharsetUTF8: "UTF8_0900_AS_CI", MYSQLCharsetBIG5: "BIG5_CHINESE_CI", MYSQLCharsetGBK: "GBK_CHINESE_CI", MYSQLCharsetGB18030: "GB18030_CHINESE_CI", }, "BINARY_AI": { MYSQLCharsetUTF8MB4: "UTF8MB4_GENERAL_CI", MYSQLCharsetUTF8: "UTF8_GENERAL_CI", MYSQLCharsetBIG5: "BIG5_CHINESE_CI", MYSQLCharsetGBK: "GBK_CHINESE_CI", MYSQLCharsetGB18030: "GB18030_CHINESE_CI", }, "BINARY_CS": { MYSQLCharsetUTF8MB4: "UTF8MB4_BIN", MYSQLCharsetUTF8: "UTF8_BIN", MYSQLCharsetBIG5: "BIG5_BIN", MYSQLCharsetGBK: "GBK_BIN", MYSQLCharsetGB18030: "GB18030_BIN", }, "BINARY": { MYSQLCharsetUTF8MB4: "UTF8MB4_BIN", MYSQLCharsetUTF8: "UTF8_BIN", MYSQLCharsetBIG5: "BIG5_BIN", MYSQLCharsetGBK: "GBK_BIN", MYSQLCharsetGB18030: "GB18030_BIN", }, }, TaskFlowMySQLToOracle: { "UTF8MB4_0900_AS_CI": { ORACLECharsetAL32UTF8: "BINARY_CI", ORACLECharsetZHT16BIG5: "BINARY_CI", ORACLECharsetZHS16GBK: "BINARY_CI", ORACLECharsetZHS32GB18030: "BINARY_CI", }, "UTF8MB4_GENERAL_CI": { ORACLECharsetAL32UTF8: "BINARY_AI", ORACLECharsetZHT16BIG5: "BINARY_AI", ORACLECharsetZHS16GBK: "BINARY_AI", ORACLECharsetZHS32GB18030: "BINARY_AI", }, "UTF8_GENERAL_CI": { ORACLECharsetAL32UTF8: "BINARY_AI", ORACLECharsetZHT16BIG5: "BINARY_AI", ORACLECharsetZHS16GBK: "BINARY_AI", ORACLECharsetZHS32GB18030: "BINARY_AI", }, "BIG5_CHINESE_CI": { ORACLECharsetAL32UTF8: "BINARY_AI/BINARY_CI", ORACLECharsetZHT16BIG5: "BINARY_AI/BINARY_CI", ORACLECharsetZHS16GBK: "BINARY_AI/BINARY_CI", ORACLECharsetZHS32GB18030: "BINARY_AI/BINARY_CI", }, "GBK_CHINESE_CI": { ORACLECharsetAL32UTF8: "BINARY_AI/BINARY_CI", ORACLECharsetZHT16BIG5: "BINARY_AI/BINARY_CI", ORACLECharsetZHS16GBK: "BINARY_AI/BINARY_CI", ORACLECharsetZHS32GB18030: "BINARY_AI/BINARY_CI", }, "GB18030_CHINESE_CI": { ORACLECharsetAL32UTF8: "BINARY_AI/BINARY_CI", ORACLECharsetZHT16BIG5: "BINARY_AI/BINARY_CI", ORACLECharsetZHS16GBK: "BINARY_AI/BINARY_CI", ORACLECharsetZHS32GB18030: "BINARY_AI/BINARY_CI", }, "UTF8MB4_BIN": { ORACLECharsetAL32UTF8: "BINARY/BINARY_CS", ORACLECharsetZHT16BIG5: "BINARY/BINARY_CS", ORACLECharsetZHS16GBK: "BINARY/BINARY_CS", ORACLECharsetZHS32GB18030: "BINARY/BINARY_CS", }, "UTF8_BIN": { ORACLECharsetAL32UTF8: "BINARY/BINARY_CS", ORACLECharsetZHT16BIG5: "BINARY/BINARY_CS", ORACLECharsetZHS16GBK: "BINARY/BINARY_CS", ORACLECharsetZHS32GB18030: "BINARY/BINARY_CS", }, "BIG5_BIN": { ORACLECharsetAL32UTF8: "BINARY/BINARY_CS", ORACLECharsetZHT16BIG5: "BINARY/BINARY_CS", ORACLECharsetZHS16GBK: "BINARY/BINARY_CS", ORACLECharsetZHS32GB18030: "BINARY/BINARY_CS", }, "GBK_BIN": { ORACLECharsetAL32UTF8: "BINARY/BINARY_CS", ORACLECharsetZHT16BIG5: "BINARY/BINARY_CS", ORACLECharsetZHS16GBK: "BINARY/BINARY_CS", ORACLECharsetZHS32GB18030: "BINARY/BINARY_CS", }, "GB18030_BIN": { ORACLECharsetAL32UTF8: "BINARY/BINARY_CS", ORACLECharsetZHT16BIG5: "BINARY/BINARY_CS", ORACLECharsetZHS16GBK: "BINARY/BINARY_CS", ORACLECharsetZHS32GB18030: "BINARY/BINARY_CS", }, }, TaskFlowTiDBToOracle: { "UTF8MB4_0900_AS_CI": { ORACLECharsetAL32UTF8: "BINARY_CI", ORACLECharsetZHT16BIG5: "BINARY_CI", ORACLECharsetZHS16GBK: "BINARY_CI", ORACLECharsetZHS32GB18030: "BINARY_CI", }, "UTF8MB4_GENERAL_CI": { ORACLECharsetAL32UTF8: "BINARY_AI", ORACLECharsetZHT16BIG5: "BINARY_AI", ORACLECharsetZHS16GBK: "BINARY_AI", ORACLECharsetZHS32GB18030: "BINARY_AI", }, "UTF8_GENERAL_CI": { ORACLECharsetAL32UTF8: "BINARY_AI", ORACLECharsetZHT16BIG5: "BINARY_AI", ORACLECharsetZHS16GBK: "BINARY_AI", ORACLECharsetZHS32GB18030: "BINARY_AI", }, "GBK_CHINESE_CI": { ORACLECharsetAL32UTF8: "BINARY_AI/BINARY_CI", ORACLECharsetZHT16BIG5: "BINARY_AI/BINARY_CI", ORACLECharsetZHS16GBK: "BINARY_AI/BINARY_CI", ORACLECharsetZHS32GB18030: "BINARY_AI/BINARY_CI", }, "UTF8MB4_BIN": { ORACLECharsetAL32UTF8: "BINARY/BINARY_CS", ORACLECharsetZHT16BIG5: "BINARY/BINARY_CS", ORACLECharsetZHS16GBK: "BINARY/BINARY_CS", ORACLECharsetZHS32GB18030: "BINARY/BINARY_CS", }, "UTF8_BIN": { ORACLECharsetAL32UTF8: "BINARY/BINARY_CS", ORACLECharsetZHT16BIG5: "BINARY/BINARY_CS", ORACLECharsetZHS16GBK: "BINARY/BINARY_CS", ORACLECharsetZHS32GB18030: "BINARY/BINARY_CS", }, "GBK_BIN": { ORACLECharsetAL32UTF8: "BINARY/BINARY_CS", ORACLECharsetZHT16BIG5: "BINARY/BINARY_CS", ORACLECharsetZHS16GBK: "BINARY/BINARY_CS", ORACLECharsetZHS32GB18030: "BINARY/BINARY_CS", }, }, TaskFlowPostgresToTiDB: {}, }
MySQL 8.0 utf8mb4_0900_as_cs accent-sensitive, case-sensitive sorting rules utf8mb4_0900_ai_ci accent-insensitive and case-insensitive collation utf8mb4_0900_as_ci accent-sensitive, case-insensitive sorting rules
Oracle field Collation mapping
var OracleCompatibleDatabaseIsNotSupportMYSQLCompatibleDatabaseTableColumnDatatype = []string{"ENUM", "SET"}
var TiDBDatabaseIntegerColumnDatatypePrimaryKey = []string{"TINYINT", "SMALLINT", "MEDIUMINT", "INT", "BIGINT", "DECIMAL"}
TiDB database integer primary key menu
Functions ¶
This section is empty.
Types ¶
This section is empty.