All Products
Search
Document Center

:Database changes

更新時間:Jan 03, 2023

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.

Image 441

Procedure

To create a database change task, perform the following steps:

  1. Go to the Database Change panel.

    1. Log on to the ODC homepage, and click the name of the target connection to go to the corresponding database object management page.

    2. Click Tool in the top navigation bar.

    3. Select Database Change in the drop-down list. The Create Database Change Task panel appears.

  2. View Connection. The current connection is selected by default and you cannot switch to another connection.

  3. Specify Database. The current database is selected by default.

  4. 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.

      Note

        You can click IN Value Conversion to convert the batch copied data into the in('A','B') format.

        • Column values are separated with line breaks.

        • Row values are separated with spaces or tabs.

    • 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.

      Note

      • You 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.

  5. 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.

  6. Specify Delimiter. The delimiters are supported.

  7. Specify Query Result Limit. You can set the number of data rows in the query result. Value range: 1 to 1000000.

  8. 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.

  9. Specify Execution Timeout Value.

    Specify the value in the Execution Timeout Value field in hours. Default value: 48. Maximum value: 480.

  10. Optional. Specify Task Description.

    You can enter a description of no more than 200 characters in Task Description.

  11. 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.

  12. 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.