Database Management
Overview
You can go to the Database Management page using either of the following methods:
- In the database list of the Home page, locate the target database and click Manage in the Operation column.
- Select Database Management on the top menu bar.
| No. | Description |
|---|---|
| 1 | Displays the name of the current database. |
| 2 | Allows you to switch between system and non-system databases. |
| 3 | Displays the IP address, port number, and character set of the current DB instance. |
| 4 | Allows you to open the SQL window of the current database. |
| 5 | Periodically collects metadata such as databases, tables, and fields of the DB instance and stores the data to the databases of DAS. Advantages:
Note: Only structural metadata is collected, which means that user's table data is not included. |
| 6 | Database management consists of three functional modules: objects, SQL tuning, and metadata collection. |
| 7 | Allows you to perform operations. |
Objects
You can manage tables, views, stored procedures, events, triggers, and functions of databases. The main operations include creating, querying, and modifying objects.
SQL Tuning
SQL tuning helps you query the SQL statements that are executed frequently, consume a large amount of resources, or take a long time to execute. Therefore, you can optimize operations according to the diagnosis results.
- On the Database Management page, click the SQL Tuning tab. You can search for SQL tuning history by date to view details or you can add or delete SQL tuning records. Figure 2 SQL Tuning
- Click Add SQL Performance Tuning. In the displayed dialog box, set Task Type to SQL statement or SQL file. Then, edit the SQL statements under SQL Statement and click OK. Figure 3 Adding a SQL performance tuning task
- The following types of statements will be changed to the SELECT statements for tuning:
SELECT ... FOR UPDATE, UPDATE ... SET ... WHERE ..., DELETE FROM ... WHERE ..., INSERT INTO ... SELECT ...
- Apart from the statements mentioned above, other statements cannot be changed to SELECT statements for tuning. The tuning task that contains unsupported SQL syntax will fail.
- The following shows the unsupported syntaxes:
- alter table t add index idx_name(name);
- show databases;
- grant SELECT,PROCESS on d.t to 'am'@'%' with grant option;
- insert into t(i, v) values (1, 'a').
- Only the diagnosis of the SELECT/INSERT/UPDATE/DELETE statements is supported. An INSERT statement must contain a SELECT clause.
- Querying stored SQL statements such as information_schema, test, mysql, is not supported.
- View statements are not supported.
- The following types of statements will be changed to the SELECT statements for tuning:
- In the SQL tuning list, locate the target task and click View Details in the Operation column. Figure 4 Viewing task details
Figure 5 Task details
You can view the tuning details at the bottom of the task list.
Figure 6 Tuning details
Metadata Collection
DAS periodically collects DB instance metadata of databases, tables, and fields and stores the collected data in the DAS database. In addition, only structural metadata is collected, and the data in your table is not included to protect your data privacy.
- Reduces queries on user databases and the impact on the user database performance.
- Improves the search performance for DB instances that contain a large number of tables and supports pagination queries.
- On the Database Management page, click the Metadata Collection tab and enable Auto Metadata Collection. Figure 7 Metadata Collection
- Click Collect Now to start the collection. You can also stop the collection or view collection details by clicking corresponding buttons in the Operation column. Figure 8 Collect Now
- Clear Collected Data: Clears the collected metadata, database structure, and table structure.
- Delete Logs: Deletes logs. Deleted logs cannot be restored. Exercise caution when performing this operation.
Last Article: SQL History
Next Article: Table Management
Did this article solve your problem?
Thank you for your score!Your feedback would help us improve the website.