This topic describes how to submit a ticket to import an SQL file on the SQL Console page.
- Log on to the DMS console.
- In the left-side navigation pane, enter the name of the target database in the search
box and press Enter. From the matched result, click the instance where the target
database resides and double-click the target database. The SQL Console page appears.
- In the navigation tree on the left of the SQL editor, right-click the target table
and select Import.Note Alternatively, you can choose Common data change.> Normal Data Modify in the top navigation bar. On the Data Change Ticket Application page, you can enter SQL statements or upload an SQL file for changing data. You can enter SQL statements to perform various operations, for example, to insert, delete, modify, or query data in the table, or change the schema of the table. For more information, see
- On the Data Import page, set the parameters as described in the following table.
Parameter Description Reason Category Required. The reason for the data import operation. Business Background Required. The detailed description of the business background of the data import operation. Change Stakeholder Optional. The stakeholders of the data import operation. Database Required. The destination database of the data import operation.Note If the destination database is managed in an instance in Flexible Management or Stable Change mode, make sure that the database is logged on. Otherwise, the database will not appear in the drop-down list. File Encoding Required. The encoding algorithm to be used by the destination database. Valid values:
- Automatic Identification
SQL Statements for Change Required. The file that contains the SQL statements for importing data. Select a file format and upload a file. You can upload an SQL script or a CSV file. If you select the CSV file format, a field appears next to CSV. Enter the name of the destination table in the field. SQL Statements for Rollback Optional. The SQL statements for rolling back the data import operation. Valid values: Text and Attachment.
- Text: the SQL statements for rolling back the data import operation. Enter the SQL statements in the field.
- Attachment: the file that contains the SQL statements for rolling back the data import operation. You can upload a TXT file or an SQL script. The file can be up to 15 MB in size.
Attachments Optional. The one or more images or files that contain other necessary information for the ticket.
- Click Submit and wait until the precheck is complete. If the ticket fails the precheck, find out
the issue based on the prompt, resolve the issue, and then submit the ticket again.
Note If the uploaded file is an SQL script, DMS prechecks the SQL statements in the uploaded file. If the uploaded file is a CSV file, DMS generates
INSERTstatements based on the uploaded file.
- Submit the ticket for approval.
- After the ticket is approved, click Execute Change in the Execute step.
- In the Task Settings dialog box, set the control items. If you do not want the task to be run immediately,
turn off the Execute Immediately switch and specify a point in time for DMS to automatically run the task. Then, click
Confirm Execution. Note During the execution, DMS reads the SQL statements in streaming mode and executes the SQL statements in batches. Each batch of SQL statements is 1 MB in size.