Help Center/ Relational Database Service/ FAQs/ Database Usage/ How Do I Use DAS to Query SQL Statements?
Updated on 2024-05-13 GMT+08:00

How Do I Use DAS to Query SQL Statements?

DAS is a professional database management tool with a visual interface. You can enable SQL Explorer to query related SQL statements.

Constraints

SQL Explorer cannot record all data. As for RDS for MySQL, it has the following constraints:

  • Some data cannot be recorded if a buffer overrun occurs.
  • Any SQL statement that exceeds 4,096 bytes is discarded by default.

    This constraint can be removed by setting parameter rds_sql_tracer_reserve_big_records for RDS for MySQL 5.7.33.3 or later. You can set this parameter to ON on the Parameters page, indicating that SQL statements containing more than 4,096 bytes are still recorded.

Procedure

  1. Log in to the management console.
  2. Click in the upper left corner and select a region and a project.
  3. Click in the upper left corner of the page and choose Databases > Relational Database Service.
  4. On the Instances page, locate the DB instance and click Log In in the Operation column.
  5. On the displayed login page, enter the correct username and password and click Log In.
  6. In the navigation pane, choose Cloud DBA (Intelligent O&M) to go to the Instance Overview page.
  7. Locate the instance you want to view and click Details.
  8. Choose SQL > SQL Explorer to view full SQL details of the instance.
  9. On the SQL Statements tab page, click Enable DAS SQL Explorer. Query the SQL statements executed by the current instance by time range, user, keyword, operation type, or database.

    Figure 1 Enabling SQL Explorer

  10. Filter operation types by referring to Table 1 and click Export to export the corresponding SQL statements.

    Table 1 Common SQL statement types

    Type

    Keyword

    DDL

    CREATE, DROP, ALTER

    DML

    INSERT, UPDATE, DELETE, SELECT

    DCL

    GRANT, REVOKE

    A maximum of 10,000 SQL statements can be displayed. If you need to view more, click Export.

    Up to 100,000 records can be exported.