All Products
Search
Document Center

:Import tasks

更新時間:Mar 24, 2023

After you create a batch or single table import task in OceanBase Developer Center (ODC), you can view the task in the task list on the Import tab of the Task Center panel.

Task list

Note

The task list displays the tasks in the last 48 hours.

ODC allows you to run up to three import tasks in parallel, while subsequent tasks wait in the queue.

On the management page of the target database connection, click Task Center in the top navigation bar to open the Task Center panel. Click Import to display the task list.Image 453

The following table describes the columns in the task list. You can filter and sort tasks by some of the columns.

Column

Description

Task ID

The ID of the import task.

Task Type

The task type specified when the task was created. The following task types are supported: import, export, data mocking, and database change.

Connection

The name of the database connection to which the task belongs.

You can click the filter icon Filter to filter the tasks by connection.

Database

The database to be changed.

You can click the search icon Search to search for the database to which the task belongs.

Creator

The user who created the import task.

You can click the search icon Search to search for the creator.

Creation Time

The date and time when the task was generated.

Task Status

The current status of the task. ODC provides different management actions for tasks in different states.

Actions

The actions you can take. Valid values: View, Approve/Reject, Abort, and Download.

  • View: Click this button to go to the task details page to view the Task information and Task logs.

  • Approve/Reject: Click this button to approve or reject a running task.

  • Abort: Click this button to abort a running task.

  • Download: Click this button to download the imported file to your local device when the task is complete.

Create an import task

  1. Log on to ODC and go to the management page of the target connection. In the top navigation bar, click Task Center. In the Task Center panel, click + on the right side of Import to pop up the new import task panel

    image
  2. In the Create Import Task panel, specify the import format.

    image

    As shown in the preceding figure, ODC supports batch import of CSV Files, SQL Files, and ZIP Files. You can select the desired file format from the Import Format drop-down list. For more information about formats, see Export and import formats.

    Note
    • If you select CSV Files for Import Format, you can skip the values of the column header in the first row.

    • If you select ZIP Files for Import Format, you can import single or multiple tables and skip existing structures.

  3. Upload the file to be imported

    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. The format of the uploaded file must be the same as that of the value you specified for Import Format. Upload files suffixed with .zip if you have selected ZIP Files for Import Format, upload files suffixed with .sql if you have selected SQL Files for Import Format, and upload files suffixed with .csv if you have selected CSV Files for Import Format.

  4. Specify the file encoding

    ODC supports the following encoding standards: ASCII, ISO-8859-1, GB2312, GBK, GB18030, Unicode (UTF-8), Unicode (UTF-16), Unicode (UTF-32), and BIG5. You can select the encoding standard from the File Encoding drop-down list.

  5. Go to the Import Settings panel

    Click Next: Import Settings to specify file import settings and the sys tenant account.

  6. Specify Import Content

    image

    You must specify this parameter when you select ZIP Files for Import Format. ODC supports Import Data Only, Import Schema Only, and Import Schema and Data. Import Schema Only imports the definition statements of the target object. You can select the import content from the Import Content drop-down list.

  7. Select a database

    Select the database to which the data object is to be imported. The name of the database connection to which the task belongs is also displayed.

  8. Specify Import Data Settings

    If you select ZIP Files for Import Format and Import Data Only or Import Schema and Data for Import Content, this option must be specified. You need to specify the following fields:

    • Clear Data Before Import: If you select this option, the original data in the destination object is cleared during data import.

    • Batch Commit Quantity: You can click Advanced next to Export Data Settings to specify this field. After you specify this field, a COMMIT statement is executed when the number of exported data rows reaches the specified quantity.

    • Skipped Data Type (Optional): You can specify the data types to be skipped during data import. The data types that can be skipped are different in MySQL and Oracle modes. You can select multiple data types.

  9. Specify Import Schema Settings

    You cannot specify this field if you select Import Data Only for Import Content. This field involves operations on schemas that already exist. If you select Skip, the system skips the schema definition statement in the file to be imported and directly imports the data. The original data in the object is retained. If you select Replace, the system executes the schema definition statement in the file to be imported to re-create an object and replace the original one. Data in the original object is cleared.

  10. Specify Task Error Handling Method and the execution method

    • Select Execute immediately or Timed execution.

    • ODC supports two error handling methods: Abort Task and Ignore Error and Continue. You need to select the handling method as required.

  11. Retain Current Configuration

    Check Retain Current Configuration to keep the current part of the data file and structure file configuration.

  12. Generate an import task

    After you specify all preceding information, you can click Submit in the lower-right corner of the panel to create an import task.

View an import task

Task information

Click View in the Actions column of the row where the target task is located. The Task Details panel appears. Click the Task Information tab in the panel to view the basic task information, import file information, and import object information.

Item

Description

Basic information

Displays the basic information of the task, such as Task ID, Connection, Database, and Task Type.

Import file information

Displays information that you specified when you created the import task, such as Import Format, Import File, Encoding Standard, Import Content, Data Format, Import Data Settings, Task Error Handling Method, and CSV Settings.

Import object information

Displays the information of imported objects and the progress of the import task,

such as Object Name, Object Type, Planned Processing Quantity, Actual Processing Quantity, and Data Processing Status.

Task logs

Click View in the Actions column of the row where the target task is located. The Task Details panel appears. Click the Task Logs tab in the panel to view the alert logs and all logs of the task.

Field

Description

All Logs

Displays the INFO, ERROR, and WARN logs of the task.

Alert Logs

Displays the ERROR and WARN logs of the task. When a task fails, you can view the error message in the alert logs.