This topic shows you how to export a schema, a SQL result set, and an entire database.
Prerequisites
The Whether the result set supports export security rule must be enabled for the database. This rule is enabled by default. For more information, see SQL Console for relational databases.
You must have the required permissions to query and export data from the target database. For more information, see Manage access control permissions.
Export a schema
Log in to DMS 5.0.
-
In the Database Instances section on the left, find the database.
-
Double-click the database name to open the SQLConsole tab.
Right-click the target table and choose .
NoteYou can also click the
icon in the upper-right corner and choose All Schemas in Database.On the Export Schema page, export the schema as a data dictionary.
You can export the document in Word, Excel, or PDF format.
Export a SQL result set
You cannot export result sets from a NoSQL database.
Log in to DMS 5.0.
-
In the Database Instances section on the left, find the database.
-
Double-click the database name to open the SQLConsole tab.
In the Execution Result section, choose .
Configure the following parameters and click Confirm.
Parameter
Description
Reason Category
Select a reason for the export to facilitate future tracking.
Business Background
Describe the business purpose of the export to improve communication.
Stakeholder
Only specified stakeholders, administrators, and DBAs can view the ticket.
Export SQL statement
Enter the SQL statement for the data export.
Embed Watermark
Specify whether to embed a watermark in the exported file. For more information, see Embed watermarks.
data watermark: Embeds identification information into the data. The watermark is not easily perceptible to data users.
NoteWe recommend using a data watermark when you export more than 200 rows of data.
To use a data watermark, you must enable Sensitive Data Protection on the database instance.
file watermark: Embeds visible identification information into the file.
In the Ticket Submitted Successfully dialog box, click View Ticket.
On the ticket details page, confirm the number of affected rows in the Precheck section, and then click Submit for Approval.
After the ticket is approved, the system automatically starts the export task. After the task is complete, click Execute Export at the bottom of the ticket details page. Select a file type and a Character Set, and then click Confirm Execution.
Click Download Exported File to save the file to your local device.
When you export data to a CSV file, date fields may be displayed as serial numbers or garbled characters. This occurs because CSV files do not contain formatting information, and Excel opens them in the General format by default, which does not correctly interpret date values. To resolve this issue, select the column, right-click, choose Format Cells, and then select the Date category.
Export an entire database
You can export an entire database, including its schema, data, and structures such as stored procedures, functions, triggers, views, and events.
Log in to DMS 5.0.
-
In the Database Instances section on the left, find the database.
-
Double-click the database name to open the SQLConsole tab.
Right-click any table in the database and choose .
NoteYou can also click the
icon in the upper-right corner and choose Export this Database.Configure the parameters for the database export. The following table describes the parameters.
Parameter
Description
Tables to export
Specify whether to export Partial tables or All tables.
If you choose to export only some tables, you need to select the tables that you want to export on the right.
Reason Category
Select a reason for the export to facilitate future tracking.
Business Background
Describe the business purpose of the export to improve communication.
Stakeholder
Only specified stakeholders, administrators, and DBAs can view the ticket.
Content to export
Select the content to export. You can export Data, Schema, or Data and Schema.
Structure types to export
Select the structure types to export. Supported types include stored procedure, function, trigger, view, and event.
NoteThe available options depend on the database type and are shown in the console.
After you configure the parameters, click Submit Application.
NoteAfter you submit the ticket, you are sent to the ticket details page. On this page, you can view the Basic Information of the ticket and its approval status.
After the ticket is approved, the system automatically starts the export task. When the task is complete, click Download Exported File at the bottom of the ticket details page.
FAQ
Q: Why are only 3,000 rows displayed after exporting data from DMS?
A: The SQL window in DMS limits queries and exports to 3,000 rows. To export more data, use an SQL result set export ticket.