Prerequisites
• The operation user has the import and export permissions for the destination database.
• The destination database is already logged on.
• For resource pools supported by data import and export functions, see the resource pool constraints of the Data Admin Service.
Constraints and Restrictions
• The data import function supports the following database types: MySQL and PostgreSQL.
• The data import function supports the local uploading of SQL files, CSV files (comma-separated values), and TXT files (comma-separated values).
• The data import function supports the following writing formats:
– INSERT INTO: When data is inserted, the database checks the primary key and reports an error if duplication occurs.
– INSERT IGNORE INTO: When data is inserted, the database checks the primary key and ignores the current new data if the same record already exists in the table.
– REPLACE INTO: When data is inserted and replaced, the database checks the primary key. If the data in the database already exists, it will replace it with new data; if no data exists, the effect is the same as INSERT INTO.
• The data export function supports a variety of common data formats: CSV (comma-separated values), SQL file, and TXT file.
• The data export function supports full table export. Alternatively, you can enter SQL statements for custom export, so that only the data you need is exported.
• Currently, the data export function supports a maximum data amount of one million rows.
For details, see Introduction to Data Import and Introduction to Data Export.
Procedure
Data Import
Log in to the DAS Console.
On the left navigation bar, click Development Space > Data Import to go to the Data Import Management page.
Click the Data Import button, and a pop-up window for filling the data import order appears. The content to be entered in the order is described as follows:
Destination Database: Database instance selection list. The data comes from the database instances added in Data Assets > Metadata Management. MySQL and PostgreSQL are supported.
Import File Type: You can select CVS, SQL, or TXT.
Target Table: Filter the imported target tables under the selected destination database.
Writing Mode: You can select INSERT INTO, INSERT IGNORE INTO, or REPLACE INTO.
Upload Attachment: Upload a file of the corresponding file type.
Work Order Description: Describes the order remarks.
After filling out the data import order, click the Submit button to complete the submission of the order and go to the background execution stage of data import.
Data Export
Log in to the DAS Console.
On the left navigation bar, click Development Space > Data Export to go to the Data Export Management page.
Click the Data Export button, and a pop-up window for filling the data export order appears. The content to be entered in the order is described as follows:
Select Database: Database instance selection list. The data comes from the database instances added in Data Assets > Metadata Management. MySQL and PostgreSQL are supported.
Export Type: Full Table Export or SQL Result Set Export can be selected. If Full Table Export is selected, you need to select the table; if SQL Result Set Export is selected, you need to enter the SQL query statements.
Export File Type: CSV (comma-separated values), SQL, and TXT are supported. You can select the format that best suits your workflow as per your needs.
Remarks: Describes the order remarks.
After filling out the data import order, click the Evaluate button to evaluate the current export task. The estimated number of exported rows and the estimated time required for export are provided for reference only.
Click the Submit button to perform the background export task. After submission, jump to the Export Work List page, where you can view the export state.