This topic describes how to export table schemas, SQL query result sets, and entire databases.
Prerequisites
The Result Set Export Support rule is enabled for the security rule that is associated with the database. This rule is enabled by default. For more information, see SQL Console - Relational Database.
You have query and export permissions for the target database. For more information, see Manage Resource Access Management Permissions.
Export Table Schemas
- Log on to the DMS console V5.0.
In the Database Instances list on the left side, find the target database.
Double-click the database name to go to the SQL Console.
Right-click the target table and choose .
NoteYou can also choose
> Entire Database Table Schema in the upper-right corner of the page.On the Export Table Schema page, export the data dictionary document.
You can export the document in Word, Excel, and PDF formats.
Export SQL Query Result Sets
Exporting result sets from NoSQL databases is not supported.
- Log on to the DMS console V5.0.
In the Database Instances list on the left side, find the target database.
Double-click the database name to go to the SQL Console.
In the Execution Result area, choose .
Set the parameters and click Confirm.
Configuration Item
Description
Reason Category
Select the reason for data exporting to facilitate future searches.
Business Background
Describe the reason or goal of the change in detail to reduce communication costs.
Relevant Personnel
Relevant personnel can view and collaborate on the ticket. Other personnel cannot view the ticket (except administrators and DBAs).
Export SQL Statement
Enter the SQL statement to export.
Embed Watermark
Select whether to embed a watermark in the exported file. For more information, see Embed Watermark.
Data watermark: This embeds identification information into data in a way that is difficult for data users to detect.
NoteUse data watermarks if the exported data contains more than 200 entries.
Database instances without sensitive data protection enabled cannot use data watermarks.
File watermark: This embeds identification information into a file in a way that is directly visible to data users.
In the Ticket Generated Successfully dialog box, click View Ticket.
On the ticket details page, in the Precheck area, verify the Affected Rows information, and click Submit for Approval.
After the ticket is approved, the system automatically runs the export task. When the task is complete, return to the ticket details page and click Execute Export. Select the file type, Data, Character Set, and other options, and then click Confirm Execution.
Click Download Exported File to download the file to your local computer.
When you export data in CSV format, the file does not contain formatting information. By default, Excel parses date fields in the General format, which may cause the dates to be displayed as serial numbers or abnormal characters. To display the dates correctly, select the column, right-click, and then choose "Format Cells" → "Date".
Export Entire Database
You can export table schemas, data, and other database objects, such as stored procedures, functions, triggers, views, and events, for an entire database.
- Log on to the DMS console V5.0.
In the Database Instances list on the left side, find the target database.
Double-click the database name to go to the SQL Console.
Right-click the target table and choose .
NoteYou can also choose
> Export This Database in the upper-right corner of the page.Configure the database export parameters.
Configuration Item
Description
Exported Tables
Select to export Partial Tables or All Tables.
If you select partial tables, select the target tables to export on the right.
Reason Category
Select the reason for data exporting to facilitate future searches.
Business Background
Describe the reason or goal of the change in detail to reduce communication costs.
Relevant Personnel
Relevant personnel can view and collaborate on the ticket. Other personnel cannot view the ticket (except administrators and DBAs).
Export Content
Select the export content. Currently, you can export Data, Structure, or Data and Structure.
Export Structure Type
Select the export structure type. Currently, supported structure types include Stored Procedure, Function, Trigger, View, and Event.
NoteDifferent database types support different export structure types. Refer to the console for details.
After you set the parameters, click Submit Application.
NoteAfter you submit the application, the system redirects you to the ticket details page. On this page, you can view the Basic Information and approval progress of the ticket.
After the ticket is approved, the system automatically runs the export task. When the task is complete, click Download Exported File on the ticket details page.
FAQ
Q: Why does DMS display only 3,000 rows of data after exporting?
A: The SQL console in DMS has a query and export limit of 3,000 rows. To export more data, use a SQL Result Set Export ticket.