Viewing a SQL Migration Report
The tool extracts SQL statements and associated statements from the source code, annotations, MyBatis Mapper XML files, and SQL files, and performs SQL compatibility assessment, conversion, and patch file generation. For details about the capabilities supported by different migration paths, see Migration Paths.
Prerequisites
The analysis task is complete.
Viewing a Migration Report
- Click Source Code Porting in the navigation pane on the left. Historical reports are listed.
- In the historical report list, click the report name of the specified analysis task to enter the porting report page. Switch to the SQL migration report.
Click Download SQL Migration Report Summary in the upper left corner to download the package that contains the SQL summary file and source code patch file. The patch file is generated based on the actual need. For details about how to use the patch file, see Source Code SQL Writeback Patch.
Figure 1 SQL Migration Report
Table 1 Compatibility assessment parameters Parameter
Description
Total SQL Statements
Total number of extracted SQL statements.
Compatible
Number of SQL statements that are compatible with the target database. These SQL statements do not need to be modified.
Incompatible
Number of SQL statements incompatible with the target database. Modify the source code based on the generated patch file. For details, see Source Code SQL Writeback Patch.
- If no patch is generated but the SQL statements have been converted, manually modify the source code based on the new SQL statements and identified context information.
- If no patch was generated due to SQL statement conversion failure, manually convert the SQL statements and modify the source code.
Unconfirmed
Number of SQL statements whose compatibility with the target database has not been confirmed. Adjust these SQL statements based on the source file, and use the database migration tool to perform compatibility analysis and conversion.
Compatibility Ratio
Number of compatible SQL statements divided by the total number of SQL statements.
Note: The SQL Migration table supports filtering by SQL compatibility. You can click View Details to check filtered results.
Table 2 Parameter description Parameter
Description
File Name
File name.
Source Path
Source file path.
Source Package Name
Source package name.
Total SQL Statements
Total number of SQL statements in the file.
Incompatible
Number of incompatible SQL statements in the file.
Unconfirmed
Number of SQL statements whose database compatibility has not been confirmed.
Generated Patches
Number of patches generated in incompatible SQL statements.
Guidance Suggestion
Click View Details to view the guidance details.
Status
Migration status of the file, which is Migrated, To be migrated, or Masked.
Status Source
Source of the component, which defaults to a migration by the tool. If you want to modify the component status, the status source will change to Customized.
Remarks
Supplementary information.
Updated
Time when the migration status is updated.
Operation
You can modify the migration status and add remarks.
- Click View Details in the Guidance column, and you will see the SQL migration guidance on the right.You can move the cursor to the code with a wavy line. Some of the migration paths allow assessing extracted SQL statements (incompatible and to-be-confirmed SQL statements are marked with
), and converting incompatible SQL statements and generating patches. For other migration paths, perform compatibility analysis and conversion as prompted.
Figure 2 Guidance Suggestion
- SQL statements starting with drop, grant, alter, or truncate are risky operations, and the risk is described in the pop-up information. You are not advised to run such statements in the database, for example, drop table t;.
- The .NET source code does not provide the SQL concatenation or completion capability. Check whether the identified database operation statements are supported in the target database. If not, modify the source file.
- For details about source code SQL APIs, see Source Code SQL APIs.
- After the migration is complete, you can close the sliding frame. Click Edit in the Operation column, select a state from the drop-down list, and click Save.
You can select multiple files and click Batch Edit in the left upper corner to edit the source files at the same time. Click OK to save the modification.