All Products
Search
Document Center

:SQL plan

Last Updated:Aug 21, 2023

Background information

OceanBase Developer Center (ODC) can periodically execute SQL scripts created by users to complete database development and O&M tasks as required by the users. For example, ODC can periodically execute stored procedures, backup, and database and table schema synchronization.

This topic describes how to create and manage SQL plan in ODC.

Create an SQL plan

  1. After logging in to ODC, click the target connection to enter the corresponding database object management page.

  2. In the top navigation bar, click Tools > SQL Plan .

  3. In the Create SQL Plan panel, specify the following information.

    1

    Item

    Description

    SQL Content

    You can specify SQL content in either of the following ways:

    • SQL Entry: This is the default way to specify SQL content. You can directly write the SQL script in the editing area.

    • The maximum size of the SQL statements that can be entered in the SQL window is limited to 10 MB. If the content to be entered is more than 10 MB in size, you can directly upload an attachment.

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

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

    Delimiter

    The delimiters are supported.

    Query Result Limit

    You can set the maximum number of rows allowed in the query result. Value range: 1 to 1000000.

    Execution Timeout Value

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

    Scheduled Period

    • You can directly select a predefined option of Every Hour, Every Night, or Every Friday.

    • You can also set the scheduled execution period in either of the following modes:

      • Default: You can set the scheduled execution period on a daily, weekly, or monthly basis as needed.

        SQL%20plan%20-%20Scheduled%20execution%20period%20-%20Default%20mode%204
      • Custom: You can set the scheduled execution period by specifying the second, minute, hour, day, month, or week as needed.

        SQL%20plan%20-%20Scheduled%20execution%20period%20-%20Custom%20mode%205

    Task Settings

    You can handle task errors in either of the following ways:

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

    Remarks (Optional)

    You can enter a description of up to 200 characters.

  4. Click Create to complete the task application.

References