Database export
To back up a database or export tables for data analysis, use the data export feature of Data Management Service (DMS). You can export a database by submitting a ticket.
Data Management Service (DMS) is a web-based SaaS tool. You can access the DMS console in your browser to use this feature. You do not need to install any browser plug-ins or local client software.
Prerequisites
This feature supports the following database types:
MySQL databases: self-managed MySQL, ApsaraDB RDS for MySQL, PolarDB for MySQL, AnalyticDB for MySQL, and ApsaraDB for OceanBase in MySQL mode.
SQL Server databases: self-managed SQL Server and ApsaraDB RDS for SQL Server.
PostgreSQL databases: self-managed PostgreSQL, ApsaraDB RDS for PostgreSQL, PolarDB for PostgreSQL, and AnalyticDB for PostgreSQL.
Oracle-compatible databases: PolarDB for PostgreSQL (compatible with Oracle).
ApsaraDB for MariaDB and other MariaDB databases.
You are logged on to the database that you want to export in DMS and have the required permissions. For more information, see View my permissions and Apply for permissions on resources.
MongoDB is not included in the list of supported databases for database export. MongoDB is a document-oriented database that does not use traditional DDL statements to create tables. The structure of a MongoDB collection is dynamically defined by the data that it stores. If you want to export the metadata and index definitions of a MongoDB collection, we recommend that you run the mongodump --noData command. This command generates a .metadata.json file that contains the collection name and index definitions, but does not export the actual data.
Export limits
Control mode | Row limit | File size limit |
Flexible Management | Up to 1 million rows per day for free. | Up to 50 GB per file. |
Stable Change | Up to 20 million rows per day for free. | Up to 50 GB per file. |
Secure Collaboration | Unlimited rows. | Up to 50 GB per file. |
If the current control mode of the instance does not meet your business requirements, an administrator or DBA can change the control mode. For more information, see Change the control mode of an instance.
Flexible Management is free. Stable Change and Secure Collaboration are paid features. For pricing details, see Billable items (DMS).
In the instance tree on the left, right-click the target instance, choose Control mode, and then select the desired mode, such as Flexible Management, from the submenu.
Precautions
If you export data to an Excel file, the export may fail if a cell contains more than 32,767 characters.
The exported files of a database export ticket are retained for up to 180 days. After 180 days, the files can no longer be downloaded.
Procedure
Log in to DMS 5.0.
-
Move the pointer over the
icon in the upper-left corner of the DMS console and choose . NoteIf you use the DMS console in normal mode, choose in the top navigation bar.
Configure the parameters for the data export ticket.
Parameter
Description
Database Name
Select the database to export.
Exported Table
Select Partial Tables or All Tables. If you select Partial Tables, select the required tables in the pane on the right.
NoteTo configure filter conditions for specific tables, double-click the WHERE clause.
Stakeholder
Add stakeholders who can view and collaborate on the ticket. The ticket is not visible to other users, except for administrators and DBAs.
Export Content
Select the content to include in the export:
Data: Exports table data as
INSERTstatements.Structure: Exports the table schema as
CREATEstatements.Data and Structure: Exports both the table data and schema.
File Format
Specifies the format of the exported file.
SQL
CSV
EXCEL
Exported Structure Type
Select the types of schema objects to export.
Procedure
Function
Trigger
View
Event
NoteThe supported schema objects vary by database type. See the console for available options.
Export Timeout
The timeout period for the export task, in seconds. The value can range from 0 to 2,147,483. If you leave this blank, DMS uses the default instance-level export timeout. To view the instance-level timeout, see Add a database instance.
NoteThe task fails if it does not complete within the specified timeout period.
More Options
Click Big Data Export Options or SQL Script Options and select the desired options.
Attachments
You can upload images or documents to provide more context for the ticket.
After you complete the configuration, click Submit and wait for approval.
You can track the approval progress in the Approval section on the ticket details page.
NoteExports from instances in Flexible Management or Stable Change mode do not require approval.
The approval process for tickets is configured by administrators or DBAs. To customize the approval process, see Customize approval workflows for tickets.
After the ticket is approved, in the Download section, click Download Exported File.
Next steps
After the export is complete, consider unsubscribing from the Stable Change or Secure Collaboration modes to avoid unnecessary costs. To do so:
Change the control mode of the instance to Flexible Management. For more information, see Change the control mode of an instance.
In DMS Order Management, unsubscribe from the target control mode product. For more information about the refund policy, see Refund policy.
If the export is no longer needed, close the ticket promptly to prevent potential data leaks. For more information, see Close a ticket.
API reference
FAQ
Q: If I change the control mode before exporting, can I switch the instance back to the original mode after the export?
A: Yes. For more information, see Change the control mode of an instance.
Q: Does database export support scheduled execution?
A: No. Database export supports immediate execution only. To export data on a schedule, use SQL Result Set Export and select scheduled execution in the execution policy.
Q: Does changing the maximum number of rows returned by a single query trigger data export approval?
A: No. The maximum number of rows returned by a single query only controls how many results are displayed in the SQL console. It is independent of data export approval, so changing this setting does not trigger export approval. If you need to export more rows than this limit allows, submit a data export ticket.
Q: What do I do if a database export fails?
A: Troubleshoot the issue in the following order:
Make sure that you are logged on to the database that you want to export in DMS. If you are not logged on when you submit the ticket, DMS reports that Database Name is a required field. For more information, see the Prerequisites section of this topic.
Check whether your account has the permissions required to export the database. If you do not have the required permissions, the database is not displayed in the Database Name drop-down list. For information about how to view and apply for permissions, see the Prerequisites section of this topic.
Check whether the Export Timeout value is too low. If the value is too low, the export task fails with an
i/o timeouterror before the export is complete. For more information about this parameter, see the description of Export Timeout in the Procedure section of this topic.Check whether the row limit of the control mode of the instance meets your export requirements. For the row limit and file size limit of each control mode, see the Export limits section of this topic.