Data Management (DMS) allows you to create and manage SQL tasks. You can use these tasks to manage SQL statements for features such as normal data change, schema design, and database and table synchronization. However, you cannot use them for SQL statements that are executed on the SQLConsole tab. This topic describes how to create and manage SQL tasks.
Prerequisites
You are a DMS administrator or database administrator (DBA). For information about user roles, see System roles.
Procedure
- Log on to the DMS console V5.0.
- In the top navigation bar, choose .
- On the Task page, create an SQL task or manage existing SQL tasks.
- Create an SQL task
- Click Add SQL task. In the dialog box that appears, set the parameters that are described in the following table
Parameter Description Remarks The purposes or objectives of the data change. This reduces unnecessary communication.
Database The database whose data you want to change. You can select one or more databases. Note If the database is managed in a database instance in Stable Change or Flexible Management mode, make sure that you have logged on to the database. For more information about control modes, see Control modes.Change SQL The SQL statements for the data change. You can submit all SQL statements that can be executed. One or more SQL statements are supported and separated by semicolons (;). Planned execution time Specifies whether to run the task immediately or run the task at the specified point in time. Valid values: - ON: You can specify a point in time to run the task.
- OFF: The task is immediately run after you submit it. This is the default value.
Transaction Specifies whether to enable the transaction mode. This parameter takes effect only when you select a single database. Valid values: - ON: If an SQL statement fails to be executed, all the other executed SQL statements in the same transaction are rolled back.
- OFF: One SQL statement is executed at a time. This is the default value.
Concurrent execution of group tasks Specifies whether to execute SQL statements in all databases. This parameter takes effect only when you select multiple databases. Valid values: - ON: The SQL statements can be executed in all databases.
- OFF: The SQL statements can be executed in the first database you select. If the execution succeeds, the SQL statements can be executed in other databases in sequence. This is the default value.
Ignore execution errors Specifies whether to skip errors when SQL statements are being executed. Valid values: - ON: If an error occurs when an SQL statement is being executed, DMS skips the error and continues to execute subsequent SQL statements until all remaining statements are executed.
- OFF: If an error occurs when an SQL statement is being executed, DMS stops executing the current and subsequent SQL statements. This is the default value.
Logical table expression validation Specifies whether to verify the logical expression. This parameter takes effect only when you select a logical database. Valid values: - ON: DMS checks whether the logical expression is valid. This is the default value. For more information, see Logical table.
- OFF: We recommend that you do not set this parameter to OFF.
Note After you complete the configurations, click Preview/convert SQL. In the message that appears, you can preview the SQL statements. - Click Submit Task.
- Click Add SQL task. In the dialog box that appears, set the parameters that are described in the following table
- Manage SQL tasks
- Pause a task
On the Task page, find the task that you want to pause and click Pause in the Operation bar column.
- Retry a task
On the Task page, find the task that is in the Failure state and click Retry in the Operation bar column.
- View logs
On the Task page, find the task whose scheduling logs you want to view and click Log in the Operation bar column.
- Delete a task
On the Task page, find the task whose scheduling logs you want to view and click Delete in the Operation bar column. The task is in the Delete state and can no longer be run.
- Pause a task
- Create an SQL task