Updated on 2022-08-16 GMT+08:00

Planning Data Export

Scenarios

Plan the storage location of exported data in OBS.

Planning OBS Save Path and File

You need to specify the OBS path (to directory) for storing data that you want to export. The exported data can be saved to a file in CSV format. The system also supports TEXT so that you can import the exported data to various applications.

The target directory cannot contain any files.

Planning OBS Bucket Permissions

The user used to export data must:

Planning Data to Be Exported and Foreign Tables

You must prepare data to be exported in the database table, and the data volume per row must be less than 1 GB. Based on the data to be exported, plan foreign tables whose attributes such as columns, column types, and length match those of user data.

Granting Write Permission to OBS Storage Location and OBS Bucket as Planned

  1. Create an OBS bucket and a folder in the OBS bucket as the directory for storing exported data.

    1. Log in to the OBS management console.

      Click Service List and choose Object Storage Service to open the OBS management console.

    2. Create a bucket.

      For details about how to create an OBS bucket, see "OBS Console Operation Guide > Managing Buckets > Creating a Bucket" in the Object Storage Service User Guide..

      For example, create a bucket named mybucket.

    3. Create a folder.

      In the OBS bucket, create a folder for storing exported data.

      For details, see "OBS Console Operation Guide > Managing Objects > Creating a Folder" in the .

      For example, create a folder named output_data in the created mybucket OBS bucket.

  2. Determine the path of the created OBS folder.

    Specify the OBS path for storing exported data files. This path is the value of the location parameter used for creating a foreign table.

    The OBS folder path in the location parameter consists of obs://, a bucket name, and a file path.

    In this example, the OBS folder path is as follows:

    obs://mybucket/output_data/

    The OBS directory to be used for storing data files must be empty.

  3. Grant the OBS bucket write permission to the user who wants to export data.

    When exporting data, a user must have the write permission on the OBS bucket where the data export path is located. You can configure ACL permissions for the OBS bucket to grant the write permission to a specific user.

    For details, see "OBS Console Operation Guide > Permission Control > Configuring a Bucket ACL" in the Object Storage Service User Guide.