Assess a MySQL database

2025-12-02 07:56:10  Updated

In the assessment of a MySQL database, objects and SQL statements of the database are assessed. The SQL statements can be assessed only by scanning text files.

Prerequisites

OceanBase Migration Assessment (OMA) is installed. For more information, see Install OMA.

Assessment commands

Go to the installation directory of OMA and run start.sh with reference to the following sample statement. For more information about the parameters in the statement, see Product form. In Microsoft Windows, replace sh bin/start.sh with start.bat.

  • Object assessment command

    sh bin/start.sh    
    # The task name, which can be set to any value.
    --name MYSQL_TEST \
    # The assessment mode. ANALYZE_TOTAL indicates a database assessment.
    --mode ANALYZE_TOTAL \
    # The assessment type. Valid values: OBJECT and SQL. OBJECT indicates the assessment of objects. SQL indicates the assessment of SQL statements.
    --analyze-types OBJECT \
    # The data source. DB indicates a database.
    --from-type DB \
    # The assessment mode.
    --evaluate-mode SOURCE_TARGET \
    # The type of the source database.
    --source-db-type MYSQL \        
    # The version of the source database.
    --source-db-version 5.7 \       
    # The address of the source database.
    --source-db-host xxx.xxx.xxx.xxx\    
    # The port of the source database.
    --source-db-port port \        
    # The username of the source database.
    --source-db-user username \        
    # The password of the source database.
    --source-db-password password \        
    # The schema to be assessed. Multiple schemas are separated by commas (,). If you do not specify this parameter, all schemas are assessed by default.
    --schemas "s1,s2" \    
    # The type of the target database.
    --target-db-type OBMYSQL \
    # The version of the target database, including 2.2.50, 2.2.70, 3.1.20, 4.2.x, and 4.3.5.
    # 2.2.50 represents the 2.2.5x versions, 2.2.70 represents the 2.2.7x versions, 3.1.20 represents the 3.1.x versions, and 4.2.x represents 4.2.0, 4.2.1, 4.2.2, and 4.2.5.
    --target-db-version 4.3.5
    
  • SQL statement assessment command

    sh bin/start.sh
    # The task name, which can be set to any value.  
    --name mysql_test    \
    # The assessment mode. ANALYZE_TOTAL indicates a database assessment.
    --mode ANALYZE_TOTAL \
    # The assessment type. OBJECT indicates the assessment of objects. SQL indicates the assessment of SQL statements. OBJECT,SQL indicates the assessment of both objects and SQL statements. 
    --analyze-types SQL \
    # The data source. TEXT indicates a text file.
    --from-type TEXT \  
    # The assessment mode.
    --evaluate-mode SOURCE_TARGET \
    # The type of the source database.
    --source-db-type MYSQL \   
    # The version of the source database.
    --source-db-version 5.7 \  
    # The path of the source file.
    --source-file test.txt \  
    # The type of the target database.
    --target-db-type OBMYSQL \  
    # The version of the target database, including 2.2.50, 2.2.70, 3.1.20, 4.2.x, and 4.3.5.
    # 2.2.50 represents the 2.2.5x versions, 2.2.70 represents the 2.2.7x versions, 3.1.20 represents the 3.1.x versions, and 4.2.x represents 4.2.0, 4.2.1, 4.2.2, and 4.2.5.
    --target-db-version 4.3.5
    

After you run the preceding commands, you can view the progress in real time.

View an assessment report

After the assessment is completed, OMA generates an assessment report in the .pdf format in the report directory and an assessment report in the HTML format in the reportTool directory.

  • To view the assessment report in the .pdf format, go to the report directory and open the PDF file of the name in the path displayed in the CLI.

  • To view the assessment report in the HTML format, perform the following steps:

    1. Go to the reportTool directory, double-click the index.html file.

    2. On the page that appears, click Authorize and View Report.

    3. Select and open the oma.sqlite file.

      Generally, the oma.sqlite file is stored in the db folder under the root directory of OMA.

    4. On the page that appears after you open the oma.sqlite file, click Select Report in the upper-right corner and select the migration assessment report that you want to view from the drop-down list.

Contact Us