The Table Sync module in Data Management (DMS) provides the Schema Synchronization, Empty Database Initialization, and Repair Table Consistency features. You can configure security rules to manage these features.
Basic configuration items
- Enable execution capability (if closed, other rules are invalid): specifies whether to enable SQL-based synchronization. If this configuration item is set to OFF, you can compare table schemas but cannot execute SQL statements to synchronize databases and tables. In addition, if this configuration item is set to OFF, the security rules that you configured for other basic configuration items and the checkpoints of the Table Sync module become invalid.
- Database table synchronization default approval Template: the default approval template for database and table synchronization. You can use this approval template or click Switch Approval Template to switch to another approval template. For more information, see Change the default approval template.
- Analysis phase script Expiration Time (unit: hours): the timeout period of the analysis phase. You can specify an appropriate timeout period in which synchronization can be canceled if schemas are changed in the destination database.
Checkpoints
- Schema Synchronization Validation: Under this checkpoint, you can configure approval processes or constraints for Schema Synchronization tickets.
- Empty Database Initialization Validation: Under this checkpoint, you can configure approval processes or constraints for Empty Database Initialization tickets.
- Table Consistency Repair Validation: Under this checkpoint, you can configure approval processes or constraints for Repair Table Consistency tickets.
You can use the default rules that are provided by DMS for each checkpoint, or customize rules based on your actual needs. For more information, see Create a security rule.
Factors and actions
- A factor is a built-in variable that is provided by DMS. You can use factors to obtain
the context to be validated by security rules, such as the categories of SQL statements
and the rows of data to be affected. A factor name consists of the prefix
@fac.
and the display name of the variable. Each tab of the Security Rules tab provides different factors for different checkpoints. The following table describes the factors that are provided for the checkpoints on the Table Sync tab.Factor Description @fac.env_type The type of the environment. The value is the display name of the environment type, such as DEV
andPRODUCT
. For more information, see Change the environment type of an instance.@fac.schema_name The name of the schema to be synchronized. - An action is the operation that DMS performs after the conditions specified in the
if
statement are met. For example, DMS forbids the submission of a ticket, selects an approval process, approves a ticket, or rejects a ticket. Actions demonstrate the purposes of security rules. An action name consists of the prefix@act.
and the display name of the operation. Each tab of the Security Rules tab provides different actions for different checkpoints. The following table describes the actions that are provided for the checkpoints on the Table Sync tab.Action Description @act.forbid_submit_order Forbids the ticket from being submitted. The statement is in the following format: @act.forbid_submit_order 'Reasons for forbidding the ticket from being submitted'
.@act.do_not_approve Specifies the ID of an approval template. For more information, see Configure approval processes. @act.choose_approve_template @act.choose_approve_template_with_reason
Security rule templates
Checkpoint | Template feature |
---|---|
Schema Synchronization Validation | Specifies that no approval is required for schema synchronization in an offline environment. |
Specifies that SQL execution is disabled for schema synchronization. | |
Specifies that SQL execution is disabled for schema synchronization in an online environment. | |
Specifies an approval process for schema synchronization in an online environment. | |
Empty Database Initialization Validation | Specifies that no approval is required for empty database initialization in an offline environment. |
Specifies that SQL execution is disabled for empty database initialization. | |
Specifies that SQL execution is disabled for empty database initialization in an online environment. | |
Specifies an approval process for empty database initialization in an online environment. | |
Table Consistency Repair Validation | Specifies that no approval is required for table consistency repair in an offline environment. |
Specifies that SQL execution is disabled for table consistency repair. | |
Specifies that SQL execution is disabled for table consistency repair in an online environment. | |
Specifies an approval process for table consistency repair in an online environment. |
Enable SQL-based synchronization
To enable SQL-based synchronization, you must set the basic configuration item named Enable execution capability (if closed, other rules are invalid) to ON. If this configuration item is set to OFF, you can only compare table schemas but cannot execute SQL statements to synchronize databases and tables.
- Log on to the DMS console.
- In the top navigation bar, move the pointer over the More icon and choose . The Security Rules tab appears.
- On the Security Rules tab, find the security rule set that you want to manage and click Edit in the Actions column.
- On the Details tab, click the Table Sync tab in the left-side pane.
- On the Table Sync tab, click Basic Configuration Item.
- Find the configuration item named Enable execution capability (if closed, other rules are invalid) and click Edit in the Actions column.
- In the Change Configuration Item dialog box, turn on Configuration Value.
- Click Submit.