HomeMogDBMogDB StackUqbar

Documentation:v2.0

Supported Versions:

MTK Object

Object

Migrate object definitions

  • Case-sensitive
  • Migration user, database, and schema
  • schema = Oracle user
  • schema = MySQL database
  • schema = PostgreSQL schema
  • schema = DB2 schema
  • schema = Informix schema
  • schema = SQLServer schema

Parameters schemas and tables are mutually exclusive. If both parameters are configured, the error "schema and table cannot exist together" will occur during migration.

If no migration object is defined, the error "not define Migrate object" will occur during migration.

Field Type Group Description
tables []string Define the object names of tables, views, functions, stored procedures, packages, etc. to be migrated
schemas []string Defines schema during migration.
excludeTable map[string][]string Defines which tables are excluded.
tableSplit map[string]map[string][]string Defines table granularity parallelism, which can be automatically generated by using mtk show-table-split.

Appears in:

Example:

Object Example

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

tables

Type: []string

Desc: Define the object names of tables, views, functions, stored procedures, packages, etc. to be migrated

when running a subcommand migration, such as sync-function and configured with tables (MTK.XXX) is the XXX function under Migrating Schema MTK.

Desc
schema_name.* is equivalent to configuring schema under schemas
schema_name.table_name
schema_name.table_name:P01,P02
schema_name.object_name%
schema_name.view_name ./mtk sync-view Migrates the view with the specified name under the schema
schema_name.function_name ./mtk sync-function Migrates the function with the specified name under the schema
schema_name.procedure_name ./mtk sync-procedure Migrates the stored procedure with the specified name under the schema

Example:

Tables Example

{
  "tables": [
    "MTK.TAB1",
    "MTK.TAB111%",
    "MTK1.*",
    "MTK1.TAB_PART:P1,P2"
  ]
}

schemas

Type: []string

Desc: Defines schema during migration.

Example:

Schemas Example

{
  "schemas": [
    "SCHEMA1",
    "SCHEMA2"
  ]
}

excludeTable

Type: map[string][]string

Desc: Defines which tables are excluded.

Example:

Exclude Table Example

{
  "excludeTable": {
    "SCHEMA1": [
      "TABLE_SKIP1",
      "TABLE_DUTY_LOG*",
      "^TABLE_DUTY_LOG*",
      "^TABLE_DUTY_LOG.*$"
    ],
    "SCHEMA2": [
      "TABLE_SKIP1"
    ]
  }
}

tableSplit

Type: map[string]map[string][]string

Desc: Defines table granularity parallelism, which can be automatically generated by using mtk show-table-split.

Defines table migration query conditions.

Example:

Table Split Example

{
  "tableSplit": {
    "SCHEMA1": {
      "TAB_1": [
        "ID < 10000",
        "ID < 90000 AND ID >=10000",
        "ID >= 90000"
      ]
    }
  }
}
Copyright © 2011-2024 www.enmotech.com All rights reserved.