You can embed a watermark in a file that is exported from Data Management (DMS) or extract a watermark from an external file based on your business requirements. This topic describes how to embed watermarks in and extract watermarks from files.
Prerequisites
The sensitive data protection feature is enabled for the database instance for which you want to use data watermarks. For more information, see Enable the sensitive data protection feature.
Scenarios
Data watermarks can be used to trace data during the spread and distribution of data.
Usage notes
We recommend that you use data watermarks when you export more than 200 data entries.
When you use the watermark extraction feature, make sure that your file contains more than 200 data entries. Otherwise, the watermarks may fail to be extracted.
Embed watermarks
Identification information is embedded into data or a file as a watermark to identify the data or file.
Configure watermarks before you create a ticket for exporting result sets
To use data watermarks, you need to go to the Configuration Management page (global configurations) and enable file watermarks. Then, all tickets that are executed by users within the same tenant for exporting SQL result sets automatically include a watermark. The watermark consists of the username and the export time. By default, the exported result sets are Excel files.
Step 1: Enable file watermarks on the Configuration Management page
- Log on to the DMS console V5.0.
In the top navigation bar, click O&M. In the left-side navigation pane, click Configuration Management.
NoteIf you use the DMS console in simple mode, move the pointer over the icon in the upper-left corner of the DMS console and choose All functions > O&M > Configuration Management.
Enter a keyword in the search box and click the search icon.
Find the Watermark for Exported SQL Result Sets parameter, and click Change in the Actions column. In the Change Parameter Configuration dialog box, enter Y in the Value field. Then, click Confirm Change.
Step 2: Create a ticket for exporting SQL result sets
For more information, see the Configure watermarks when you create a ticket for exporting result sets section of this topic.
After you enable file watermarks on the Configuration Management page, the Embed Watermark parameter is not displayed when you create a ticket for exporting SQL result sets.
Configure watermarks when you create a ticket for exporting result sets
- Log on to the DMS console V5.0.
In the top navigation bar, choose .
On the SQL Result Set Export tab, configure the parameters that are described in the following table.
Parameter
Description
Database Name
Required. The database from which you want to export an SQL result set.
NoteYou must have the permissions to export SQL result sets from the database. For more information, see View owned permissions.
Reason Category
Required. The reason for exporting an SQL result set. This parameter helps find the ticket in subsequent operations.
Business Background
Required. The purpose or objective of this export. You can specify this parameter to reduce unnecessary communication.
Affected Rows
Required. The estimated number of data rows to be affected by this export. To obtain the actual number of affected rows, you can use the
COUNT
function on the SQL statements on the SQLConsole tab.NoteIn the Precheck step, DMS displays the actual number of affected rows. You can check whether the number of affected rows is as expected. This ensures data security.
Skip Validation
Optional. This parameter specifies whether to skip validation. If you select Skip Validation, you must specify the reason to skip validation.
WarningAfter you select Skip Validation, DMS does not check the number of rows that may be affected by this export. If a large amount of data is to be exported, your business may be affected. Proceed with caution.
Stakeholder
Optional. The stakeholders involved in this export. All the specified stakeholders can view the ticket details and participate in the approval process. Irrelevant users, except for DMS administrators and database administrators (DBAs), have no access to the ticket details.
Export Statement
Required. The SQL statements that can be executed. Example:
SELECT * FROM testtable
. DMS verifies the syntax of the SQL statements when you submit the ticket. The ticket can be submitted only if its syntax is valid.NoteOnly
SELECT
statements are supported.Embed Watermark
Required. Specifies whether to embed a watermark into the exported file. In this example, Yes is selected.
Embedding Method
Required. The method in which a watermark is embedded in the exported file. Valid values:
Data Watermark: The identification information is embedded into data in a way that makes the watermark imperceptible to data users.
File Watermark: The identification information is embedded into the exported file in a way that makes the watermark visible to data users.
Data Watermark Message or File Watermark Message
Required. The identification information to be embedded as a watermark.
Embedded Field
Optional. The field into which the watermark is embedded.
NoteIf you do not specify a field, DMS selects a field by default.
Primary key / Unique Key
Optional. One or more primary keys or unique keys. Separate multiple keys with commas (,).
NoteTo improve the robustness of the watermark, we recommend that you specify this parameter.
Attachments
Optional. The images or files that are uploaded to add more information about this export.
Click Submit.
DMS prechecks the SQL statements. Wait until the precheck is complete.
Click Submit for Approval and wait for approval.
On the Ticket Details page, you can view the approval progress in the Approval step.
ImportantYou must export an SQL result set within 24 hours after the ticket is approved. Otherwise, you cannot export the SQL result set. In this case, you must create another SQL Result Set Export ticket.
In the Execute/Automatic Execution step, click Export.
In the Export Settings dialog box, configure the parameters that are described in the following table.
Parameter
Description
Format
Required. The format of the file to be exported. Valid values: CSV, EXCEL, SQL, and JSON. The JSON format is available only for NoSQL databases.
NoteIf you set the Embed Watermark parameter to Yes, set this parameter to EXCEL.
Character Set
Required. The character set of the file to be exported. Valid values: Default Character Set, GBK, UTF-8, and ISO-8859-1.
Execution Strategy
Required. The strategy used to export the file. Valid values:
Running immediately: DMS immediately exports the file after you click Confirm Execution.
Schedule: DMS exports the file at the point in time that you specify. You can specify a point in time during off-peak hours.
NoteThe configurations cannot be modified after you set this parameter to Schedule and confirm the configurations.
Export Mode
Required. The export mode of the file. Valid values:
Speed Mode: If you select this mode, the export task cannot be terminated before it is complete.
Ordinary Mode: If you select this mode, the export task can be terminated during the export.
NoteDMS exports the file based on your configurations. You can check the export progress in the Execute/Automatic Execution step.
After the file is exported, click Download Exported File to download the file to your local devices.
Extract watermarks
DMS provides the watermark extraction feature that allows you to check whether files are embedded with unperceivable watermarks.
- Log on to the DMS console V5.0.
In the top navigation bar, choose .
In the upper-right corner of the Data Watermark tab, click Data Watermark. On the Data Watermark Tickets page, configure the parameters that are described in the following table.
Parameter
Description
File Type
Required. The type of the file from which you want to extract a watermark. Valid values:
CSV
EXCEL
File
Required. Click File to upload the file from which you want to extract the watermark.
NoteOnly XLSX and CSV files are supported.
Business Background
Required. The purpose of this extraction. This parameter helps reduce unnecessary communication.
Database Name
Optional. The database from which the uploaded file is exported.
Primary key / Unique Key
Optional. One or more primary keys or unique keys. Separate multiple keys with commas (,).
NoteYou must specify the same primary or unique keys that you specified when you embedded the watermark to ensure the accuracy of watermark extraction.
Embedded Field
Optional. The field into which the watermark is embedded.
Click Submit.
After the ticket is approved, click Execute in the Execute/Automatic Execution step.
After the execution is complete, you can view the extraction status and the details of the extracted watermark.