Data Management (DMS) Database Lab allows you to create different types of databases for free. This way, you can familiarize yourself with these database services.

Create a database

  1. Log on to the DMS Database Lab console.
    The left-side navigation pane displays various types of database instances that are supported.
  2. Double-click a database instance in which you want to create a database, such as a PolarDB for MySQL database.
  3. In the Create Database for Free dialog box, click Create Database for Free.
    Create a database for free

Go to the SQLConsole tab

After you create a database, you can go to the SQLConsole tab of the database to manage the database. You can use one of the following methods to go to the SQLConsole tab of the database:
  • Method 1: In the left-side navigation pane, click the database instance to which the database belongs and double-click the database.
  • Method 2: In the left-side navigation pane, right-click the database and select Single Database Query.
  • Method 3: In the top navigation bar, choose SQLConsole > Single Database Query. In the Please select the database first dialog box, enter a keyword to search for a database, select the database from the search results, and then click Confirm.

Query data

  1. Go to the SQLConsole tab.
    On the SQLConsole tab of a database, view all the tables in the database on the Table tab of the left-side navigation tree.
    Note After you create a database, DMS Database Lab creates sample tables and data in the database.
    List of tables
  2. Enter an SQL statement in the code editor and click Execute. After the SQL statement is executed, the query result set appears on a new tab below the code editor.
    Note When you enter an SQL statement, the code editor provides smart prompts and highlights.
    SQL query
  3. Optional:On the query result tab, enter a keyword to search for data in the query result set.
    Filter SQL query results
  4. Optional:On the query result tab, move the pointer over Export File in the upper-left corner and select an option to export data based on your requirements.
    Export SQL query result set

For more information, see Overview.

Manage data

You can execute SQL statements on the SQLConsole tab to manage data. For example, you can insert, delete, and modify data.

Alternatively, you can manage data in query result sets. After an SQL statement is executed, the query result set appears on a new tab below the code editor. On the query result tab, click Enable editing in the upper-left corner.
  • Modify data: Click a field, modify the content of the field, and then click Submit Change.
  • Insert data: Click Create, enter values in the new row, and then click Submit Change. Add a data row
    Note The red triangle in a row indicates that the row is newly added or modified.
Click Cancel editing.

Manage tables

You can execute SQL statements on the SQLConsole tab to manage tables. For example, you can create, modify, and delete tables.

Alternatively, you can manage tables by using the GUI. Go to the SQLConsole tab of a database, right-click a table in the left-side navigation tree, and then select Edit Table Structure. On the Change Table tab, you can modify the basic information about the table and modify the fields, indexes, and foreign keys of the table. Manage tables

Import and export data

DMS Database Lab allows you to import and export data or schemas. Go to the SQLConsole tab of a database. In the left-side navigation tree, right-click a table and choose Export > Export The Table. You can export the data in the table, the schema of the table, or both the data and schema of the table.
Note The following figure shows you how to export a table. For more information, see Import data and Export data.
Export a table

Manage sensitive fields

A table may contain sensitive fields whose values are expected to be private. DMS Database Lab allows you to mask the data in the sensitive fields. Go to the SQLConsole tab of a database. In the left-side navigation tree, right-click a table and select Adjust Security Level. In the Adjust Security Level dialog box, adjust the security levels of the fields in the table. Adjust security levels
For example, you can set the security level of the grade field in the students table to Confidential. Then, click Submit for Security Department Approval. In the Confirm Change message, click OK. Then, query data in the students table. In the query result set, the values in the grade field are masked. For more information about how to configure sensitive fields, see Adjust field security levels.

Go to the Cmd tab

Apart from the SQLConsole tab and the GUI, DMS Database Lab also provides the Cmd tab for you to manage tables and data. Go to the SQLConsole tab of a database. In the left-side navigation tree, right-click a table and select Cmd Tab. Cmd tab

Manage frequently used SQL statements

In DMS Database Lab, you can manage frequently used SQL statements. On the SQLConsole tab of a database, click Common SQL to add, modify, remove, or insert frequently used SQL statements. Frequently used SQL statements

Query data across databases

DMS Database Lab provides the cross-database query feature. This feature allows you to use SQL statements to perform SQL join queries across different types of databases.

  1. Go to the SQLConsole tab of a database and click Cross-database Query in the upper part of the tab.
    Query data across databases

    Alternatively, you can choose SQLConsole > Cross-database Query in the top navigation bar.

  2. On the Cross-database Query tab, view the database links of your databases in the left-side navigation pane. Each database link is associated with a database instance.
    Details page of cross-database query
  3. In the SQL statement, use a database link to represent the database instance that you want to query.
    For example, you want to query the data in the courses table in the dms_polardb_mysql database of a PolarDB for MySQL instance. You can use PolarDB_MySQL_DBLink to represent the PolarDB for MySQL instance, as shown in the following figure.
  4. Execute the SQL statement to perform a join query across different types of databases.
    For example, you can query the data in databases of a PolarDB for MySQL instance and an ApsaraDB RDS for SQL Server instance, as shown in the following figure.

Export all the data in a database

DMS Database Lab allows you to export all the data in a database. In the top navigation bar, choose Data Plans > Export > Database Export. Export all the data in a database
Alternatively, you can go to the SQLConsole tab of the database that contains the data that you want to export. On the SQLConsole tab, move the pointer over the daochu icon in the upper-right corner and select Export the DB. Export the DB

Generate test data

DMS Database Lab allows you to generate test data for tables.

  1. Go to the SQLConsole tab of a database. In the left-side navigation tree, right-click the table for which you want to generate test data and choose Data Plans > Test Data Generation.
    Test Data Generation

    Alternatively, you can choose Data Plans > Test Data Generation in the top navigation bar.

  2. In the Test data build dialog box, set the parameters and click Submit.

For more information, see Generate test data.

Orchestrate and schedule tasks

DMS Database Lab provides the task orchestration feature. This feature allows you to orchestrate and schedule a variety of tasks.

  1. Go to the SQLConsole tab of a database and click Task Orchestration.
    Task orchestration

    Alternatively, you can choose Data Factory > Task Orchestration in the top navigation bar.

  2. In the New Task dialog box, set the Task Flow Name and Task Name parameters and click OK.
  3. Orchestrate and schedule tasks.

For more information about task orchestration, see Overview.

Use the data visualization feature

DMS Database Lab provides the data visualization feature. This feature provides a visualization module that helps you gain insights into your business and make better business decisions.

  1. Go to the SQLConsole tab of a database and click Data Visualization.

    Alternatively, you can choose Data Factory > Data Visualization in the top navigation bar.

  2. Edit datasets on the Data Visualization tab.

For more information about the data visualization feature, see Overview.

Change schemas

DMS Database Lab provides the schema design feature. This feature allows you to change the schema of a table to make the table in compliance with specific R&D standards.

  1. Go to the SQLConsole tab of a database. In the left-side navigation tree, right-click the table of which you want to change the schema and click Schema Design.

    Alternatively, you can choose Schema > Schema Design in the top navigation bar.

  2. On the schema design tab, change the schema of the table.

For more information about the schema design feature, see Design schemas.

Connect to a database by using an application or by running command lines

You can use an application or run command lines to connect to a database of a database instance that runs MySQL in DMS Database Lab. In the left-side navigation pane, right-click the database instance to which you want to connect and select Activate application access. In the message that appears, you can view the endpoint of the database instance and the account and password that you can use to connect to the database.

Seek help

If you have questions or suggestions about DMS Database Lab, contact technical support by using one of the following methods:

  • submit a ticket.
  • Search for and join the DingTalk group numbered 21991247.