MogDB
Ecological Tools

mtk show-table-split

split large tables in parallel according to user-defined parallelism

Synopsis

Automatically generate single-table parallel conditions

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

Examples

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/'"
      ]
     }
    }
DB2
    {
     "MTK": {
      "TAB_TEST_1": [
       "MOD(\"ID\",4)=0",
       "MOD(\"ID\",4)=1",
       "MOD(\"ID\",4)=2",
       "MOD(\"ID\",4)=3"
      ]
     }
    }
MySQL
    {
      "MTK": {
        "TAB_TEST_1": [
          "MOD(`ID`,4)=0",
          "MOD(`ID`,4)=1",
          "MOD(`ID`,4)=2",
          "MOD(`ID`,4)=3"
        ]
      }
    }

Options

  -f, --format string   show format=json|yaml (default "json")
  -h, --help            help for show-table-split
  -p, --parallel int    split parallel task
  -s, --size string     large table size (default "1Gb")

Options inherited from parent commands

  -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]
      --preRun           preRun check.
      --schemas string   the Migrate schema,Separated by commas.(schema1,schema2,db1)
      --tables string    the Migrate tables,Separated by commas.(tab1,schema1.tab1)

SEE ALSO

  • mtk - Database Migration Toolkit