Data Management (DMS) provides the SQLConsole for you to execute SQL statements with ease. You can use this feature to add, delete, modify, or query data in a database in a visualized manner when data query or development is involved.

Prerequisites

You have permissions to query the database or table that you want to query. For more information about how to apply for permissions, see Permission management.

GUI of the SQLConsole

SQLConsole
Table 1. GUI of the SQLConsole
No. Section Description
1 Visual operation section In this section, you can manage your database in a visualized manner.
  • Tables

    You can view all tables, fields, and indexes of the current database. You can also right-click a table in the database to modify table schema, import data, or export data.

  • Programmable objects
    You can create, view, execute, and manage programmable objects such as views, stored procedures, functions, triggers, and events.
    Note A maximum of 1,000 entries can be displayed.
  • Key-value pair information
    Note The key-value pair information can be displayed only for a NoSQL database.
2 Extended feature section In this section, shortcuts to extended features are provided. You can use these features by clicking the following icons:
  • Table List icon: the Table List icon. You can click the Table List icon icon to view tables in the current database. Then, click the Query icon icon to return to the SQLConsole tab.Table List
  • Data analysis icon: the data analysis icon. You can click the Data analysis icon icon to create a data analysis ticket. For more information, see Data analysis.
    Note The data analysis icon is displayed only for an ApsaraDB RDS for MySQL database.
  • DAS icon: the Database Autonomy Service (DAS) icon. You can click this icon to use the features of DAS, including quick diagnostics, real-time performance, instance session, and storage analysis. After you click this icon, you are navigated to the DAS console. For more information, see Real-time performance and View the session statistics of an ApsaraDB RDS for MySQL instance.
  • Sync Metadata icon: the Sync Metadata icon. After you click this icon, DMS collects the latest metadata information of the database, such as tables, fields, indexes, and programmable objects. This helps you manage permissions on tables, fields, and programmable objects based on different security levels. For more information, see Metadata.
  • Export icon: the export icon. You can click this icon to export the data of the database, table schemas of the database, or table creation statements. You can also click this icon to view the schema versions of this database. For more information about schema versions, see Manage schema versions.
  • Operation audit icon: the Operation audit icon. You can click this icon to view the information about all data query and data change records. For example, you can query the information about an operation, the operator, and the time when the operation is performed. For more information, see Operation audit.

    You can also click this icon to use the Risk Audit feature to collect and assess the risks that arise when the database is used. For more information, see Generate a risk audit report.

  • Share icon: the Share icon. You can click this icon to share the console and commands of the database with relevant staff. For more information, see Generate a share link for the SQLConsole tab of a database.
  • Super SQL Mode icon: the Super SQL Mode icon. You can click this icon to enable the super SQL mode feature. After you enable this feature as a DMS administrator or a database administrator (DBA), you can execute SQL statements on the SQLConsole tab without being constrained by security rules. For more information, see Super SQL mode.
3 Command running section In this section, you can write and execute SQL statements to manage the current database. You can also format SQL statements, create execution plans, save commonly used SQL statements, and configure display settings.
Note You can click the Add icon icon to add multiple query tabs.
4 Execution result section In this section, you can view the execution results after SQL statements are executed. You can also view the details about a single row and add, delete, or modify data.
Note You can click the Execution History tab to view the historical execution records. For example, you can view the time at which the execution of an SQL statement started, the affected database, and the details about the SQL statement. You can also export the execution results as required.

Procedure

  1. Log on to the DMS console V5.0.
    Note To switch to the previous version of the DMS console, click the 5租户头像 icon in the lower-right corner of the page. For more information, see Switch to the previous version of the DMS console.
  2. In the top navigation bar, click SQL Console. The SQL Console tab appears.
    Note If you are using the previous version of the DMS console, move the pointer over the More icon in the top navigation bar and choose SQLConsole > Single Database Query.
  3. In the Please select the database first dialog box, enter a keyword in the field to search for the database that you want to query, select the database, and then click Confirm.
  4. On the SQLConsole tab, enter the SQL statement to be executed and click Execute.

Usage notes

  • A table may contain sensitive or confidential fields. You do not have permissions to access these fields. Therefore, the values of these fields are displayed as ****** in the query results. For more information, see Manage sensitive data.
  • By default, a maximum of 200 data rows can be returned for each query. If you are a DMS administrator, you can change this value as needed. To change this value, perform the following steps: In the top navigation bar of the DMS console, click Security and Specifications. On the page that appears, click Security Rules in the left-side navigation pane.
    Note If you use the previous version of the DMS console, move the pointer over the More icon and choose System > Security > Security Rules.
  • A full scan can be performed on a table that does not exceed 10 GB in size. If you are a DMS administrator, you can change this value as needed. To change this value, perform the following steps: In the top navigation bar of the DMS console, click Security and Specifications. On the page that appears, click Security Rules in the left-side navigation pane.
  • By default, the timeout period to execute a single SQL statement is 60 seconds. If you are a DMS administrator, you can change this value as needed. To change this value, perform the following steps: Move the pointer over the More icon and choose Data Assets > Instances. On the Instance List tab, move the pointer over More in the Actions column of the database instance that you want to manage and select Edit. In the Edit dialog box, change the value in the Advanced Information section.