All Products
Search
Document Center

Table Sync

Last Updated: Jun 29, 2020

In the Data Management Service (DMS) console, you can set security rules in the Table Sync module for validating operations related to schema synchronization, empty database initialization, and table consistency repair.

Basic configuration items

DMS offers the following basic configuration items in the Table Sync module:

  • Enable execution capability (if closed, other rules are invalid): specifies whether to enable SQL-based synchronization. If this configuration item is set to OFF, applicants can compare table schemas but cannot execute SQL statements to synchronize databases and tables. Other configuration items and security rules you set under checkpoints in the Table Sync module will also become invalid.
  • Database table synchronization default approval Template: the default approval template for database and table synchronization applications. You can directly use the template or click Switch Approval Template and select another template. For more information, see Procedure of changing the default approval template.
  • Analysis phase script Expiration Time (unit: hours): the timeout interval of the analysis phase. You can set an appropriate timeout interval so that synchronization can be canceled in a timely manner in case of schema changes in the destination database.

Checkpoints

Three checkpoints are provided in the Table Sync module, corresponding to the three features supported by the module. The three checkpoints are unrelated to each other. For example, when a user submits a Schema Synchronization ticket, only the basic configuration items and the security rules specified under the Schema Synchronization Validation checkpoint are used to validate the ticket.

  • Schema Synchronization Validation: Under this checkpoint, you can set approval processes or constraints for Schema Synchronization tickets.
  • Empty Database Initialization Validation: Under this checkpoint, you can set approval processes or constraints for Empty Database Initialization tickets.
  • Table Consistency Repair Validation: Under this checkpoint, you can set approval processes or constraints for Repair Table Consistency tickets.

You can use the default rules provided by DMS, or set custom rules as required. For more information about how to create a security rule, see Procedure of creating a security rule.

Factors and actions

  • Factor: A factor is a system built-in variable that is used to obtain the context to be validated by security rules, such as the subcategories of SQL statements and the number of rows in which data is affected. A factor name starts with @fac., appended with the display name of the factor type. Each module of the Security Rules page offers different factors for different checkpoints. The following table describes the supported factors in the Table Sync module.
Factor Description
@fac.env_type The type of the environment. The value is the display name of the environment type, such as DEV and PRODUCT. For more information, see Change the environment type of an instance.
@fac.schema_name The name of the schema to which data is to be synchronized.
Action: An action is the operation that the system performs after the conditions specified in the if statement are met. For example, the system can perform the relevant action to forbid the submission of a ticket, select an approval process, approve a ticket, or reject a ticket. Actions show the purpose of setting security rules. An action name starts with @act., appended with the display name of the action type. Each module of the Security Rules page offers different actions for different checkpoints. The following table describes the supported actions in the Table Sync module.
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 submitting the ticket’.
@act.do_not_approve Specifies the approval template. For more information, see Approval processes.
@act.choose_approve_template
@act.choose_approve_template_with_reason

Templates of security rules

DMS provides you with various system built-in templates of security rules. You can directly use the templates or modify the templates based on your business requirements. The following table describes the supported rule templates in the Table Sync module.

Checkpoint Feature of template
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.
Sets 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.
Sets 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.
Sets an approval process for table consistency repair in an online environment.

Procedure of changing the default approval template

  1. Log on to the DMS console.
  2. In the top navigation bar, choose System Management > Security > Security Rules.
    Security rules3

  3. On the Security Rules page that appears, find the target rule set and click Edit in the Actions column.

  4. On the Details page that appears, click the Table Sync tab.
  5. On the Table Sync tab, the basic configuration items appear by default.
  6. Find the Database table synchronization default approval Template configuration item and click Edit in the Actions column.
    edit
  7. In the Change Configuration Item dialog box that appears, click Switch Approval Template.
  8. In the Switch Approval Template dialog box that appears, find the target template and click Select in the Actions column.

    Note: You can also click Reset to Free of Approval to skip the approval for tickets.

  9. Click Submit.

Procedure of creating a security rule

  1. Log on to the DMS console.
  2. In the top navigation bar, choose System Management > Security > Security Rules.
  3. On the Security Rules page that appears, find the target rule set and click Edit in the Actions column.
  4. On the Details page that appears, click the Table Sync tab.
  5. On the Table Sync tab, click Create Rule next to Actions.
    create
  6. In the Create Rule - Table Sync dialog box that appears, set the parameters as required. The following table describes the parameters.

    Parameter Description
    Checkpoints (Required) The checkpoint under which you want to create the security rule. The Table Sync module offers the following three checkpoints:
    • Schema Synchronization Validation
    • Empty Database Initialization Validation
    • Table Consistency Repair Validation
    Template Database (Optional) The template based on which you want to create the security rule. DMS provides you with various system built-in templates of security rules. After you select a checkpoint from the Checkpoints drop-down list, you can click Load from Template Database to select a template. For more information about the available templates, see Templates of security rules.
    Rule Name (Required) The name of the security rule. If you load a security rule from a template, the rule name is automatically filled in.
    Rule DSL (Required) The DSL statement used to set the security rule. For more information, see DSL syntax for security rules. If you load a security rule from a template, the statement is automatically filled in.
  7. Click Submit.

  8. Find the created security rule and click Enable in the Actions column. By default, the created security rule is in the Disabled state.
  9. In the message that appears, click OK.