Planning Data Export
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:
- Have OBS enabled.
- Have the write permission on the OBS bucket where the data export path is located.
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
- Create an OBS bucket and a folder in the OBS bucket as the directory for storing exported data.
- Log in to the OBS management console.
- Create a bucket.
For details about how to create an OBS bucket, see Creating a Bucket in the Object Storage Service Console Operation Guide.
For example, create a bucket named mybucket.
- Create a folder.
For details, see Creating a Folder in the Object Storage Service Console Operation Guide.
For example, create a folder named output_data in the created mybucket OBS bucket.
- 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:
The OBS directory to be used for storing data files must be empty.
- 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 Configuring a Bucket ACL in the Object Storage Service Console Operation Guide.