HomeMogDBMogDB StackUqbar

Documentation:v2.0

Supported Versions:

mtk show-table-split

split large tables in parallel according to user defined parallelism

Synopsis

automatically generate single-table parallel conditions. Copy the result to the configuration file tableSplit

  • Oracle

    • ROWID
    • ORA_HASH
  • DB2

    • MOD (only support number column and primary key)
  • MySQL

    • MOD (only support number column and primary key)
mtk show-table-split [flags]

Examples

Output
-- For Oracle
    {
     "MTK": {
      "TAB_TEST_1": [
       " rowid between 'AAAeoSAAEAAAACpAAA' and 'AAAeoSAAEAAAA4oEI/'",
       " rowid between 'AAAeoSAAEAAAA4pAAA' and 'AAAeoSAAEAABVSoEI/'",
       " rowid between 'AAAeoSAAEAABVSpAAA' and 'AAAeoSAAFAABOEoEI/'",
       " rowid between 'AAAeoSAAFAABOEpAAA' and 'AAAeoSAAFAABOGIEI/'"
      ]
     }
    }
-- For DB2
    {
     "MTK": {
      "TAB_TEST_1": [
       "ABS(MOD(\"ID\",4))=0",
       "ABS(MOD(\"ID\",4))=1",
       "ABS(MOD(\"ID\",4))=2",
       "ABS(MOD(\"ID\",4))=3"
      ]
     }
    }
-- For MySQL
    {
      "MTK": {
        "TAB_TEST_1": [
          "ABS(MOD(`ID`,4))=0",
          "ABS(MOD(`ID`,4))=1",
          "ABS(MOD(`ID`,4))=2",
          "ABS(MOD(`ID`,4))=3"
        ]
      }
    }

Options

  -f, --format string   show format=json|yaml (default "json")
  -h, --help            help for show-table-split
  -m, --method string   Define the split method. 
                        Option: rowid,mod,ora_hash,auto
                        Oracle defaults to auto(sample,mod), other databases default to mod
  -p, --parallel int    Specify the parallelism
  -s, --size string     large table size (default "1Gb")

Options inherited from parent commands

      --caseSensitive int       Object case parameters in SQL statements.
                                1 - lower case 
                                2 - upper case 
                                3 - Keep it the same as the source database.
  -c, --config string           Set mtk config file. Support json,yaml. [env MTK_CONFIG] (default "mtk.json")
  -d, --debug                   Set the debug mode.
                                Not necessary for the normal usage. [env MTK_DEBUG]
      --disableIgnoreCase       Disable ignoring case queries
      --enableSyncCompTabPro    Enable Synchronize table compressed properties
      --file                    export to file
      --fileType string         Indicates the type of a file when data is to be exported to a file.
                                support csv,sql
      --license string          Specify the license file
      --noTerminalReport        The terminal does not print an overview of the migration report
      --path string             Indicates the directory of a file to which data is to be exported. 
                                Default value is config.target.parameter.path. If not configured, the system default value ./data
                                Command Value > Config Value > MTK Default Value
      --preRun                  preRun check.
  -r, --reportFile string       Set mtk report file or dir. If it is a file, use the file directory. 
                                Default value is ./report
                                report directory format [./report/reportYYYYMMDDHHMISS] ./report/report20210101121314
      --schemas string          the Migrate schema,Separated by commas.(schema1,schema2,db1)
      --tableSkip stringArray   Define table split. Can be specified multiple times. 
                                format schema.tableName --tableSkip MTK.TABLE01 --tableSkip MTK.TABLE02
      --tables string           the Migrate tables,Separated by commas.(tab1,schema1.tab1)

SEE ALSO

  • mtk - Database Migration Toolkit
Copyright © 2011-2024 www.enmotech.com All rights reserved.