Schema comparison
NineData database comparison function supports schema comparison, that is, metadata comparison, which is used to compare whether the definitions of objects in two databases are consistent. This article describes how to perform schema comparisons.
Prerequisite
The data sources that need to be compared have been added to NineData. For more information, see Adding Data Sources .
The supported types of source and target data sources can be found in the Introduction to Database Comparison.
Steps
Log in to NineData console .
In the left navigation bar, click Database Comparison > Schema Comparison .
In the upper right corner of the Schema Comparison page, click Create Schema Comparison .
On the Source & Target tab, configure according to the following table, and click Next .
Parameters Description Name Enter the name of the comparison task. For the convenience of subsequent search and management, please try to use a meaningful name. Up to 64 characters are supported. Source Compare the source data source of the task, and the system will compare based on the structure of the data source. Target The object data source for the comparison task. Frequency Select how often the comparison is performed. - One-time : Perform the comparison task only once. User can manually perform the comparison task multiple times.
- Periodic : Periodically perform a compare task.
Periodic (Periodic comparison only) Choose how often to compare, user can choose any one or more days from Monday to Sunday, or check Every day to compare daily. Time Zone (Periodic comparison only) Select the time zone according to the actual business situation. This parameter affects the time displayed in the comparison task. Launch Time ( Periodic comparison only) Select the time to launch the comparison task, from 00:00 to 23:59 . User can also click Now to select the current time as the start time. On the Objects tab, select the content to be compared and click Next . Both Full Instance and Customized Object are supported .
- Full Instance : Select all databases and objects in the source instance.
- Customized Object : Customize the database and objects to be compared. In the Source list on the left, select the databases and objects to be compared, and click > add to Target list.
On the tab, configure the mapping relationship between the source and target databases and object names, and click Save and Pre-Check .
tipIf the database and object names in the target end are inconsistent with those in the source end, user should configure the mapping logic.
On the Pre-check tab, wait for the system to complete the pre-check. After the pre-check passes, click Launch .
tip- If the pre-check fails, user need to click the Details in the Actions column to the right of the target check item to correct the failure, and then perform the pre-check again.
Warnings can be repaired or ignored according to specific circumstances.
:::
On the Launch tab, a message is displayed indicating that Launch Successfully . You can do the following:
- If it is a Periodic comparison , click Compare to execute a comparison task immediately.
- Click View Details to view the execution of the comparison task.
- Click Back to List to return to the Schema Comparison list.
View comparison results
Log in to the NineData console .
In the left navigation bar, click Database Comparison > Schema Comparison .
On the Schema Comparison page, click the Task ID. The page description is as follows.
Serial number Function Description 1 Task status Compare the current state of the task. 2 Configure alerts After configuring alerts, the system notifies the user in case of a task failure. 3 Compare now Only in-progress tasks are displayed, and a comparison task begins immediately. 4 More - Pause : Pause the task, only applicable to the task whose status is Running.
- Edit : Edit the configuration information of the task.
- Terminate : End the task.
- Delete : Delete the task. The action is irreversible, please operate with caution.
5 Filter items Filter the comparison results by task status , task results , and table names. 6 Log Records all logs during the execution of the comparison task, and supports quick filtering and positioning of target logs by log type , log generation time , keywords and other items. 7 Refresh Get the latest status of comparison tasks. 8 List of comparison results Show the results of the structural comparison between the source and destination. - Click the in the Actions column on the right side of the comparison list : view the comparison details of the table definition DDL statements of the source and target.
- Click the in the Actions column on the right side of the comparison list (displayed in case of inconsistency): generate change SQL, user can apply SQL on target instance for execution, and correct the inconsistent content.
9 History of comparison task results Click to view a list of all comparison results. Click on a target list item to switch to the details of that comparison result.