This topic describes the CLI mode and command parameters of OceanBase Migration Assessment (OMA).
CLI mode
OMA directly runs in CLI mode.
In Microsoft Windows, run
start.bat.In Linux, run
sh bin/start.sh.
Here is an example:
user@Server1 oma-x.x.x % sh bin/start.sh --name test_11g \
--mode ANALYZE \
--from-type DB \
--evaluate-mode SOURCE_TARGET \
--source-db-type ORACLE \
--source-db-version 11g \
--source-db-host xxx.xxx.xxx.xxx \
--source-db-port 1234 \
--source-db-user user \
--source-db-password password \
--source-db-service-name orcl11g.example.oracle.com \
--schemas "OBDBA" \
--target-db-type OBORACLE \
--target-db-version x.x.xx
____ ____ __ __ _ _ _ _
/ __ \ | _ \ | \/ (_) | | (_) /\ | |
| | | | ___ ___ __ _ _ __ | |_) | __ _ ___ ___ | \ / |_ __ _ _ __ __ _| |_ _ ___ _ __ / \ ___ ___ ___ ___ ___ _ __ ___ ___ _ __ | |_
| | | |/ __/ _ \/ _` | '_ \| _ < / _` / __|/ _ \ | |\/| | |/ _` | '__/ _` | __| |/ _ \| '_ \ / /\ \ / __/ __|/ _ \/ __/ __| '_ ` _ \ / _ \ '_ \| __|
| |__| | (_| __/ (_| | | | | |_) | (_| \__ \ __/ | | | | | (_| | | | (_| | |_| | (_) | | | | / ____ \\__ \__ \ __/\__ \__ \ | | | | | __/ | | | |_
\____/ \___\___|\__,_|_| |_|____/ \__,_|___/\___| |_| |_|_|\__, |_| \__,_|\__|_|\___/|_| |_| /_/ \_\___/___/\___||___/___/_| |_| |_|\___|_| |_|\__|
__/ |
|___/
OceanBase Migration Assessment version: x.x.xx
Power by Ant Group
[INFO ] 16:24:27.165 [main] c.a.oceanbase.oma.command.Commander - Start OceanBase Migration Assessment version [x.x.xx] ...
[INFO ] 16:24:27.168 [main] c.a.oceanbase.oma.command.Commander - command parameters :
--name test_11g
--mode ANALYZE
--from-type DB
--evaluate-mode SOURCE_TARGET
--source-db-type ORACLE
--source-db-version 11g
--source-db-host xxx.xxx.xxx.xxx
--source-db-port 1234
--source-db-user user
--source-db-password user
--source-db-service-name orcl11g.example.oracle.com
--schemas OBDBA
--target-db-type OBORACLE
--target-db-version x.x.xx
[INFO ] 16:24:27.179 [main] c.a.o.o.s.ScheduleServiceImpl - local jdbc jdbc:sqlite:./db/oma.sqlite
...
================================================================
[INFO ] 16:25:15.638 [main] c.a.o.o.s.ScheduleServiceImpl - all schema finished ...
[INFO ] 16:25:15.638 [main] c.a.o.o.s.ScheduleServiceImpl - Assessment completed. Compressing the assessment report... This may take some time. Please wait...
OMA has completed the assessment. Assessment report briefing:
Task name: test_11g-20210527_162427 Start time: 2021.05.27 16:24:27 End time: 2021.05.27 16:25:15
SCHEMA: OBDBA Time spent: 47895 ms
+-------------------------------------------------------------------+
| schema: schema | source: sourceDB | target: targetDB |
+-----------------+---------+---------+---------+---------+---------+
| Object Type | pass | convert | failure | total | percent |
+-----------------+---------+---------+---------+---------+---------+
| TABLE | 186 | 0 | 1 | 187 | 99.5 % |
+-----------------+---------+---------+---------+---------+---------+
| PROCEDURE | 4 | 0 | 0 | 4 | 100.0% |
+-----------------+---------+---------+---------+---------+---------+
| TRIGGER | 0 | 0 | 1 | 1 | 0.0 % |
+-----------------+---------+---------+---------+---------+---------+
| PACKAGE | 1 | 0 | 0 | 1 | 100.0% |
+-----------------+---------+---------+---------+---------+---------+
| SEQUENCE | 2 | 0 | 0 | 2 | 100.0% |
+-----------------+---------+---------+---------+---------+---------+
| INDEX | 127 | 0 | 0 | 127 | 100.0% |
+-----------------+---------+---------+---------+---------+---------+
| VIEW | 9 | 0 | 0 | 9 | 100.0% |
+-----------------+---------+---------+---------+---------+---------+
| PACKAGE BODY | 1 | 0 | 0 | 1 | 100.0% |
+-----------------+---------+---------+---------+---------+---------+
================================================================
If the assessment result is "convert" or "failure", contact OMA Technical Support.
Command-line parameters
Only one hyphen (-) is added to the beginning of the DuseUidToSchemaMap and DuserAndPassword parameters. Two hyphens (--) are added to the beginning of other parameters. The following table describes the parameters in the start.sh script.
| Parameter | Description | Valid values | Default value | Application scenarios |
|---|---|---|---|---|
| name | The task name. | Any string | A randomly generated unique ID | All scenarios |
| mode | The task mode. |
|
analyze | All scenarios |
| target-db-type | The type of the destination database. | OBORACLE and OBMYSQL |
|
All scenarios |
| target-db-version | The version of the destination database. | 1.4.x (only for MySQL tenants of OceanBase Database), 2.1.x, 2.2.x, and 3.1.2 to 4.2.2. | 3.1.2 for Oracle and DB2 LUW databases. 2.2.x for MySQL, PostgreSQL, and TiDB databases. | All scenarios |
| target-db-host | The IP address of the destination database. | - | None | Data replay |
| target-db-port | The port number of the destination database. | - | None | Data replay |
| target-db-user | The username of the destination database account. | - | None | Data replay |
| target-db-password | The password of the destination database account. | - | None. This parameter is required. | Data replay |
| target-db-schemas | The schemas of the destination database. | - | None. This parameter is required. | Data replay |
| source-file | The path of the source file. This parameter is required when the data source is TEXT, MyBatis, iBatis, or OMA. | You can specify a folder for a MyBatis or iBatis data source, but you can specify only a single file for other data sources. | None. This parameter is required. | All scenarios |
| from-type | The data source. |
|
None. This parameter is required. | Compatibility assessment |
| evaluate-mode | The assessment mode. |
|
None. This parameter is required. | Compatibility assessment |
| source-db-type | The type of the source database. | ORACLE, MYSQL, POSTGRESQL, TIDB, DB2 LUW, RDS MYSQL, POLARMYSQL, POLARO, DRDS, GAUSSDB, OBMYSQL, and OBORACLE. | ORACLE | Compatibility assessment |
| source-db-version | The version of the source database. |
|
The default value for Oracle databases is 11g, and no default values are predefined for other types of databases. | Compatibility assessment |
| source-db-host | The address of the source database. | - | None. This parameter is required. | Compatibility assessment |
| source-db-port | The port of the source database. | - | None. This parameter is required. | Compatibility assessment |
| source-db-user | The username of the source database account. | If the username contains a space, enclose the username in double quotation marks (" "). Example: "'sys as dba'". | None. This parameter is required. | Compatibility assessment |
| source-db-password | The password of the source database account. | - | None. This parameter is required. | Compatibility assessment |
| source-db-sid | The SID of the source database. | - | None. This parameter cannot be used with source-db-service-name. |
Compatibility assessment |
| source-db-service-name | The service name of the source database. This parameter can be replaced with source-db-sid, which indicates the SID. |
- | None. This parameter cannot be used with source-db-sid. |
Compatibility assessment |
| source-db-name | The name of the source DB2 LUW database. | - | None. This parameter is required. | Compatibility assessment |
| schemas | The schemas. |
|
None. This parameter is required. | Compatibility assessment |
| objects | The objects to be assessed. Multiple objects must be separated with commas (,). | "TABLE,INDEX,VIEW,SEQUENCE, SYNONYM,FUNCTION, PROCEDURE, PACKAGE,TRIGGER,PACKAGE BODY, TYPE,TYPE BODY" | All objects | Compatibility assessment |
| collect-start-time | The collection start time. This parameter is required when the value of the from-type parameter is COLLECT. The value is a string in the format of YYYY-MM-DD HH:mm:ss. | - | None. This parameter is required. | Compatibility assessment |
| collect-during-time | The collection duration, in minutes. This parameter is required when the value of the from-type parameter is COLLECT. | Integers | None. This parameter is required. | Compatibility assessment |
| collect-loop | Specifies whether to continuously collect data. This parameter is required when the value of the from-type parameter is COLLECT. | Boolean values. "true" indicates the presence of this parameter. | false | Compatibility assessment |
| collect-interval | The collection interval, in seconds. This parameter is required when the value of the from-type parameter is COLLECT. | Integers | None. This parameter is required. | Compatibility assessment |
| store-in-db | Specifies whether to store the results in the database. OMA comes with an SQLite database for storing the results. |
|
false | Compatibility assessment |
| collect-filter | The filter condition. | Custom filter conditions. In the case of --collect-filter "1=1", no filtering is performed. |
If this parameter is absent, the following default filter condition is used: COMMAND_TYPE=3 AND SERVICE!='SYS@USERS'. |
Compatibility assessment |
| collect-end-time | The collection end time. | Example: 2021-04-07\ 19:00:51. The backslash () is an escape character for a space. | None. This parameter is required. | Compatibility assessment |
| scan-sql | The SQL statements to be collected. | Enclose each SQL statement in double quotation marks (" "). If the SQL statement contains a table name with a dollar sign ($), you must escape the sign. Example: --scan-sql "\"SELECT sql_fulltext FROM v\\\$sql where rownum < 10\"" |
None | Compatibility assessment. from-type is set to COLLECT, and source-db-type is set to ORACLE. |
| task-interval | The interval for running a collection task, which applies to long-term collection tasks. If this parameter is not specified, the collection task is run only once. If this parameter is specified, the collection task is run every specified number of seconds. | - | None | Compatibility assessment |
| collect-filter | Custom filter conditions. If this parameter is set to " ", no filtering is performed. Note that the double quotation marks (" ") are separated with a space. | - | None | Compatibility assessment |
| useUidToSchemaMap | The mapping between the UID and the schema when you parse files in an Oracle database of version 11g by using WCR files. You can specify multiple mappings.
NoticeOnly one hyphen (-) is added to the beginning of this parameter. |
The UID and schema name must be separated with a colon (:). Multiple mappings must be separated with commas (,). Example: -D useUidToSchemaMap=11:SCHEMA1,22:SCHEMA2 |
None. This parameter is required. | Performance assessment |
| replay-phase | The phase in the replay process. The replay process consists of three phases: collection, analysis, and sending. This parameter specifies the phase corresponding to the current command. | COLLECT, ANALYZE, and SEND. If you set this parameter to COLLECT and the with-reduce parameter is present, the collection and analysis phases are combined and implemented by using one command. | None. This parameter is required. | Performance assessment |
| with-reduce | Specifies whether to combine the collection and analysis phases. You can implement the collection and analysis phases by using one command by specifying this parameter. | "true" indicates the presence of this parameter. "false" indicates the absence of this parameter. If this parameter is present, you can set the replay-phase parameter only to COLLECT. | false | Performance assessment |
| nls-format | The date format of OceanBase Database. You can use this parameter to convert the date format. You can run the show variables like '%nls%format%'; command to view the specific NLS configuration. |
- | If this parameter is not specified, the date format is DD-MON-RR by default. | Performance assessment |
| split-count | The number of shards. | - | None. This parameter is required. | Performance assessment |
| source-tenant | The name of the tenant from which data is to be collected. | - | None. This parameter is required. | Performance assessment |
| parallel-count | The number of parallel threads. | Set this parameter to 20 for an online database. | 5 | Performance assessment |
| replay-process-name | The name of the replay process. | - | None | Performance assessment |
| delay-start-time | The replay start time. For example, delay-start-time 5 indicates that the replay will start in 5 seconds. |
- | None | Performance assessment |
| replay-scale | The replay scale. The replay runs at the original speed by default. | - | 1 | Performance assessment |
| warm-up | The system warm-up time, in seconds. Due to the cold start during a replay, a warm-up time must be specified. | - | 0 | Performance assessment |
| replay-sample | The sampling rate, which ranges from 0 to 1. The default value is 1, which indicates full sampling. | - | 1 | Performance assessment |
| max-parallel | The maximum number of threads. | The value cannot exceed 400. | 400 | Performance assessment |
| target-db-tenant-cluster | The tenant name and cluster name, which must be separated with a number sign (#). The tenant name precedes the cluster name. You can replay calls from multiple users, but the users must belong to the same tenant. | - | None | Performance assessment |
| userAndPassword | The login username and password.
NoticeOnly one hyphen (-) is added to the beginning of this parameter. |
The username and password must be separated with a colon (:). Multiple username/password pairs must be separated with commas (,). Example: -D userAndPassword=user1:password1,user2:password2. |
None | Performance assessment |
| hide-detail | Indicates whether to hide the assessed statements in the report. | If you specify this parameter, the report does not display the assessed statements, but only the assessment results. If you do not specify this parameter, the report displays the assessed statements. | By default, this parameter is not specified. | Compatibility assessment |
| tuning-mode | Indicates whether to enable the tuning mode. | "true" indicates the presence of this parameter. "false" indicates the absence of this parameter. | None | Compatibility assessment |
| metadata-from | The source of the database information required for tuning. If you do not specify the tuning-mode parameter, this parameter is not required. | jdbc | jdbc | Compatibility assessment |