Overview
Statements in the SQL window of OceanBase Developer Center (ODC) are executed synchronously. Therefore, the execution may time out when the statement runs for a long time. You can use the database change tool to run time-consuming SQL statements to avoid execution timeout.
Procedure
To create a database change task, perform the following steps:
Go to the Database Change panel.
Log on to the ODC homepage, and click the name of the target connection to go to the corresponding database object management page.
Click Tool in the top navigation bar.
Select Database Change in the drop-down list. The Create Database Change Task panel appears.
View Connection. The current connection is selected by default and you cannot switch to another connection.
Specify Database. The current database is selected by default.
Specify SQL Content.
The database change supports two ways to specify SQL content:
SQL Entry: This is the default way to specify SQL content. You can directly write the SQL script in the editing area.
NoteColumn values are separated with line breaks.
Row values are separated with spaces or tabs.
You can click IN Value Conversion to convert the batch copied data into the in('A','B') format.
Upload File: Click the file pool to go to the file explorer and select the file to be imported. You can also directly drag the file to the file pool to upload it.
NoteYou can upload up to 500 files. The total file size cannot exceed 256 MB.
By default, files are sorted by the order in which they were uploaded. You can drag and drop them to change the order. Tasks are executed in the file order.
Only SQL files suffixed with .sql are supported.
Specify Rollback Plan.
You can write an SQL script or upload a file to specify the rollback plan. For more information, see the step of specifying SQL Content.
Specify Delimiter. The delimiters are supported.
Specify Query Result Limit. You can set the number of data rows in the query result. Value range: 1 to 1000000.
Specify Task Error Handling Method.
The database change tool supports two methods to handle task errors:
Abort Task: This is the default option. When you select this option, the task is aborted if an error occurs when you run the script.
Ignore Error and Continue: When you select this option, the system skips the statement where an error occurs and continues to execute other statements in the script.
Specify Execution Timeout Value.
Specify the value in the Execution Timeout Value field in hours. Default value: 48. Maximum value: 480.
Optional. Specify Task Description.
You can enter a description of no more than 200 characters in Task Description.
Generate a database change task.
After you specify the above information in the panel, click Create to submit the information to generate the database change task.
After the task is created, the Task Center > Database Change page automatically appears. You can click View to go to the task details page, which displays Task Information, Result, and Task Logs.