You can execute various types of SQL statements on the SQL Console page of the Data Management (DMS) console. On this page, you can also add, remove, modify, and query data in a database instance in a visualized manner. The SQL Console page is designed for scenarios such as data query and data development.

Prerequisites

You are granted the query permissions on the database or table that you want to query. For more information about how to apply for the permissions, see Overview.

GUI of the SQL Console page

SQLchuangkou
Table 1. GUI of the SQL Console page
No. Section Description
1 Visual operation section In this section, you can manage your database instance in a visualized manner.
  • Table

    You can view information of all tables in the current database instance. The information includes columns, column types, and indexes. You can also right-click a table to perform operations on the table. You can modify the table schema, manage the table, import data, export data, or perform operations on multiple tables at a time.

  • Programmable Object
    You can create, view, execute, and manage programmable objects such as views, stored procedures, functions, triggers, and events.
    Note Up to 1,000 entries can be displayed.
  • Key-value pair information
    Note The key-value pair information is displayed only for NoSQL database instances.
2 Extended feature section This section provides the following icons:
  • Table List icon: the Table List icon. You can click the icon to view tables in the current database instance on the Table List page. Then, you can click the Query icon icon to return to the SQLConsole tab.
  • Data Analysis icon: the Data Analysis icon. You can click the 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 instance.
  • shujukufenxi: the Database Autonomy Service (DAS) icon. You can select options from the shortcut menu of this icon to use the features of DAS, including one-click diagnosis, real-time performance monitoring, instance session management, and spatial analysis. After you select an option, you are redirected to the DAS console. For more information, see Real-time monitoring and Session management.
  • 安全访问代理: the Secure Access Proxy icon. You can click the icon to enable the secure access proxy feature. This feature helps ensure comprehensive data security when you access databases. For more information, see Enable the secure access proxy feature.
  • Export icon: the Export icon. You can select an option from the shortcut menu of this icon to export the data of the database instance, table schemas in the database instance, or table creation statements. You can also select the Version management option to view the schema versions of the database instance. For more information about schema versions, see Manage schema versions.
  • Operation Audit icon: the Operation Audit icon. You can select options from the shortcut menu of this icon to view the information about all data query and data change records. For example, you can query the information about an operation, such as the SQL type, the operator, and the time when the operation is performed. For more information, see Audit operations.

    You can also select the corresponding option to use the risk audit feature. This feature helps you collect and assess the risks that arise when the database instance is used. For more information, see Generate a risk audit report.

  • Share icon: the Share icon. You can click this icon to share the SQLConsole tab and statements of the database instance with relevant stakeholders. For more information, see Share the SQLConsole tab.
3 Statement execution section In this section, you can write and execute SQL statements to manage the current database instance. You can also format SQL statements, create execution plans, save frequently used SQL statements, and configure display settings.
Note You can click the Add icon icon in the upper-right corner of the section to add multiple SQLConsole 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, remove, 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 an SQL statement starts to execute, the affected database instance, 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.
  2. In the top navigation bar, choose SQL Console > SQL Console.
  3. In the Please select the database first dialog box, enter a keyword to search for the database that you want to manage, select the database from the search results, and then click Confirm.
  4. On the SQLConsole tab, enter the SQL statements that you want to execute and click Execute.

Usage notes

  • A table may contain sensitive or confidential fields, and you may not have permissions to access these fields. In this case, the values of these fields are displayed as ****** in the query results. For more information, see Manage sensitive data.
  • By default, up to 200 rows of data can be returned for each query. If you are a DMS administrator, you can change this value as required. To go to the page on which you can change this value, perform the following steps: In the top navigation bar of the DMS console, move the pointer over Security and Specifications and click Security Rules.
  • By default, 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 required. To go to the page on which you can change this value, perform the following steps: In the top navigation bar of the DMS console, move the pointer over Security and Specifications and click Security Rules.
  • By default, the timeout period for executing a single SQL statement is 60 seconds. If you are a DMS administrator, you can change this value as required. To change this value, perform the following steps: In the top navigation bar, move the pointer over Data Assets and click Instances. On the Instance List tab, find the database instance that you want to manage, move the pointer over More in the Actions column, and then select Edit. In the Edit dialog box, change the query timeout(s) parameter in the Advanced Information section.