user guide...user. {{]}]} {}]}

234
Data Admin Service User Guide Issue 01 Date 2020-09-27 HUAWEI TECHNOLOGIES CO., LTD.

Upload: others

Post on 27-Nov-2020

157 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: User Guide...User. {{]}]} {}]}

Data Admin Service

User Guide

Issue 01

Date 2020-09-27

HUAWEI TECHNOLOGIES CO., LTD.

Page 2: User Guide...User. {{]}]} {}]}

Copyright © Huawei Technologies Co., Ltd. 2020. All rights reserved.

No part of this document may be reproduced or transmitted in any form or by any means without priorwritten consent of Huawei Technologies Co., Ltd. Trademarks and Permissions

and other Huawei trademarks are trademarks of Huawei Technologies Co., Ltd.All other trademarks and trade names mentioned in this document are the property of their respectiveholders. NoticeThe purchased products, services and features are stipulated by the contract made between Huawei andthe customer. All or part of the products, services and features described in this document may not bewithin the purchase scope or the usage scope. Unless otherwise specified in the contract, all statements,information, and recommendations in this document are provided "AS IS" without warranties, guaranteesor representations of any kind, either express or implied.

The information in this document is subject to change without notice. Every effort has been made in thepreparation of this document to ensure accuracy of the contents, but all statements, information, andrecommendations in this document do not constitute a warranty of any kind, express or implied.

Issue 01 (2020-09-27) Copyright © Huawei Technologies Co., Ltd. i

Page 3: User Guide...User. {{]}]} {}]}

Contents

1 Overview....................................................................................................................................1

2 Permissions Management..................................................................................................... 22.1 Creating a User and Granting Permissions.....................................................................................................................22.2 DAS Custom Policies...............................................................................................................................................................4

3 Console.......................................................................................................................................63.1 DAS Console.............................................................................................................................................................................. 63.2 Adding Login Information.................................................................................................................................................... 93.3 Logging In to a Database (Using DAS)......................................................................................................................... 113.4 Logging In to a Database Using RDS.............................................................................................................................113.5 Logging In to a Database Using DDS............................................................................................................................ 123.6 Modifying Login Information............................................................................................................................................133.7 Deleting Login Information............................................................................................................................................... 143.8 CloudDBA.................................................................................................................................................................................153.8.1 Overview...............................................................................................................................................................................153.8.2 Performance........................................................................................................................................................................ 183.8.2.1 Real-Time Diagnosis......................................................................................................................................................183.8.2.2 Real-Time Performance................................................................................................................................................193.8.2.3 Performance History..................................................................................................................................................... 213.8.2.4 Performance Trends Comparisons............................................................................................................................233.8.2.5 Custom Graphs............................................................................................................................................................... 233.8.3 Sessions................................................................................................................................................................................. 243.8.3.1 Real-Time Sessions........................................................................................................................................................ 253.8.3.2 Emergency Channel.......................................................................................................................................................253.8.4 SQL......................................................................................................................................................................................... 263.8.4.1 Slow Query Logs............................................................................................................................................................ 263.8.4.2 SQL Explorer.................................................................................................................................................................... 273.8.4.3 SQL Diagnosis................................................................................................................................................................. 283.8.5 Space......................................................................................................................................................................................303.8.5.1 Instance Space................................................................................................................................................................ 303.8.5.2 Database Space.............................................................................................................................................................. 313.8.6 Binlog..................................................................................................................................................................................... 333.8.7 Parameters........................................................................................................................................................................... 34

Data Admin ServiceUser Guide Contents

Issue 01 (2020-09-27) Copyright © Huawei Technologies Co., Ltd. ii

Page 4: User Guide...User. {{]}]} {}]}

3.8.8 Daily Reports....................................................................................................................................................................... 353.8.9 Security................................................................................................................................................................................. 36

4 MySQL DB Instance Management (Standard Edition).................................................374.1 Overview.................................................................................................................................................................................. 374.1.1 Feature Overview.............................................................................................................................................................. 374.1.2 Database Management................................................................................................................................................... 384.1.3 Metadata Collection......................................................................................................................................................... 424.1.4 SQL Query............................................................................................................................................................................ 434.1.5 Table Creation.....................................................................................................................................................................444.2 Table Management.............................................................................................................................................................. 464.2.1 Creating a Table................................................................................................................................................................. 474.2.2 Opening a Table.................................................................................................................................................................494.2.3 Viewing Table Details.......................................................................................................................................................514.2.4 Altering a Table.................................................................................................................................................................. 524.2.5 Renaming a Table..............................................................................................................................................................534.2.6 Clearing a Table................................................................................................................................................................. 534.2.7 Dropping a Table............................................................................................................................................................... 544.2.8 Maintaining a Table..........................................................................................................................................................544.3 View Management............................................................................................................................................................... 564.3.1 Creating a View.................................................................................................................................................................. 564.3.2 Opening a View..................................................................................................................................................................574.3.3 Altering a View................................................................................................................................................................... 584.3.4 Dropping a View................................................................................................................................................................ 594.4 Event Management.............................................................................................................................................................. 594.4.1 Creating an Event.............................................................................................................................................................. 604.4.2 Altering an Event............................................................................................................................................................... 614.4.3 Dropping an Event............................................................................................................................................................ 624.5 Stored Procedure Management....................................................................................................................................... 634.5.1 Creating a Stored Procedure..........................................................................................................................................634.5.2 Altering or Executing a Stored Procedure................................................................................................................. 644.5.3 Dropping a Stored Procedure........................................................................................................................................ 654.6 Function Management........................................................................................................................................................664.6.1 Creating a Function.......................................................................................................................................................... 664.6.2 Altering or Executing a Function................................................................................................................................. 674.6.3 Dropping a Function.........................................................................................................................................................684.7 Trigger Management........................................................................................................................................................... 694.7.1 Creating a Database Trigger.......................................................................................................................................... 694.7.2 Altering a Trigger...............................................................................................................................................................704.7.3 Dropping a Trigger............................................................................................................................................................ 714.8 SQL Operations......................................................................................................................................................................714.8.1 SQL Window........................................................................................................................................................................714.8.2 SQL History.......................................................................................................................................................................... 73

Data Admin ServiceUser Guide Contents

Issue 01 (2020-09-27) Copyright © Huawei Technologies Co., Ltd. iii

Page 5: User Guide...User. {{]}]} {}]}

4.8.3 SQL Execution..................................................................................................................................................................... 734.8.4 SQL Tuning.......................................................................................................................................................................... 754.8.5 SQL Plan Execution........................................................................................................................................................... 774.8.6 SQL Favorites...................................................................................................................................................................... 784.9 Import and Export................................................................................................................................................................ 794.9.1 Data Import......................................................................................................................................................................... 794.9.2 Data Export..........................................................................................................................................................................804.10 Structure Management.................................................................................................................................................... 834.10.1 Table Structure Comparison and Synchronization.............................................................................................. 834.11 Data Plan...............................................................................................................................................................................844.11.1 Data Generator................................................................................................................................................................ 844.11.2 Data Tracking................................................................................................................................................................... 874.12 CloudDBA.............................................................................................................................................................................. 904.12.1 Real-Time Performance.................................................................................................................................................904.12.2 Real-Time Sessions......................................................................................................................................................... 934.12.3 Performance History...................................................................................................................................................... 944.12.4 Daily Health Report & One-Click Diagnosis.......................................................................................................... 954.12.5 Slow Query Logs............................................................................................................................................................. 974.12.6 Emergency Channel........................................................................................................................................................984.12.7 Memory Parameter Setting Diagnosis.................................................................................................................. 1004.12.8 SQL Tuning......................................................................................................................................................................1014.12.9 Tuning Report................................................................................................................................................................ 1034.12.10 InnoDB Lock Query....................................................................................................................................................1054.12.11 Binlog Query................................................................................................................................................................ 1074.13 User Management........................................................................................................................................................... 1084.13.1 Creating a User..............................................................................................................................................................1084.13.2 Editing User Information............................................................................................................................................1094.13.3 Deleting a User..............................................................................................................................................................1104.14 Task Scheduling................................................................................................................................................................ 111

5 Microsoft SQL Server DB Instance Management (Standard Edition).................... 1145.1 Overview................................................................................................................................................................................1145.1.1 Feature Overview............................................................................................................................................................ 1145.1.2 Database Management................................................................................................................................................ 1155.1.3 SQL Window..................................................................................................................................................................... 1165.1.4 Table Creation.................................................................................................................................................................. 1165.2 Table Management............................................................................................................................................................ 1175.2.1 Creating a Table.............................................................................................................................................................. 1175.2.2 Opening a Table.............................................................................................................................................................. 1185.2.3 Viewing Table Details.................................................................................................................................................... 1195.2.4 Altering a Table............................................................................................................................................................... 1195.2.5 Renaming a Table........................................................................................................................................................... 1195.2.6 Clearing a Table............................................................................................................................................................... 120

Data Admin ServiceUser Guide Contents

Issue 01 (2020-09-27) Copyright © Huawei Technologies Co., Ltd. iv

Page 6: User Guide...User. {{]}]} {}]}

5.2.7 Dropping a Table............................................................................................................................................................. 1205.3 View Management............................................................................................................................................................. 1205.3.1 Creating a View............................................................................................................................................................... 1215.3.2 Dropping a View.............................................................................................................................................................. 1215.3.3 Opening a View............................................................................................................................................................... 1215.3.4 Altering a View................................................................................................................................................................ 1225.4 Stored Procedure Management.....................................................................................................................................1225.4.1 Creating a Stored Procedure....................................................................................................................................... 1235.4.2 Altering or Executing a Stored Procedure.............................................................................................................. 1235.4.3 Dropping a Stored Procedure......................................................................................................................................1245.4.4 Viewing Stored Procedure Details............................................................................................................................. 1245.5 Trigger Management.........................................................................................................................................................1245.5.1 Creating a Trigger........................................................................................................................................................... 1245.5.2 Altering a Trigger............................................................................................................................................................ 1255.5.3 Dropping a Trigger..........................................................................................................................................................1255.6 Function Management..................................................................................................................................................... 1255.6.1 Creating a Function........................................................................................................................................................ 1255.6.2 Altering or Executing a Function............................................................................................................................... 1265.6.3 Dropping a Function...................................................................................................................................................... 1265.6.4 Viewing Function Details..............................................................................................................................................1275.7 SQL Operations................................................................................................................................................................... 1275.7.1 SQL Window..................................................................................................................................................................... 1275.7.2 SQL History....................................................................................................................................................................... 1285.8 Import and Export.............................................................................................................................................................. 1285.8.1 Data Import...................................................................................................................................................................... 1285.8.2 Data Export....................................................................................................................................................................... 1295.9 CloudDBA.............................................................................................................................................................................. 1305.9.1 Real-Time Sessions......................................................................................................................................................... 1305.10 Other Operations............................................................................................................................................................. 1305.10.1 Login Name.................................................................................................................................................................... 1305.10.2 Database User Management....................................................................................................................................1315.10.3 Database Role Management.................................................................................................................................... 131

6 DDS DB Instance Management (Standard Edition)....................................................1336.1 Home Page........................................................................................................................................................................... 1336.1.1 Overview............................................................................................................................................................................ 1336.1.2 Creating a Database...................................................................................................................................................... 1346.1.3 Database Management................................................................................................................................................ 1346.1.4 Command Window.........................................................................................................................................................1356.1.5 Dropping a Database..................................................................................................................................................... 1366.2 Command Operation........................................................................................................................................................ 1366.2.1 Command Window.........................................................................................................................................................1366.2.2 Command History........................................................................................................................................................... 138

Data Admin ServiceUser Guide Contents

Issue 01 (2020-09-27) Copyright © Huawei Technologies Co., Ltd. v

Page 7: User Guide...User. {{]}]} {}]}

6.3 Collection Management................................................................................................................................................... 1386.3.1 Creating a Collection..................................................................................................................................................... 1386.3.2 Opening a Collection..................................................................................................................................................... 1396.3.3 Altering Validator............................................................................................................................................................1416.3.4 Renaming a Collection.................................................................................................................................................. 1426.3.5 Clearing a Collection...................................................................................................................................................... 1426.3.6 Dropping a Collection.................................................................................................................................................... 1436.4 View Management............................................................................................................................................................. 1436.4.1 Creating a View............................................................................................................................................................... 1436.4.2 Opening a View............................................................................................................................................................... 1446.4.3 Editing a View.................................................................................................................................................................. 1446.4.4 Dropping a View.............................................................................................................................................................. 1456.5 Other Operations................................................................................................................................................................1466.5.1 User Management.......................................................................................................................................................... 1466.5.2 Role Management.......................................................................................................................................................... 146

7 PostgreSQL DB Instance Management (Standard Edition)...................................... 1497.1 Overview................................................................................................................................................................................1497.1.1 Feature Overview............................................................................................................................................................ 1497.1.2 Database Management................................................................................................................................................ 1507.1.3 Querying SQL Statements............................................................................................................................................1517.2 SQL Operations................................................................................................................................................................... 1527.2.1 SQL Window..................................................................................................................................................................... 1527.2.2 SQL History....................................................................................................................................................................... 152

8 GaussDB(for MySQL) DB Instance Management (Standard Edition).................... 1548.1 Overview................................................................................................................................................................................1548.1.1 Feature Overview............................................................................................................................................................ 1548.1.2 Database Management................................................................................................................................................ 1558.1.3 SQL-based Query............................................................................................................................................................ 1578.1.4 Table Creation.................................................................................................................................................................. 1578.2 SQL Operations................................................................................................................................................................... 1588.2.1 SQL Window..................................................................................................................................................................... 1588.2.2 SQL History....................................................................................................................................................................... 1598.3 Import and Export.............................................................................................................................................................. 1598.3.1 Data Import...................................................................................................................................................................... 1598.3.2 Data Export....................................................................................................................................................................... 1608.4 CloudDBA.............................................................................................................................................................................. 1618.4.1 Real-Time Sessions......................................................................................................................................................... 1618.4.2 SQL Tuning........................................................................................................................................................................ 1628.4.3 Tuning Report................................................................................................................................................................... 1638.5 User Management............................................................................................................................................................. 164

9 DDM DB Instance Management (Standard Edition).................................................. 166

Data Admin ServiceUser Guide Contents

Issue 01 (2020-09-27) Copyright © Huawei Technologies Co., Ltd. vi

Page 8: User Guide...User. {{]}]} {}]}

9.1 Overview................................................................................................................................................................................1669.1.1 Feature Overview............................................................................................................................................................ 1669.1.2 Database Management................................................................................................................................................ 1679.1.3 SQL Window..................................................................................................................................................................... 1699.2 Table Management............................................................................................................................................................ 1699.2.1 Creating a Table.............................................................................................................................................................. 1699.2.2 Opening a Table.............................................................................................................................................................. 1709.2.3 Viewing Table Details.................................................................................................................................................... 1719.2.4 Altering a Table............................................................................................................................................................... 1719.2.5 Clearing a Table............................................................................................................................................................... 1729.2.6 Dropping a Table............................................................................................................................................................. 1729.2.7 Maintaining a Table....................................................................................................................................................... 1739.3 SQL Operations................................................................................................................................................................... 1739.3.1 SQL Window..................................................................................................................................................................... 1749.3.2 SQL History....................................................................................................................................................................... 1749.4 CloudDBA.............................................................................................................................................................................. 1759.4.1 Real-Time Sessions......................................................................................................................................................... 175

10 GaussDB(for Cassandra) DB Instance Management (Standard Edition)............ 17710.1 Overview............................................................................................................................................................................. 17710.1.1 Feature Overview..........................................................................................................................................................17710.1.2 Keyspace Management.............................................................................................................................................. 17810.1.3 Creating a Keyspace.................................................................................................................................................... 17910.1.4 SQL Window................................................................................................................................................................... 18010.2 Table Management......................................................................................................................................................... 18110.2.1 Opening a Table............................................................................................................................................................ 18110.2.2 Viewing Table Details.................................................................................................................................................. 18210.3 View Management.......................................................................................................................................................... 18210.3.1 Opening a View............................................................................................................................................................. 18210.3.2 Obtaining View Details............................................................................................................................................... 18310.4 Custom Type...................................................................................................................................................................... 18310.4.1 Viewing Custom Type.................................................................................................................................................. 18310.5 Import and Export............................................................................................................................................................18410.5.1 Data Import.................................................................................................................................................................... 18410.5.2 Data Export..................................................................................................................................................................... 18510.6 SQL Operations................................................................................................................................................................. 18510.6.1 SQL Window................................................................................................................................................................... 18510.6.2 SQL History..................................................................................................................................................................... 18610.7 Other Operations............................................................................................................................................................. 18610.7.1 Role Management........................................................................................................................................................ 186

11 GaussDB(openGauss) DB Instance Management (Standard Edition)................. 18811.1 Feature Overview............................................................................................................................................................. 18811.2 SQL Operations................................................................................................................................................................. 189

Data Admin ServiceUser Guide Contents

Issue 01 (2020-09-27) Copyright © Huawei Technologies Co., Ltd. vii

Page 9: User Guide...User. {{]}]} {}]}

11.2.1 SQL Window................................................................................................................................................................... 18911.2.2 SQL History..................................................................................................................................................................... 18911.3 Database Management................................................................................................................................................. 19011.4 Other Operations............................................................................................................................................................. 19211.4.1 Role Management........................................................................................................................................................ 192

12 Enterprise Edition............................................................................................................. 19312.1 Introduction........................................................................................................................................................................19312.1.1 What Is DAS Enterprise Edition?............................................................................................................................. 19312.1.2 User Roles........................................................................................................................................................................19412.1.3 Scenarios.......................................................................................................................................................................... 19412.2 Enterprise Edition Enablement.................................................................................................................................... 19812.3 Home Page......................................................................................................................................................................... 19912.4 Service Tickets................................................................................................................................................................... 20112.4.1 Creating a Service Ticket............................................................................................................................................ 20112.5 Instances/Databases/Sensitive Columns.................................................................................................................. 20212.5.1 Databases........................................................................................................................................................................ 20212.5.2 Instances.......................................................................................................................................................................... 20312.5.3 Sensitive Columns.........................................................................................................................................................20312.6 SQL Query.......................................................................................................................................................................... 20412.6.1 SQL Window................................................................................................................................................................... 20412.6.2 Metadata Collection.................................................................................................................................................... 20512.7 Database Management................................................................................................................................................. 20612.7.1 Table Management...................................................................................................................................................... 20612.7.2 View Management View Management................................................................................................................ 20812.7.3 Stored Procedure Management...............................................................................................................................20912.7.4 Event Management......................................................................................................................................................21012.7.5 Trigger Management...................................................................................................................................................21112.7.6 Function Management............................................................................................................................................... 21212.8 Data Scheme..................................................................................................................................................................... 21412.8.1 SQL Modification.......................................................................................................................................................... 21412.8.2 Big Data Import Modification.................................................................................................................................. 21412.8.3 Data Export..................................................................................................................................................................... 21512.9 System Management...................................................................................................................................................... 21612.9.1 Instance Management................................................................................................................................................ 21612.9.2 User Management........................................................................................................................................................21912.9.3 Approval Process Management............................................................................................................................... 21912.9.4 Access Control................................................................................................................................................................22112.9.5 Operation Audit.............................................................................................................................................................22212.9.6 Global Configuration Management....................................................................................................................... 222

A Change History....................................................................................................................224

Data Admin ServiceUser Guide Contents

Issue 01 (2020-09-27) Copyright © Huawei Technologies Co., Ltd. viii

Page 10: User Guide...User. {{]}]} {}]}

1 Overview

On the cloud, managing data can be complex. With DAS, you can manage yourdata easily and securely.

DAS implements differentiated UIs for different scenarios and offers you a list offunctions clearly and user-friendly.

ConsoleHelps you quickly locate every issue during the database running and avoidspotential risks. For more information, see DAS Console.

Standard EditionAllows you to manage DB instances on a web console, simplifying databasemanagement and improving working efficiency and data security.

The way to manage databases varies with database type. Therefore, thisdocument describes how to manage different types of databases.

● MySQL DB Instance Management (Standard Edition)● Microsoft SQL Server DB Instance Management (Standard Edition)● DDS DB Instance Management (Standard Edition)● PostgreSQL DB Instance Management (Standard Edition)● GaussDB(for MySQL) DB Instance Management (Standard Edition)● DDM DB Instance Management (Standard Edition)● GaussDB(for Cassandra) DB Instance Management (Standard Edition)● GaussDB(openGauss) DB Instance Management (Standard Edition)

Enterprise EditionProvides you with a permission- and process-based database DevOps platform.

Data Admin ServiceUser Guide 1 Overview

Issue 01 (2020-09-27) Copyright © Huawei Technologies Co., Ltd. 1

Page 11: User Guide...User. {{]}]} {}]}

2 Permissions Management

2.1 Creating a User and Granting PermissionsYou can use IAM to implement refined permission control for DAS resources. To bespecific, you can:

● Create IAM users for employees from different departments of yourenterprise. In this way, each IAM user has a unique security credential to useDAS resources.

● Grant only the permissions required for users to perform a specific task.● Entrust an account or cloud service to perform professional and efficient O&M

on your DAS resources.

If your account does not need individual IAM users, you may skip over this section.

Figure 2-1 describes how to grant permissions to a user group.

PrerequisitesBefore granting permissions to a user group, learn about the DAS system policiesthat can be added, as shown in Permissions Management. For the system policiesof other services, see System Permissions.

Data Admin ServiceUser Guide 2 Permissions Management

Issue 01 (2020-09-27) Copyright © Huawei Technologies Co., Ltd. 2

Page 12: User Guide...User. {{]}]} {}]}

Process Flow

Figure 2-1 Process for granting DAS permissions

1. Create a user group and grant permissions to it.

Create a user group on the IAM console, and grant the DAS Administratorpolicy to the group.

2. Create an IAM user.

Create a user on the IAM console and add the user to the group created in 1.

Data Admin ServiceUser Guide 2 Permissions Management

Issue 01 (2020-09-27) Copyright © Huawei Technologies Co., Ltd. 3

Page 13: User Guide...User. {{]}]} {}]}

3. Log in to the HUAWEI CLOUD console as the created IAM user, switch to theregion where you have been authorized to use DAS, and verify permissions.For details about how to log in to the console, see Logging In as an IAMUser.– In the service list, select Data Admin Service. On the displayed DAS

console, click Add Login. If login information can be successfully created,DAS policies have already taken effect.

– Select any other service, rather than DAS, in the Service List. If a messageindicating insufficient permissions to access the service appears, DASpolicies have already taken effect.

2.2 DAS Custom PoliciesCustom policies can be created to supplement the system-defined policies of DAS.

You can create custom policies in either of the following ways:

● Visual editor: Select cloud services, actions, resources, and request conditions.This does not require knowledge of policy syntax.

● JSON: Edit JSON policies from scratch or based on an existing policy.

For details, Creating a Custom Policy. The following describes examples ofcommon DAS custom policies.

Examples of DAS Custom Policies● Example 1: Granting the permission to create DDS DB instances

{ "Version": "1.1", "Statement": [ { "Effect": "Allow", "Action": [ "das:instance:create" ] } ]}

● Example 2: Denying DDS DB instance deletionA deny policy must be used together with other policies. If the permissionsassigned to a user contain both "Allow" and "Deny", the "Deny" permissiontakes precedence over the "Allow" permission.If you need to assign the DDS FullAccess policy to a user but want to forbidthis user to delete DDS DB instances, create a custom policy for denying DDSDB instance deletion. Then, assign both the DDS FullAccess and Deny policiesto the group the user belongs to. With this method, the user can perform alloperations on DDS DB instances except for instance deletion. The following isan example of the deny policy:{ "Version": "1.1", "Statement": [{ "Action": ["das:instance:deleteInstance"], "Effect": "Deny"

Data Admin ServiceUser Guide 2 Permissions Management

Issue 01 (2020-09-27) Copyright © Huawei Technologies Co., Ltd. 4

Page 14: User Guide...User. {{]}]} {}]}

}]}

Data Admin ServiceUser Guide 2 Permissions Management

Issue 01 (2020-09-27) Copyright © Huawei Technologies Co., Ltd. 5

Page 15: User Guide...User. {{]}]} {}]}

3 Console

3.1 DAS ConsoleOn the cloud, managing data can be complex. With DAS, you can manage yourdata easily and securely.

Database Login Management

To facilitate data management, you can create database logins for DB instancesthat have been bound to the current account or IAM account.

● DAS allows you to access read replicas whose data can be viewed only.

● If you edit the database of a primary DB instance or single instance, RDSautomatically synchronizes the changes to the read replica.

DAS Console

With DAS, you are able to manage multiple types of DB instances, including RDSDB instances, self-built databases on ECSs, DDS DB instances, DDM DB instances,and GaussDB NoSQL DB instances.

Figure 3-1 DAS console

Data Admin ServiceUser Guide 3 Console

Issue 01 (2020-09-27) Copyright © Huawei Technologies Co., Ltd. 6

Page 16: User Guide...User. {{]}]} {}]}

Table 3-1 Functions

Item Description

Adding logininformation

Allows you to manage databases by connecting to yourcreated DB instances.

Synchronizing RDSDB instances

Automatically adds the RDS DB instances that you havenot logged in to from the DAS console to the login list.You only need to enter the database login username andpassword.● Instances that are being created or frozen, or

abnormal are not synchronized.● Only the DB instances of default accounts (such as

rdsuser of SQL Server engines, root and db:postgresof MySQL and PostgreSQL engines) are synchronized.

DAS automatically synchronizes RDS DB instances in thefollowing scenarios:● When logging in to the DAS console● After clicking Synchronize RDS DB Instance● After clicking Log In of an RDS DB instance on the

RDS console

Database login Displays the source of the databases that can be loggedin.

Enterprise Edition Provides a database DevOps platform that supports dataprotection, change review, operation audit, and R&D self-service.

CloudDBA Provides multiple O&M features, such as slow query logs,emergency channel, and intelligent parameterrecommendation.The console offers a wide range of functions, coveringinstance performance data, slow SQL query, real-timeperformance analysis and diagnosis, as well as analysis ofhistorical operations, helping you quickly locate any issueoccurring during database operations and preventpotential risks.

Fuzzy search Allows you to query the database logins by DB instancename.

Database login list Allows you to select your required database source, forexample, RDS DB instances, DDS DB instances, or self-built databases on ECSs, to display the login informationof the created databases from the database source in alist. You can log in to, modify, delete, or view the DBinstances.

Data Admin ServiceUser Guide 3 Console

Issue 01 (2020-09-27) Copyright © Huawei Technologies Co., Ltd. 7

Page 17: User Guide...User. {{]}]} {}]}

NO TE

Different accounts can be used to create database logins for the same DB instance.

Logging In to DAS

Step 1 On the login page, enter the account and password to log in to the DAS console.

Figure 3-2 Logging in to the DAS console

Step 2 Click in the upper left corner and select a region and then project.

Step 3 Under Database, click Data Admin Service.

Data Admin ServiceUser Guide 3 Console

Issue 01 (2020-09-27) Copyright © Huawei Technologies Co., Ltd. 8

Page 18: User Guide...User. {{]}]} {}]}

Figure 3-3 Data Admin Service

----End

3.2 Adding Login Information

ScenariosThis topic describes how to add database login information so that you can log into a database for visualized data management operations.

NO TE

● If you have not log in to a DB instance through the created login connection over a year,the system automatically clears all information, including the saved password, of thislogin.

● You can log in to the same database either on the DAS console or using other clients.Both methods do not affect each other.

Adding RDS DB Instance Login Information

Step 1 On the Login Management page, click Add Login.

Step 2 On the displayed page, select the DB engine, source database, and target DBinstance, enter the login username, password, and remarks (optional), and enableCollect Metadata Periodically and Show Executed SQL Statements.

Step 3 Test the connection as needed. If a message indicating that the connection failedis displayed, modify the connection according to the failure causes contained inthe message.

Data Admin ServiceUser Guide 3 Console

Issue 01 (2020-09-27) Copyright © Huawei Technologies Co., Ltd. 9

Page 19: User Guide...User. {{]}]} {}]}

NO TE

● The username and password for connecting to the database must be the databaseusername and password.

● The database user must have the remote login permission. RDS users have the remotepermission by default. In other cases, the remote permission is not enabled. You need toapply for the required permission.

● To delete the password, you can modify or delete the login.

Step 4 Click Apply Now.

----End

Connecting to Self-built Databases on ECSs

Step 1 On the Login Management page, click Add Login.

Step 2 On the displayed page, select the DB engine, source database, and target DBinstance, enter the login username, password, and remarks (optional), and enableCollect Metadata Periodically and Show Executed SQL Statements.

Test the connection as needed. If a message indicating that the connection failedis displayed, modify the connection according to the failure causes contained inthe message.

NO TE

● Only self-built MySQL 8.0, 5.5, 5.6, and 5.7 databases on ECSs are supported. HAclusters are not supported currently.

● Only Microsoft SQL Server 2008, 2012, 2014, 2016, and 2017 databases on ECSs aresupported. HA clusters are not supported.

● The username and password for connecting to the database must be the databaseusername and password.

● The port is the port of your self-built DB instance. Ensure that the security group of theECS allows access to this port. To avoid conflicts with reserved ports, you are advised toset the port number in range 1024 to 65535.

● To delete the password, you can modify or delete the connection.

Step 3 Click Apply Now.

----End

Connecting to DDS DB Instances

Step 1 On the Login Management page, click Add Login.

Step 2 On the displayed page, enter the database name, password, and remarks(optional), and enable the "metadata collection" and "show executed SQLstatement" functions.

Test the connection as needed. If a message indicating that the connection failedis displayed, modify the connection according to the failure causes contained inthe message.

Data Admin ServiceUser Guide 3 Console

Issue 01 (2020-09-27) Copyright © Huawei Technologies Co., Ltd. 10

Page 20: User Guide...User. {{]}]} {}]}

NO TE

● The username and password for connecting to the database must be the instanceusername and password.

● To delete the password, you can modify or delete the connection.

● For the same DB instance, the username is unique.

Step 3 Click Apply Now.

----End

3.3 Logging In to a Database (Using DAS)

Scenarios

This topic describes how to log in to a database.

Procedure

Step 1 Log in to the DAS console.

Step 2 In the login list, locate the DB instance you want to log in to and click Log In inthe Operation column.

Figure 3-4 Logging in to a database

● If the login succeeds, the instance management page is displayed. You canthen perform operations as needed.

● If a DB instance does not exist, its Log In button will be grayed out.

----End

3.4 Logging In to a Database Using RDS

Scenarios

This topic describes how to log in to a database using RDS.

Procedure

Step 1 Log in to the management console, click Service List, and choose RelationalDatabase Service under Database.

Step 2 On the RDS console, locate the DB instance you want to log in to and click Log Inin the Operation column.

Data Admin ServiceUser Guide 3 Console

Issue 01 (2020-09-27) Copyright © Huawei Technologies Co., Ltd. 11

Page 21: User Guide...User. {{]}]} {}]}

Step 3 On the displayed login page, enter the username and password. You are advisedto select Remember Password, Metadata Collection, and SQL ExecutionRecord.

----End

3.5 Logging In to a Database Using DDS

ScenariosThis topic describes how to log in to a database using DDS.

Procedure

Step 1 Log in to the management console, click Service List, and choose DocumentDatabase Service under Database.

Step 2 On the DDS console, locate the DB instance you want to log in to and click Log Inin the Operation column.

Data Admin ServiceUser Guide 3 Console

Issue 01 (2020-09-27) Copyright © Huawei Technologies Co., Ltd. 12

Page 22: User Guide...User. {{]}]} {}]}

Step 3 On the displayed login page, enter the username and password. You are advisedto select Remember Password and Command execution record.

----End

3.6 Modifying Login Information

Scenarios

DAS allows you to modify login information, such as username and password. Youcan also select whether to remember password, enable or disable the metadatacollection function.

Procedure

Step 1 In the login list, locate the DB instance for which you want to modify its logininformation and click Modify in the Operation column.

Figure 3-5 Modifying login information-1

Step 2 On the displayed Modify Login Information page, modify the information asrequired.● If you do not need to modify the information, click Cancel.● If you complete the modification, click OK.

Figure 3-6 Modifying login information-2

----End

Data Admin ServiceUser Guide 3 Console

Issue 01 (2020-09-27) Copyright © Huawei Technologies Co., Ltd. 13

Page 23: User Guide...User. {{]}]} {}]}

3.7 Deleting Login Information

NO TICE

A login represents an entry for managing databases. Deleted logins have noimpact on your database performance but cannot be recovered, exercise cautionwhen you perform this operation.

Procedure

Step 1 In the login list, locate the DB instance for which you want to delete its logininformation and click Delete in the Operation column.

Figure 3-7 Deleting login information

Step 2 In the displayed dialog box, click Yes.

Figure 3-8 Deleting login information

----End

Data Admin ServiceUser Guide 3 Console

Issue 01 (2020-09-27) Copyright © Huawei Technologies Co., Ltd. 14

Page 24: User Guide...User. {{]}]} {}]}

3.8 CloudDBA

3.8.1 Overview

Procedure

Step 1 On the DAS console, select CloudDBA from the navigation pane. The functionoverview page is displayed.

Figure 3-9 CloudDBA functions

Table 3-2 Functions

No. Item Description

1 CloudDBA Monitors, diagnoses, and optimizes databasescomprehensively.

2 Instance Overview Allows you to set the DB instance metrics to bedisplayed, so that you can monitor the DBinstance status in real time.

3 Fuzzy Search Allows you to view the performance of DBinstances by DB engine, DB instance name, or IPaddress.

4 OverallPerformance

Allows you to view the performance of DBinstances in real time.

Step 2 In the Instance Overview area, click Set Displayed Metrics to specify theperformance metrics to be displayed.

Data Admin ServiceUser Guide 3 Console

Issue 01 (2020-09-27) Copyright © Huawei Technologies Co., Ltd. 15

Page 25: User Guide...User. {{]}]} {}]}

Figure 3-10 Setting displayed metrics

Table 3-3 Performance metrics

Parameter Description

QPS Queries per second

TPS Transactions per second

mem_usage Instance memory usage (ratio ofinstance memory to OS memory)

cpu_usage Service process CPU usage (200%indicates two vCPU coresoccupied)

connection_total_count Total connections

connection_active_count Active connections

com_select_count Number of SELECT statementexecutions per second

com_update_count Number of UPDATE statementexecutions per second

Data Admin ServiceUser Guide 3 Console

Issue 01 (2020-09-27) Copyright © Huawei Technologies Co., Ltd. 16

Page 26: User Guide...User. {{]}]} {}]}

Parameter Description

com_insert_count Number of INSERT statementexecutions per second

com_delete_count Number of DELETE statementexecutions per second

com_replace_count Number of REPLACE statementexecutions per second

innodb_rows_deleted Number of rows deleted from anInnoDB table per second

innodb_rows_read Number of rows read from anInnoDB table per second

innodb_rows_inserted Number of rows inserted into anInnoDB table per second

innodb_rows_updated Number of rows updated in anInnoDB table per second

bytes_received Number of bytes received from allclients per second

bytes_sent Number of bytes sent to allclients per second

innodb_data_read Number of read bytes per secondin an InnoDB buffer

innodb_data_written Number of write bytes per secondin an InnoDB buffer

innodb_buffer_pool_read_requests Number of times that InnoDBreads pages (logical read) from abuffer pool per second

innodb_buffer_pool_write_requests Number of times that InnoDBwrites data to a buffer pool persecond

Step 3 After specifying the metrics, click OK.

Step 4 Click Details in an instance module to go to the CloudDBA details page.

Data Admin ServiceUser Guide 3 Console

Issue 01 (2020-09-27) Copyright © Huawei Technologies Co., Ltd. 17

Page 27: User Guide...User. {{]}]} {}]}

Figure 3-11 Instance Overview

Step 5 On the CloudDBA details page, view DB instance performance metrics.

Figure 3-12 CloudDBA overview

----End

3.8.2 Performance

3.8.2.1 Real-Time Diagnosis

Procedure

Step 1 On the CloudDBA overview page, click the Performance tab to view theperformance metrics of the current DB instance.

Data Admin ServiceUser Guide 3 Console

Issue 01 (2020-09-27) Copyright © Huawei Technologies Co., Ltd. 18

Page 28: User Guide...User. {{]}]} {}]}

Figure 3-13 Performance

Step 2 On the Real-Time Diagnosis tab page, view the resource usage, real-timeperformance, and slow query logs of the current instance.

Figure 3-14 Real-Time Diagnosis

----End

3.8.2.2 Real-Time Performance

Procedure

Step 1 On the Real-Time Performance tab page, view the server uptime, connectioninformation, and buffer pool.

Step 2 Click Start/Pause or change the time interval (1 to 10 seconds) to adjust theperformance monitoring. You can also click Set Metric to specify required metricsbased on site requirements.

Data Admin ServiceUser Guide 3 Console

Issue 01 (2020-09-27) Copyright © Huawei Technologies Co., Ltd. 19

Page 29: User Guide...User. {{]}]} {}]}

Figure 3-15 Real-Time Performance

Table 3-4 Real-time performance metrics

Metric Description

Slow Queries Difference between two adjacent slow querycollection points.

QPS | TPS QPS: Number of SQL statement executions persecond.TPS: Number of transactions executed per second.

Connections Total: Number of enabled connections.Active: Number of active connections among theenabled ones.

DML Executions select: Number of SELECT statement executions persecond.insert: Number of INSERT statement executions persecond.update: Number of UPDATE statement executionsper second.delete: Number of DELETE statement executionsper second.insert_select: Number of INSERT and QUERYstatement executions per second.

InnoDB Cache Cache Hit Ratio: Cache hit ratio.Cache Usage: Cache usage.

Data Admin ServiceUser Guide 3 Console

Issue 01 (2020-09-27) Copyright © Huawei Technologies Co., Ltd. 20

Page 30: User Guide...User. {{]}]} {}]}

Metric Description

InnoDB Accessed Rows rows_read: Number of rows read from an InnoDBstorage engine table.rows_inserted: Number of rows inserted into anInnoDB storage engine table.rows_updated: Number of rows updated in anInnoDB storage engine table.rows_deleted: Number of rows deleted from anInnoDB storage engine table.

Logical Reads | PhysicalReads

Logic Reads: Number of logical reads per second.Physical Reads: Number of physical reads persecond.

InnoDB Average RowLock Duration (ms)

Average lock time of InnoDB row locks. The unit isms.

InnoDB Row Lock Waits Average InnoDB Row Lock Waits: Average waittimes of InnoDB row locks.Current InnoDB Row Lock Waits: Number ofcurrent waits of InnoDB row locks.

Temporary Tables | Files Temporary tables: Number of temporary tablesthat are automatically created during SQLstatement execution.Temporary files: Number of temporary files thatare automatically created during SQL statementexecution.

Network Traffic Total: Total incoming and outgoing traffic of aninstance.Incoming: Incoming traffic of an instance.Outgoing: Outgoing traffic of an instance.

----End

3.8.2.3 Performance History

Procedure

Step 1 On the Performance History tab page, view the performance history of thecurrent instance.

Data Admin ServiceUser Guide 3 Console

Issue 01 (2020-09-27) Copyright © Huawei Technologies Co., Ltd. 21

Page 31: User Guide...User. {{]}]} {}]}

Figure 3-16 Performance History

Step 2 Click Select Metric to specify your desired metrics, and click OK.

Figure 3-17 Specifying metrics

Step 3 Set a time period in the upper right corner so that you can view the DB instanceperformance during this period. Alternatively, click Detail on each metricperformance graph to set the time period.

Figure 3-18 Setting time period

----End

Data Admin ServiceUser Guide 3 Console

Issue 01 (2020-09-27) Copyright © Huawei Technologies Co., Ltd. 22

Page 32: User Guide...User. {{]}]} {}]}

3.8.2.4 Performance Trends Comparisons

Procedure

Step 1 On the Performance Trends Comparisons tab page, view the historicalperformance changes of the current instance at the same time on different days.

Step 2 Click Select Metric to specify your desired metrics, and click OK.

Step 3 Set the date and time period so that you can view the performance data duringthis period. Alternatively, click Detail on each metric performance graph to set thedata and time period.

Figure 3-19 Performance Trends Comparisons

----End

3.8.2.5 Custom Graphs

Procedure

Step 1 On the Custom Graphs tab page, customize the metrics you want to view.

Figure 3-20 Custom Graphs

Step 2 Click Create Graph. In the displayed dialog box, select you desired metrics in theAvailable Metrics area.

Data Admin ServiceUser Guide 3 Console

Issue 01 (2020-09-27) Copyright © Huawei Technologies Co., Ltd. 23

Page 33: User Guide...User. {{]}]} {}]}

Figure 3-21 Create Graph

Step 3 Set a time period in the upper right corner so that you can view the DB instanceperformance during this period. Alternatively, click Modify in the graph to modifythe settings.

Figure 3-22 Modifying a graph

----End

3.8.3 Sessions

Data Admin ServiceUser Guide 3 Console

Issue 01 (2020-09-27) Copyright © Huawei Technologies Co., Ltd. 24

Page 34: User Guide...User. {{]}]} {}]}

3.8.3.1 Real-Time Sessions

Procedure

Step 1 Choose Sessions > Real-Time Sessions to view the real-time session statisticscollected by user, host, and database.

Step 2 On the Sessions tab page, select the abnormal sessions you want to end and clickKill for the databases to recover.

On the Slow Sessions tab page, set the slow SQL threshold and click therefreshing button or enable Auto Refresh to single out the SQL statements whoseexecution time exceeds the threshold. Select the sessions you want to end andclick Kill for the databases to recover.

----End

3.8.3.2 Emergency Channel

Scenarios● Emergency Channel

a. If the maximum number of sessions for an instance has been reachedand the instance cannot be logged in to, you can view and killunnecessary sessions through the emergency channel.

b. Emergency channel is available to only RDS MySQL databases currently,but not to self-built databases on ECSs and instances in creating, frozen,or abnormal state.

c. Use this function in urgent conditions. All your kill operations will berecorded in logs.

d. If your instance can be logged in to on the DAS console, log in to theinstance and perform desired operations through Real-Time Sessions.

e. Sessions of sensitive users, like rdsadmin, rdsbackup, and rdsmetric,cannot be killed.

● History Logs

Data Admin ServiceUser Guide 3 Console

Issue 01 (2020-09-27) Copyright © Huawei Technologies Co., Ltd. 25

Page 35: User Guide...User. {{]}]} {}]}

On the History Logs tab page, you can view all your kill operations throughthe emergency channel.

Prerequisites● The DB engine is MySQL. The MySQL 5.6 version is 5.6.43.3 or later, and

MySQL 5.7 version is 5.7.25.3 or later.

Procedure

Step 1 On the Emergency Channel tab page, select the sessions you want to kill. Bydefault, the sessions are sorted in descending order by session duration.

Step 2 Click Kill. In the displayed dialog box, click Yes.

Step 3 On the History Logs tab page, view your sessions killed through the emergencychannel.

----End

3.8.4 SQL

3.8.4.1 Slow Query Logs

Procedure

Step 1 On the SQL tab page, click Slow Query Logs to view the slow SQL trend of thecurrent instance.

Step 2 Set your desired time range or select Last 15 minutes, Last 30 minutes, or Last 1hour to view the corresponding slow query logs, CPU usage, and archived slowquery logs.

Data Admin ServiceUser Guide 3 Console

Issue 01 (2020-09-27) Copyright © Huawei Technologies Co., Ltd. 26

Page 36: User Guide...User. {{]}]} {}]}

Step 3 Enable Enable DAS Slow Query Log. In the displayed dialog box, read and agreeto the security agreement, and click OK.

Step 4 On the Log Trends tab page, view the statistics and details of slow query logs.

● Query and view slow query logs by database name.

● Click Export Slow Query Log to export the slow query logs.

● Click Export History to view the export history of slow query logs.

Step 5 On the Log Archiving tab page, obtain the slow query log files of the current DBinstance in either of the following ways: (The archiving function saves slow querylog files generated in the last 10 days.)

● Click Generate Latest Log File. DAS will collect the slow query log datagenerated since the last time a slow query log is generated (for example,16:00 March 18, 2020) till the current time (for example, 16:00 March 20,2020).

● DAS automatically generates a slow query log every time the log data reaches50 MB.

Step 6 In the slow query log list, click Download to download and view log data.

----End

3.8.4.2 SQL Explorer

Procedure

Step 1 On the SQL tab page, click SQL Explorer to view the full SQL details of thecurrent instance.

Data Admin ServiceUser Guide 3 Console

Issue 01 (2020-09-27) Copyright © Huawei Technologies Co., Ltd. 27

Page 37: User Guide...User. {{]}]} {}]}

Step 2 On the SQL Statements tab page, enable Enable DAS SQL Explorer. Query theSQL statements executed by the current instance by different criteria, includingtime range, user, keyword, and database.

Figure 3-23 Enable DAS SQL Explorer

NO TE

A maximum of 10,000 SQL statements can be displayed. If you need to view more, clickExport to export them.A maximum of 100,000 records can be exported.

Step 3 On the SQL Templates tab page, select a time range as required to view the SQLclassification. Generally, slow SQL statements are displayed here.

Step 4 On the SQL Statement Types tab page, view the historical executions of SQLstatements, including SELECT, UPDATE, and DELETE statements.

----End

3.8.4.3 SQL Diagnosis

Procedure

Step 1 Choose SQL > SQL Diagnosis. On the displayed page, select your desireddatabase, enter the SQL statements to be diagnosed, and click Diagnose. Thediagnosis result page is displayed.

Data Admin ServiceUser Guide 3 Console

Issue 01 (2020-09-27) Copyright © Huawei Technologies Co., Ltd. 28

Page 38: User Guide...User. {{]}]} {}]}

Figure 3-24 SQL diagnosis

Step 2 On the SQL Diagnosis page, enter SQL statements and click Execute. The systemautomatically executes the statements and displays a result set.

Figure 3-25 SQL execution result set

Step 3 On the SQL Diagnosis page, enter multiple SQL statements and click Format. Thesystem automatically formats all SQL statements.

Step 4 On the SQL Diagnosis page, enter multiple SQL statements and click Execute.The system automatically executes all SQL statements in sequence.

Data Admin ServiceUser Guide 3 Console

Issue 01 (2020-09-27) Copyright © Huawei Technologies Co., Ltd. 29

Page 39: User Guide...User. {{]}]} {}]}

NO TE

● The SQL tuning function obtains the table structure and data distribution information(non-original). The obtained data is only for logic diagnosis, but not stored on the DASserver.

● Obtaining table structure and data distribution information may add additional loads tothe DB instance, but has little impact on its performance.

● Only the SQL diagnosis history is stored on the DAS server. You can delete it from theserver permanently.

----End

3.8.5 Space

3.8.5.1 Instance Space

Procedure

Step 1 On the Space tab page, click Instance Space to view the space size and spaceusage trend of the current instance.

Figure 3-26 Instance Space

Step 2 View the space usage trend by setting a specific time range.

Figure 3-27 Instance space usage trend

----End

Data Admin ServiceUser Guide 3 Console

Issue 01 (2020-09-27) Copyright © Huawei Technologies Co., Ltd. 30

Page 40: User Guide...User. {{]}]} {}]}

3.8.5.2 Database Space

Procedure

Step 1 On the Space tab page, select Database Space to view the space usage andfragmentation rate of a database.

Figure 3-28 Database Space

Step 2 Locate the target database, and click Database Space & Metadata Analysis inthe Operation column.

Figure 3-29 Database Space & Metadata Analysis

Step 3 On the Tables tab page, locate the target table and click Table Details in theOperation column to view table details.

Data Admin ServiceUser Guide 3 Console

Issue 01 (2020-09-27) Copyright © Huawei Technologies Co., Ltd. 31

Page 41: User Guide...User. {{]}]} {}]}

Figure 3-30 Table Details

Step 4 Click Table Space Overview in the Operation column o view the table spaceusage.

Figure 3-31 Table Space Overview

Step 5 On the Database Space Overview page, view the database space usage trend byspecifying a specific time range.

Data Admin ServiceUser Guide 3 Console

Issue 01 (2020-09-27) Copyright © Huawei Technologies Co., Ltd. 32

Page 42: User Guide...User. {{]}]} {}]}

Figure 3-32 Database Space Overview

NO TE

Space & Metadata Analysis allows you to analyze a maximum of 10,000 tables. Iftablespace data is missing, there may be too many instance tables, or the account passwordhas not been saved.

----End

3.8.6 Binlog

Procedure

Step 1 On the binlog tab page, click Latest Logs. On the displayed page, locate thetarget file and click Parse in the Operation column to parse the file.

Figure 3-33 Latest Logs

Step 2 On the Archived Logs tab page, select a time range to view log files archivedduring this period.

Data Admin ServiceUser Guide 3 Console

Issue 01 (2020-09-27) Copyright © Huawei Technologies Co., Ltd. 33

Page 43: User Guide...User. {{]}]} {}]}

Figure 3-34 Archived Logs

----End

3.8.7 Parameters

Procedure

Step 1 On the Parameters tab page, view the Result and Diagnosis Result to checkwhether the memory parameters are correctly configured.

Step 2 If some parameter settings are inappropriate, under Memory Parameter Setting

Diagnosis, click next to a parameter value to change it to a desired one, and

click to save the modification.

NO TE

● You can view memory parameter settings online to detect problems in a timely manner.This prevents high memory usage.

● Modifications made on the current page are used for diagnosis only and will not changethe actual parameter settings. To change instance parameter settings, go to the RDSconsole.

● Currently, only RDS for MySQL databases are supported.

----End

Data Admin ServiceUser Guide 3 Console

Issue 01 (2020-09-27) Copyright © Huawei Technologies Co., Ltd. 34

Page 44: User Guide...User. {{]}]} {}]}

3.8.8 Daily Reports

Procedure

Step 1 On the Daily Reports tab page, click Diagnose to diagnose the current DBinstance. You can also click View Historical Report to view historical diagnosisreports.

Figure 3-35 Diagnosis Overview

Figure 3-36 Historical diagnosis reports

Step 2 Under Risks, view the details in a report, including risks, severities, and possiblecauses.

Figure 3-37 Risks

Step 3 Under Specified Analysis, view the details in a report, including slow SQL analysis,performance and disk analysis, performance trend graphs, tablespace analysis, andevent analysis.

Data Admin ServiceUser Guide 3 Console

Issue 01 (2020-09-27) Copyright © Huawei Technologies Co., Ltd. 35

Page 45: User Guide...User. {{]}]} {}]}

NO TE

In the upper right corner of the Daily Reports page, click Download to download thediagnosis report to your local PC. Click Subscribe to email you diagnosis reports.

----End

3.8.9 Security

Procedure

Step 1 On the Security tab page, enable SQL Explorer and Attack Detection. Then,specify a time range, operation type, client IP address, or database user to viewdatabase operation logs.

Step 2 Identify whether there are historical database attacks based on the displayeddatabase operation logs.

----End

Data Admin ServiceUser Guide 3 Console

Issue 01 (2020-09-27) Copyright © Huawei Technologies Co., Ltd. 36

Page 46: User Guide...User. {{]}]} {}]}

4 MySQL DB Instance Management(Standard Edition)

4.1 Overview

4.1.1 Feature Overview

Logging In to a DB Instance

Step 1 Log in to the DAS console.

Step 2 In the login list, locate the DB instance you want to log in to and click Log In inthe Operation column.

For details, see Logging In to a Database (Using DAS).

Figure 4-1 Logging in to a DB instance

----End

DAS FeaturesThis topic briefly describes the page for managing databases to help you betterunderstand DAS.

Data Admin ServiceUser Guide

4 MySQL DB Instance Management (StandardEdition)

Issue 01 (2020-09-27) Copyright © Huawei Technologies Co., Ltd. 37

Page 47: User Guide...User. {{]}]} {}]}

Figure 4-2 DAS interface for MySQL DB instances

Table 4-1 Functions

No. Item Description

1 Top menu bar Includes entries of the SQL operations,database management, data import andexport, and other modules.

2 Account informationand logout

Displays the current account information anda logout button.

3 DB instanceinformation

Displays the current database information,such as the DB engine logo, DB instancename, and DB engine version.

4 Database list Displays the databases of the current DBinstance, including user databases and systemdatabases.Allows you to search for a database by name.Allows you to create databases.

4.1.2 Database Management

OverviewYou can go to the Database Management page using either of the followingmethods:

● In the database list of the Home page, locate the target database and clickManage in the Operation column.

● Select Database Management on the top menu bar.

Data Admin ServiceUser Guide

4 MySQL DB Instance Management (StandardEdition)

Issue 01 (2020-09-27) Copyright © Huawei Technologies Co., Ltd. 38

Page 48: User Guide...User. {{]}]} {}]}

Figure 4-3 Database Management

Table 4-2 Functions

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 currentDB instance.

4 Allows you to open the SQL window of the current database.

5 Periodically collects metadata such as databases, tables, and fields ofthe DB instance and stores the data to the databases of DAS.Advantages:● Reduces queries on user databases and the impact on the

performance of user databases.● Improves the search performance for DB instances that contain a

large number of tables and supports pagination queries.Only structural metadata is collected, which means that user's tabledata is not included.

6 Displays three functional modules: Objects, SQL Tuning, andMetadata Collection.

7 Allows you to perform operations.

ObjectsYou can manage tables, views, stored procedures, events, triggers, and functions ofthe MySQL DB instances. The main operations include creating, querying, andmodifying objects.

For details on how to manage tables, see Table Management.

For details on how to manage views, see View Management.

For details on how to manage events, see Event Management.

For details on how to manage store procedures, see Stored ProcedureManagement.

Data Admin ServiceUser Guide

4 MySQL DB Instance Management (StandardEdition)

Issue 01 (2020-09-27) Copyright © Huawei Technologies Co., Ltd. 39

Page 49: User Guide...User. {{]}]} {}]}

For details on how to manage functions, see Function Management.

For details on how to manage triggers, see Trigger Management.

SQL TuningSQL 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.

Step 1 On the Database Management page, click the SQL Tuning tab. You can searchfor SQL tuning history by date to view details or you can add or delete SQL tuningrecords.

Figure 4-4 SQL Tuning

Step 2 Click Add SQL Performance Tuning. In the displayed dialog box, choose to tuneSQL statements or SQL file. If you select SQL statement for Task Type, enter theSQL statements and click OK. The tuning results can be viewed in the SQL tuninglist.

Figure 4-5 Adding a SQL performance tuning task

Data Admin ServiceUser Guide

4 MySQL DB Instance Management (StandardEdition)

Issue 01 (2020-09-27) Copyright © Huawei Technologies Co., Ltd. 40

Page 50: User Guide...User. {{]}]} {}]}

NO TE

● 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 toSELECT statements for tuning. The tuning task that contains unsupported SQL syntaxwill fail.

● The following shows the unsupported syntaxes:1. alter table t add index idx_name(name)2. show databases3. grant SELECT,PROCESS on d.t to 'am'@'%' with grant option4. insert into t(i, v) values (1, 'a')5. Only MySQL InnoDB is supported.6. Only the tuning of the SELECT/INSERT/UPDATE/DELETE statements is supported. An

INSERT statement must contain a SELECT clause.7. Querying stored SQL statements such as information_schema, test, mysql, is not

supported.8. View statements are not supported.

Step 3 In the SQL tuning list, locate the target task and click View Details in theOperation column.

Figure 4-6 Viewing task details

Figure 4-7 Task details

You can view the tuning details at the bottom of the task list.

Data Admin ServiceUser Guide

4 MySQL DB Instance Management (StandardEdition)

Issue 01 (2020-09-27) Copyright © Huawei Technologies Co., Ltd. 41

Page 51: User Guide...User. {{]}]} {}]}

Figure 4-8 Tuning details

----End

4.1.3 Metadata Collection

Operation DescriptionDAS periodically collects DB instance metadata such as databases, tables, andfields and stores the collected data in databases. In addition, it collects onlystructural metadata, but not data in user tables, which ensures data security.Metadata collection delivers the following advantages:

● Reduces queries on user databases and the impact on the performance ofuser databases.

● Improves the search performance for DB instances that contain a largenumber of tables and supports pagination queries.

Procedure

Step 1 On the Database Management page, enable Auto Metadata Collection in theupper right corner and click the Metadata Collection tab.

Figure 4-9 Metadata Collection

Step 2 On the displayed page, click Collect Now to start the collection. You can also stopthe collection or view collection details.● Clear Collected Data: Clears the collected data such as metadata, database

structure, and table structure.● Delete Logs: Deletes logs. Deleted logs cannot be restored.

Data Admin ServiceUser Guide

4 MySQL DB Instance Management (StandardEdition)

Issue 01 (2020-09-27) Copyright © Huawei Technologies Co., Ltd. 42

Page 52: User Guide...User. {{]}]} {}]}

NO TE

– Auto Metadata Collection: With this option enabled, the system automaticallycollects data at 20:00 (UTC) every day. If you are not using a UTC time, convert thetime according to your local time zone. When Auto Metadata Collection is notenabled, you can also click Collect Now to collect data at any time as needed.

----End

4.1.4 SQL Query

Procedure

Step 1 In the database list of the Home page, locate the target database and click QuerySQL Statements in the Operation column. The SQL Window is displayed.

Figure 4-10 Query SQL Statements

Step 2 In the navigation pane, specify a database, table, or view.

Figure 4-11 SQL window

● Execute SQL: executes SQL statements.

● Tune SQL: queries the SQL statements that are executed frequently, consumea large amount of resources, or take a long time to execute.

● Format SQL: improves the readability of SQL statements. If you click thisbutton, the SQL statements are displayed in line break mode but the logicand semantics of the SQL statements will not be changed.

● Execute SQL Plan: reports the execution of SQL statements to facilitatetroubleshooting and optimize SQL processing performance.

● SQL Favorites: allows you to add, view, and manage frequently used SQLstatements.

Data Admin ServiceUser Guide

4 MySQL DB Instance Management (StandardEdition)

Issue 01 (2020-09-27) Copyright © Huawei Technologies Co., Ltd. 43

Page 53: User Guide...User. {{]}]} {}]}

Figure 4-12 SQL statements before formatting

Figure 4-13 SQL statements after formatting

Step 3 After SQL statements are executed, view SQL execution status on the ExecutedSQL Statements, Messages, and Result Set tab pages.

----End

4.1.5 Table Creation

Operation Description

A MySQL data table consists of basic information, fields/columns, virtual columns,indexes, and foreign keys, among which virtual columns, indexes, and foreign keysare optional. Configure these items as required.

Procedure

Step 1 In the database list of the Home page, locate the target database and clickCreate Table in the Operation column.

Figure 4-14 Creating a table

Step 2 On the displayed page, specify the details under Basic Information (Table Nameis mandatory). Click Next, as shown in the following figure.

Data Admin ServiceUser Guide

4 MySQL DB Instance Management (StandardEdition)

Issue 01 (2020-09-27) Copyright © Huawei Technologies Co., Ltd. 44

Page 54: User Guide...User. {{]}]} {}]}

Figure 4-15 Basic Information

Step 3 Set the column name, type, length, nullable, primary key, and extendedinformation based on service requirements.● If you do not need to add virtual columns, indexes, or foreign keys, click

Create at the bottom of the page. In the displayed SQL Preview dialog box,click Execute.

Figure 4-16 Configuring fields

NO TE

● Only MySQL 5.6.5 and later support default DATETIME values.● In versions earlier than MySQL 5.6.5, leave default values blank. Otherwise, an error

occurs.

● If you need to add virtual columns, indexes, and foreign keys, click Next.Then, set the column name, type, length, nullable, primary key, expression,storage type, comment, and extended information. If you need to set thetable index or foreign key, click Next. After the setting, click Create.

Data Admin ServiceUser Guide

4 MySQL DB Instance Management (StandardEdition)

Issue 01 (2020-09-27) Copyright © Huawei Technologies Co., Ltd. 45

Page 55: User Guide...User. {{]}]} {}]}

Figure 4-17 (Optional) Adding virtual columns

Figure 4-18 (Optional) Adding indexes

Figure 4-19 (Optional) Adding foreign keys

NO TE

When you create a foreign key, the type of columns in the referenced table must be thesame as that of included columns, and must be the primary key or have a unique index.

Step 4 In the SQL Preview dialog box, click Execute to create a table.

----End

4.2 Table Management

Data Admin ServiceUser Guide

4 MySQL DB Instance Management (StandardEdition)

Issue 01 (2020-09-27) Copyright © Huawei Technologies Co., Ltd. 46

Page 56: User Guide...User. {{]}]} {}]}

4.2.1 Creating a Table

OperationsA MySQL data table consists of basic information, field/column information,virtual columns, indexes, and foreign keys. The virtual columns, indexes, andforeign keys are optional and can be configured based on service requirements.

Procedure

Step 1 On the top menu bar, choose Database Management. On the displayed Objectspage, select Tables and click Create Table.

Figure 4-20 Creating a table

Step 2 On the displayed page, specify the details under Basic Information (Table Nameis mandatory). Click Next, as shown in the following figure.

Figure 4-21 Basic Information

Step 3 Set the following fields based on the service requirements: table column name,field type, length, nullable, primary key, and extended information.● If you do not need to add virtual columns, indexes, or foreign keys, click

Create at the bottom of the page. In the displayed SQL Preview dialog box,click Execute.

Data Admin ServiceUser Guide

4 MySQL DB Instance Management (StandardEdition)

Issue 01 (2020-09-27) Copyright © Huawei Technologies Co., Ltd. 47

Page 57: User Guide...User. {{]}]} {}]}

Figure 4-22 Configuring field information

NO TE

● Only MySQL 5.6.5 and later support default DATETIME values.● In versions earlier than MySQL 5.6.5, leave default values blank. Otherwise, an error

occurs.

● If you need to add virtual columns, indexes, and foreign keys, click Next.Then, set the column name, type, length, nullable, primary key, expression,storage type, comment, and extended information. If you need to set thetable index or foreign key, click Next. After the setting, click Create.

Figure 4-23 (Optional) Adding virtual columns

Figure 4-24 (Optional) Adding indexes

Data Admin ServiceUser Guide

4 MySQL DB Instance Management (StandardEdition)

Issue 01 (2020-09-27) Copyright © Huawei Technologies Co., Ltd. 48

Page 58: User Guide...User. {{]}]} {}]}

Figure 4-25 (Optional) Adding foreign keys

NO TE

When you create a foreign key, the type of columns in the referenced table must be thesame as that of included columns, and must be the primary key or have a unique index.

Step 4 In the SQL Preview dialog box, click Execute to create a table.

----End

4.2.2 Opening a Table

ScenariosIf a table has primary keys, you can add, delete, modify, or query table data asyou do in Excel.

Procedure

Step 1 On the top menu bar, choose Database Management. On the displayed Objectspage, select Tables, locate the target table, and click Open in the Operationcolumn.

Figure 4-26 Opening a table

Step 2 On the table details page, double-click a cell to edit data. After adding or editingdata, submit and save the changes.

Data Admin ServiceUser Guide

4 MySQL DB Instance Management (StandardEdition)

Issue 01 (2020-09-27) Copyright © Huawei Technologies Co., Ltd. 49

Page 59: User Guide...User. {{]}]} {}]}

Figure 4-27 Editing table data

Table 4-3 Functions

Item Description

Where Condition Filters records.

Quickly GenerateTest Data

Quickly generates test data for table structure testing andallows you to set rules.

Copy Row Copies data of selected rows. Specifically, double-click thetarget row and then click Copy Row.

Copy Column Allows you to copy all data in a column by selecting thiscolumn from the Copy Column drop-down list.

Column Settings Allows you to set the columns you want to display.

Binary toHexadecimal

Prevents binary data in columns from being displayed asgarbled characters. If there is binary data in columns, youmust select this option.

Refresh Allows you to update table data manually.

Row Details Shows the detailed information of a specified row.

Add Allows you to add rows.

Submit Allows you to submit and save the changes to data.

Delete Row Allows you to delete the selected rows.

Export Exports a maximum of 10,000 data records as CSV or SQLfiles.

Data Admin ServiceUser Guide

4 MySQL DB Instance Management (StandardEdition)

Issue 01 (2020-09-27) Copyright © Huawei Technologies Co., Ltd. 50

Page 60: User Guide...User. {{]}]} {}]}

Figure 4-28 Where condition

Figure 4-29 SQL preview

----End

4.2.3 Viewing Table Details

Procedure

Step 1 On the top menu bar, choose Database Management.

Step 2 On the displayed Objects page, select Tables, locate the target table, and clickView in the Operation column.

Data Admin ServiceUser Guide

4 MySQL DB Instance Management (StandardEdition)

Issue 01 (2020-09-27) Copyright © Huawei Technologies Co., Ltd. 51

Page 61: User Guide...User. {{]}]} {}]}

Figure 4-30 Viewing table details

Step 3 In the displayed dialog box, view basic information and SQL statements.

Figure 4-31 Viewing table details

----End

4.2.4 Altering a Table

Procedure

Step 1 On the top menu bar, choose Database Management.

Step 2 On the displayed Objects page, select Tables, locate the target table, and clickAlter in the Operation column.

Step 3 Modify the table information as required. After the modification is complete, clickAlter.

Data Admin ServiceUser Guide

4 MySQL DB Instance Management (StandardEdition)

Issue 01 (2020-09-27) Copyright © Huawei Technologies Co., Ltd. 52

Page 62: User Guide...User. {{]}]} {}]}

Step 4 In the SQL Preview dialog box, click Execute.

----End

4.2.5 Renaming a Table

Procedure

Step 1 On the top menu bar, choose Database Management.

Step 2 On the displayed Objects page, select Tables, locate the target table, and clickRename in the Operation column.

Figure 4-32 Renaming a table

Step 3 In the displayed dialog box, enter a new table name and click OK.

----End

4.2.6 Clearing a Table

NO TICE

Cleared tables cannot be recovered. Exercise caution when performing thisoperation.

Data Admin ServiceUser Guide

4 MySQL DB Instance Management (StandardEdition)

Issue 01 (2020-09-27) Copyright © Huawei Technologies Co., Ltd. 53

Page 63: User Guide...User. {{]}]} {}]}

Procedure

Step 1 On the top menu bar, choose Database Management.

Step 2 On the displayed Objects page, select Tables, locate the target table, and chooseMore > Clear in the Operation column.

Step 3 In the displayed dialog box, click Yes.

----End

4.2.7 Dropping a Table

NO TICE

Dropped tables cannot be recovered. Exercise caution when performing thisoperation.

Procedure

Step 1 On the top menu bar, choose Database Management.

Step 2 On the displayed Objects page, select Tables, locate the target table, and chooseMore > Drop in the Operation column.

Figure 4-33 Dropping a table

Step 3 In the displayed dialog box, click Yes.

----End

4.2.8 Maintaining a Table

ScenariosWhile working with MySQL databases, you do a lot of changes such as data insert,update, and deletion, which may cause table fragmentation. As a result, the

Data Admin ServiceUser Guide

4 MySQL DB Instance Management (StandardEdition)

Issue 01 (2020-09-27) Copyright © Huawei Technologies Co., Ltd. 54

Page 64: User Guide...User. {{]}]} {}]}

database server performance is deteriorated. To handle this, periodic maintenanceis required.

Functions● Optimize

Allows you to optimize tables using the OPTIMIZE TABLE statement and sortout fragmented files for later use.

During the optimization, a read-only lock will be added to target tables.Therefore, optimizing tables during off-peak hours is recommended.

● Check

Allows you to check whether there are errors in database tables using theCHECK TABLE statement. You can check a table with any of the followingmethods:

Check: Scan rows to verify that deleted links are valid. Alternatively, calculatea key checksum for the rows and verifies the validity using the obtainedchecksum.

Quick: Do not scan rows or check for incorrect links.

Fast: Check only tables that have not been closed properly.

Changed: Check only tables that have been changed since the last check ortables that have not been closed properly.

Extended: Search for keywords in each row. This ensures that the table is100% consistent, but takes a long time.

The CHECK TABLE statement adds a read-only lock to the table.

● Repair

Allows you to use the REPAIR TABLE statement to repair possibly corrupted orincorrect tables. You can repair tables using any of the following threemethods:

Check: a simple repair, which repairs data and index files.

Quick: the quickest repair, which repairs only index files, but not data files.

Extended: the slowest repair, which creates indexes row by row to repair dataand index files.

● Analyze

Allows you to analyze database tables using the ANALYZE TABLE statement.During the analysis, a read-only lock is added to the table and data updateand insertion are not allowed.

Procedure

The following uses the Optimize operation as an example to explain how tomaintain tables.

Step 1 On the top menu bar, choose Database Management.

Step 2 On the displayed Objects page, select Tables, locate the target table, and chooseMore > Maintain > Optimize in the Operation column.

Data Admin ServiceUser Guide

4 MySQL DB Instance Management (StandardEdition)

Issue 01 (2020-09-27) Copyright © Huawei Technologies Co., Ltd. 55

Page 65: User Guide...User. {{]}]} {}]}

Step 3 In the displayed dialog box, click Yes.

----End

4.3 View Management

4.3.1 Creating a View

Procedure

Step 1 On the top menu bar, choose Database Management. On the displayed Objectspage, select Views, and click Create View.

Figure 4-34 Creating a view

Step 2 Set the required parameters and click Create.

Data Admin ServiceUser Guide

4 MySQL DB Instance Management (StandardEdition)

Issue 01 (2020-09-27) Copyright © Huawei Technologies Co., Ltd. 56

Page 66: User Guide...User. {{]}]} {}]}

Figure 4-35 Setting required view parameters

Step 3 In the displayed dialog box, click Execute.

Figure 4-36 Script confirmation

----End

4.3.2 Opening a View

Procedure

Step 1 On the top menu bar, choose Database Management. On the displayed Objectspage, select Views, locate the target view, and click Open in the Operationcolumn.

Data Admin ServiceUser Guide

4 MySQL DB Instance Management (StandardEdition)

Issue 01 (2020-09-27) Copyright © Huawei Technologies Co., Ltd. 57

Page 67: User Guide...User. {{]}]} {}]}

Step 2 On the displayed page, check the view details directly or using Where Condition.

Table 4-4 Functions

Item Description

Where Condition Filters records.

Copy Row Copies data of selected rows. Specifically, double-click thetarget row and then click Copy Row.

Copy Column Allows you to copy all data in a column by selecting thiscolumn from the Copy Column drop-down list.

Column Settings Allows you to set the columns you want to display.

Binary toHexadecimal

Prevents binary data in columns from being displayed asgarbled characters. If there is binary data in columns, youmust select this option.

Refresh Allows you to update table data manually.

Row Details Shows the detailed information of a specified row.

Export Exports a maximum of 10,000 data records as CSV or SQLfiles.

NO TE

View data can be only queried, but not be edited, because views do not have primary keys.

----End

4.3.3 Altering a View

Procedure

Step 1 On the top menu bar, choose Database Management. On the displayed Objectspage, select Views, locate the target view, and click Alter in the Operationcolumn.

Data Admin ServiceUser Guide

4 MySQL DB Instance Management (StandardEdition)

Issue 01 (2020-09-27) Copyright © Huawei Technologies Co., Ltd. 58

Page 68: User Guide...User. {{]}]} {}]}

Step 2 On the displayed page, modify the information including the security, algorithm,and view definition statement and click Alter.

Step 3 In the displayed dialog box, click Execute.

----End

4.3.4 Dropping a View

NO TICE

Dropped views cannot be recovered. Exercise caution when performing thisoperation.

Procedure

Step 1 On the top menu bar, choose Database Management. On the displayed Objectspage, select Views, locate the target view, and click Drop View in the Operationcolumn.

Step 2 In the displayed dialog box, click Yes.

----End

4.4 Event Management

Data Admin ServiceUser Guide

4 MySQL DB Instance Management (StandardEdition)

Issue 01 (2020-09-27) Copyright © Huawei Technologies Co., Ltd. 59

Page 69: User Guide...User. {{]}]} {}]}

4.4.1 Creating an Event

Scenarios

This topic describes how to create an event to periodically respond to specificoperations.

When event_scheduler for RDS DB instances is set to ON and the event functionis enabled, you can perform operations on events.

When event_scheduler is set to OFF, but the event function is enabled, you canonly create events and the events do not take effect.

Procedure

Step 1 On the top menu bar, choose Database Management. On the displayed Objectspage, select Events, and click Create Event.

Step 2 Specify an event name (mandatory) and event definition statements (mandatory),set the execution time, status, and comment, and click Create.

● Event Definition Statements

Indicates the SQL statements to be executed when a scheduled event istriggered.

● Dropped upon expiration

Indicates that the events to be executed at a fixed point in time will bedeleted upon they are executed.

Those that are periodically executed will be deleted at the specified end time.

Step 3 In the displayed dialog box, click Execute. If no error is reported, the event takeseffect.

Data Admin ServiceUser Guide

4 MySQL DB Instance Management (StandardEdition)

Issue 01 (2020-09-27) Copyright © Huawei Technologies Co., Ltd. 60

Page 70: User Guide...User. {{]}]} {}]}

----End

4.4.2 Altering an Event

ScenariosThis topic describes how to alter an event.

Procedure

Step 1 On the top menu bar, choose Database Management. On the displayed Objectspage, select Events, locate the target event, and click Alter in the Operationcolumn.

Step 2 On the displayed page, modify the required information and click Alter.

Data Admin ServiceUser Guide

4 MySQL DB Instance Management (StandardEdition)

Issue 01 (2020-09-27) Copyright © Huawei Technologies Co., Ltd. 61

Page 71: User Guide...User. {{]}]} {}]}

Step 3 In the displayed dialog box, click Execute.

----End

4.4.3 Dropping an Event

Procedure

Step 1 On the top menu bar, choose Database Management. On the displayed Objectspage, select Events, locate the target event, and click Drop in the Operationcolumn.

Data Admin ServiceUser Guide

4 MySQL DB Instance Management (StandardEdition)

Issue 01 (2020-09-27) Copyright © Huawei Technologies Co., Ltd. 62

Page 72: User Guide...User. {{]}]} {}]}

Step 2 In the displayed dialog box, click Yes.

NO TICE

Dropped events cannot be recovered. Exercise caution when performing thisoperation.

----End

4.5 Stored Procedure Management

4.5.1 Creating a Stored Procedure

Scenarios

A stored procedure consists of a set of SQL statements that can complete specifictasks or process complex services. This section describes how to create a storedprocedure. You can use loop statements in a stored procedure to insert objectsrepeatedly.

Prerequisites

You have logged in to a MySQL DB instance on the DAS console.

● You have obtained the CREATE ROUTINE permission.

● You have the Execute permission.

Procedure

Step 1 On the top menu bar, choose Database Management. On the displayed Objectspage, select Stored Procedures, and click Create Stored Procedure.

Step 2 In the displayed dialog box, specify a stored procedure name and description andclick OK.

Data Admin ServiceUser Guide

4 MySQL DB Instance Management (StandardEdition)

Issue 01 (2020-09-27) Copyright © Huawei Technologies Co., Ltd. 63

Page 73: User Guide...User. {{]}]} {}]}

Step 3 On the displayed page, click Option to set required parameters and click OK.Then, save and execute the stored procedure.

Step 4 View the execution status in the Message area.

----End

4.5.2 Altering or Executing a Stored Procedure

ProcedureStep 1 On the top menu bar, choose Database Management. On the displayed Objects

page, select Stored Procedures, locate the target procedure, and click Alter orExecute in the Operation column.

Data Admin ServiceUser Guide

4 MySQL DB Instance Management (StandardEdition)

Issue 01 (2020-09-27) Copyright © Huawei Technologies Co., Ltd. 64

Page 74: User Guide...User. {{]}]} {}]}

Step 2 On the displayed page, click Option to set parameters as required and click OK.Then, click Save.

Step 3 Execute the stored procedure and view the execution status in the Message area.

----End

4.5.3 Dropping a Stored Procedure

Procedure

Step 1 On the top menu bar, choose Database Management. On the displayed Objectspage, select Stored Procedures, locate the target stored procedure, and click Dropin the Operation column.

Data Admin ServiceUser Guide

4 MySQL DB Instance Management (StandardEdition)

Issue 01 (2020-09-27) Copyright © Huawei Technologies Co., Ltd. 65

Page 75: User Guide...User. {{]}]} {}]}

Step 2 In the displayed dialog box, click Yes.

NO TICE

Dropped stored procedures cannot be recovered. Exercise caution whenperforming this operation.

----End

4.6 Function Management

4.6.1 Creating a Function

Procedure

Step 1 On the top menu bar, choose Database Management. On the displayed Objectspage, select Functions, and click Create Function.

Step 2 In the displayed dialog box, specify the function name, returned value, anddescription, and click OK.

Step 3 On the displayed page, edit the function body.

Data Admin ServiceUser Guide

4 MySQL DB Instance Management (StandardEdition)

Issue 01 (2020-09-27) Copyright © Huawei Technologies Co., Ltd. 66

Page 76: User Guide...User. {{]}]} {}]}

Step 4 In the upper left corner, click Option. In the displayed dialog box, set requiredparameters and click OK.

Step 5 Click Save, or click Execute and view the status in the Message area.

----End

4.6.2 Altering or Executing a Function

ProcedureStep 1 On the top menu bar, choose Database Management. On the Objects page,

select Functions, locate the target function, and click Alter or Execute Functionin the Operation column.

Data Admin ServiceUser Guide

4 MySQL DB Instance Management (StandardEdition)

Issue 01 (2020-09-27) Copyright © Huawei Technologies Co., Ltd. 67

Page 77: User Guide...User. {{]}]} {}]}

Figure 4-37 Altering or executing a function

Step 2 On the displayed page, click Option and set parameters as required. Then, clickSave to save the settings or click Execute to invoke the function.

Figure 4-38 Altering a function

----End

4.6.3 Dropping a Function

Procedure

Step 1 On the top menu bar, choose Database Management. On the displayed Objectspage, select Functions, locate the target function, and click Drop Function in theOperation column.

Figure 4-39 Dropping a function

Step 2 In the displayed dialog box, click Yes.

NO TICE

Dropped functions cannot be recovered. Exercise caution when performing thisoperation.

----End

Data Admin ServiceUser Guide

4 MySQL DB Instance Management (StandardEdition)

Issue 01 (2020-09-27) Copyright © Huawei Technologies Co., Ltd. 68

Page 78: User Guide...User. {{]}]} {}]}

4.7 Trigger Management

4.7.1 Creating a Database Trigger

Procedure

Step 1 On the top menu bar, choose Database Management. On the displayed Objectspage, select Triggers, and click Create Trigger.

Figure 4-40 Creating a trigger

Step 2 On the displayed page, set required parameters and edit trigger definitionstatements. Then, click Create.

Figure 4-41 Creating a trigger

Step 3 In the displayed dialog box, click Execute.

Data Admin ServiceUser Guide

4 MySQL DB Instance Management (StandardEdition)

Issue 01 (2020-09-27) Copyright © Huawei Technologies Co., Ltd. 69

Page 79: User Guide...User. {{]}]} {}]}

Figure 4-42 Script confirmation

----End

4.7.2 Altering a Trigger

Procedure

Step 1 On the top menu bar, choose Database Management. On the displayed Objectspage, select Triggers, locate the target trigger, and click Alter in the Operationcolumn.

Figure 4-43 Altering a trigger

Step 2 On the displayed page, modify the required parameters and click Alter.

Data Admin ServiceUser Guide

4 MySQL DB Instance Management (StandardEdition)

Issue 01 (2020-09-27) Copyright © Huawei Technologies Co., Ltd. 70

Page 80: User Guide...User. {{]}]} {}]}

Figure 4-44 Editing information

Step 3 In the displayed dialog box, click Execute.

----End

4.7.3 Dropping a Trigger

Procedure

Step 1 On the top menu bar, choose Database Management. On the displayed Objectspage, select Triggers, locate the target trigger, and click Drop Trigger in theOperation column.

Figure 4-45 Dropping a trigger

Step 2 In the displayed dialog box, click Yes.

NO TICE

Dropped triggers cannot be recovered. Exercise caution when performing thisoperation.

----End

4.8 SQL Operations

4.8.1 SQL Window

Prerequisites

You have logged in to a MySQL DB instance on the DAS console.

Data Admin ServiceUser Guide

4 MySQL DB Instance Management (StandardEdition)

Issue 01 (2020-09-27) Copyright © Huawei Technologies Co., Ltd. 71

Page 81: User Guide...User. {{]}]} {}]}

Procedure

Step 1 On the top menu bar, choose SQL Operations > SQL Window.

Step 2 In the navigation pane, specify a database, table, or view.

Figure 4-46 SQL Window

● Execute SQL: executes SQL statements.● Tune SQL: queries the SQL statements that are executed frequently, consume

a large amount of resources, or take a long time to execute.● Execute SQL Plan: reports the execution of SQL statements to facilitate

troubleshooting and optimize SQL processing performance.● SQL Favorites: allows you to add, view, and manage frequently used SQL

statements.● Format SQL: improves the readability of SQL statements. Formatting SQL

statements enables statements to be displayed in line break mode, but doesnot change their logic and semantics.

Figure 4-47 SQL statements before formatting

Data Admin ServiceUser Guide

4 MySQL DB Instance Management (StandardEdition)

Issue 01 (2020-09-27) Copyright © Huawei Technologies Co., Ltd. 72

Page 82: User Guide...User. {{]}]} {}]}

Figure 4-48 SQL statements after formatting

Step 3 After SQL statements are executed, view SQL execution status on the ExecutedSQL Statements, Messages, and Result Set tab pages.

----End

4.8.2 SQL History

PrerequisitesYou have logged in to a MySQL DB instance on the DAS console.

Procedure

Step 1 On the top menu bar, choose SQL Operations > SQL History.

Step 2 On the displayed page, search for execution information about the target SQLstatement by time range, database name, or keyword.● To access the Database Management, click a database name.● To copy and use your required SQL statements, click the SQL statement in the

SQL Statement column.● To directly execute a SQL statement, click Open in SQL Window in the

Operation column.

----End

4.8.3 SQL Execution

PrerequisitesYou have logged in to a MySQL DB instance on the DAS console.

Procedure

Step 1 On the top menu bar, choose SQL Operations > SQL Window. On the displayedpage, select a database from the navigation pane.

Step 2 Enter SQL statements in the SQL window and click Execute SQL.● To protect query result sets from being displayed as garbled characters caused

by UTF-8, the default encoding format, select an encoding format as needed.● To execute multiple SQL statements at a time, separate them using

semicolons (;).

Data Admin ServiceUser Guide

4 MySQL DB Instance Management (StandardEdition)

Issue 01 (2020-09-27) Copyright © Huawei Technologies Co., Ltd. 73

Page 83: User Guide...User. {{]}]} {}]}

● To execute some of the SQL statements, select the statements beforeexecuting them.

● To execute all the SQL statements, do not select any SQL statements or selectall of them.

Figure 4-49 Executing SQL statements

NO TE

"SELECT * FROM name;"

name indicates a table name.

Step 3 View the SQL execution details on Executed SQL Statements and Messages tabpages, including the SQL execution history, execution status, impact scope,execution progress, and elapsed time.

Figure 4-50 Viewing messages

Step 4 View the execution results on the Result Sets tab page.

● If the object has a primary key, you can add, delete, edit, and export data asrequired.

● If the object has a primary key, you can update data, view row details, orexport data as required.

Data Admin ServiceUser Guide

4 MySQL DB Instance Management (StandardEdition)

Issue 01 (2020-09-27) Copyright © Huawei Technologies Co., Ltd. 74

Page 84: User Guide...User. {{]}]} {}]}

Figure 4-51 Viewing result sets

NO TE

– If the result set involves a view, you cannot edit the data.– If the type of the result set is metadata, the data cannot be edited or displayed on

multiple pages.– If the result set involves multiple tables, you cannot edit the data.– If the result set involves only one table and does not include all the primary key

columns of the table or no primary key is found, you cannot edit the data.– Virtual tables (for example, tables generated during SQL execution) cannot be

edited.

----End

4.8.4 SQL Tuning

ScenariosSQL tuning helps you identify the SQL statements that are executed frequently orslowly, and consume large volumes of resources. You can optimize the databaseaccording to the diagnosis suggestions to ensure database stability.

Prerequisites● You have logged in to a MySQL DB instance on the DAS console.● SQL tuning has been performed in the SQL window.

Procedure

Step 1 On the top menu bar, choose SQL Operations > SQL Window. On the displayedpage, click Tune SQL.

Figure 4-52 SQL tuning-1

Data Admin ServiceUser Guide

4 MySQL DB Instance Management (StandardEdition)

Issue 01 (2020-09-27) Copyright © Huawei Technologies Co., Ltd. 75

Page 85: User Guide...User. {{]}]} {}]}

Step 2 On the SQL Tuning page, click Add SQL Performance Tuning to add a SQLtuning task. In the displayed dialog box, enter SQL statements or upload a SQLfile as required, and then click OK.

Figure 4-53 SQL tuning-2

Figure 4-54 SQL tuning-3

Step 3 In the SQL tuning task list, select a database and time range and click Search tofilter tuning reports. Then, click View Details in the Operation column to viewtuning details.

Figure 4-55 SQL tuning

On the displayed diagnosis details page, view the tuning details, including thebasic information, tuning status preview, tuning task list, and optimizationsuggestions.

Data Admin ServiceUser Guide

4 MySQL DB Instance Management (StandardEdition)

Issue 01 (2020-09-27) Copyright © Huawei Technologies Co., Ltd. 76

Page 86: User Guide...User. {{]}]} {}]}

Figure 4-56 SQL tuning details

Figure 4-57 Tuning details

NO TE

● The SQL tuning function obtains the table structure and data distribution information(non-original). The obtained data is only for logic diagnosis, but not stored on the DASserver.

● Obtaining table structure and data distribution information may add additional loads tothe DB instance, but has little impact on its performance.

● Only the SQL diagnosis history is stored on the DAS server. You can delete it from theserver permanently.

----End

4.8.5 SQL Plan Execution

ScenariosThis topic describes how to analyze the execution efficiency of a SQL statement.

PrerequisitesYou have logged in to a MySQL DB instance on the DAS console.

Procedure

Step 1 On the top menu bar, choose SQL Operations > SQL Window. On the displayedpage, select a database from the navigation pane.

Step 2 Enter SQL statements in the SQL window and click Execute SQL Plan.

Data Admin ServiceUser Guide

4 MySQL DB Instance Management (StandardEdition)

Issue 01 (2020-09-27) Copyright © Huawei Technologies Co., Ltd. 77

Page 87: User Guide...User. {{]}]} {}]}

Figure 4-58 Execute SQL Plan

● On the Executed SQL Statements tab page, view the historical SQLexecutions.

● On the Messages tab page, view the execution information, including SQLsplitting, execution status, and elapsed time.

● On the Execution tab page, view the execution status for each SQLstatement.

----End

4.8.6 SQL Favorites

ScenariosDAS allows you to add frequently used SQL statements and view and manage SQLstatements.

PrerequisitesYou have logged in to a MySQL DB instance on the DAS console.

Procedure

Step 1 On the top menu bar, choose SQL Operations > SQL Window.

Step 2 On the displayed page, click SQL Favorites.

Data Admin ServiceUser Guide

4 MySQL DB Instance Management (StandardEdition)

Issue 01 (2020-09-27) Copyright © Huawei Technologies Co., Ltd. 78

Page 88: User Guide...User. {{]}]} {}]}

Figure 4-59 SQL Favorites

● Add SQL: allows you to add your desired SQL statements. Specifically, specifythe title and enter SQL statements as required, and then click Save.

Figure 4-60 Adding SQL statements

● Insert SQL: allows you to insert the SQL statements you have added. If youhave not add any SQL statements yet, this option will not be displayed.

● Manage SQL: allows you to manage frequently used SQL statements,including adding, editing, and deleting statements.

----End

4.9 Import and Export

4.9.1 Data Import

ScenariosThis topic describes how to import data into a table for backup or data migration.The table structure to be imported must be the same as that of the target table. Ifyou import a CSV or SQL file, the data type of the target table must be the same.The imported file should be no larger than 10 GB.

Data Admin ServiceUser Guide

4 MySQL DB Instance Management (StandardEdition)

Issue 01 (2020-09-27) Copyright © Huawei Technologies Co., Ltd. 79

Page 89: User Guide...User. {{]}]} {}]}

Prerequisites

You have logged in to a MySQL DB instance on the DAS console.

Procedure

Step 1 On the top menu bar, choose Import and Export > Import.

Step 2 Import a file from your local PC or an OBS bucket.● From your local PC

On the displayed page, click Create Task. In the displayed dialog box, set FileSource to Upload file, specify the attachment storage, and upload a file fromyour local PC. Then, configure other parameters as required.

For security purposes, imported files are stored in OBS buckets.

NO TE

● To keep data secure, provide your own OBS bucket to store the attachments you upload.In this way, DAS automatically connects to your OBS bucket for in-memory reading.

● If you select Delete the uploaded file upon an import success, the file you upload willbe automatically deleted from the OBS bucket after being imported to the destinationdatabase.

● From an OBS bucketOn the displayed page, click Create Task. In the displayed dialog box, set FileSource to Choose from OBS, and configure other parameters as required.

NO TE

The file uploaded from an OBS bucket will not be deleted upon an import success.

Step 3 After setting the import parameters, click Create. Confirm the information againbefore you click OK because original data may be overwritten after data import.

Step 4 View the import progress in the task list or check task details.

----End

4.9.2 Data Export

Scenarios

DAS supports pagination query to meet your requirements for querying largeamounts of data. You can export all the data at a time when backing up ormigrating data.

Prerequisites

You have logged in to a MySQL DB instance on the DAS console.

Procedure

Step 1 On the top menu bar, choose Import and Export > Export.

Data Admin ServiceUser Guide

4 MySQL DB Instance Management (StandardEdition)

Issue 01 (2020-09-27) Copyright © Huawei Technologies Co., Ltd. 80

Page 90: User Guide...User. {{]}]} {}]}

Step 2 On the displayed page, click Create Task and select Export Database or ExportSQL Result as required. The following takes database export as an example.

Alternatively, click Quick Export and select the target database. In the displayeddialog box, select a storage path and click OK.

Figure 4-61 Quick Export

Step 3 In the displayed dialog box, set required parameters in areas Basic Informationand Advanced Settings, and select the tables to be exported.

Figure 4-62 Creating an export task

Data Admin ServiceUser Guide

4 MySQL DB Instance Management (StandardEdition)

Issue 01 (2020-09-27) Copyright © Huawei Technologies Co., Ltd. 81

Page 91: User Guide...User. {{]}]} {}]}

NO TE

● In a SQL result export task, the executed SQL statements cannot exceed 5 MB.

● Databases are classified into user databases and system databases. System databasecannot be exported. If system database data is required, deploy the services in thesystem database in a created user database, so that you can export the system databasedata from the user database.

● DAS connects to your standby database to export data. This prevents the primarydatabase from being affected by data export. However, if the standby database has ahigh replication delay, the exported data may not be the latest.

Step 4 After settings are complete, click OK.

Step 5 In the task list, view the task ID, type, status, and progress.

Step 6 Click Details in the Operation column to view task details.

Figure 4-63 Task list

----End

Data Admin ServiceUser Guide

4 MySQL DB Instance Management (StandardEdition)

Issue 01 (2020-09-27) Copyright © Huawei Technologies Co., Ltd. 82

Page 92: User Guide...User. {{]}]} {}]}

4.10 Structure Management

4.10.1 Table Structure Comparison and Synchronization

Scenarios

When you perform a migration or verification, you can check the structuredifference by comparing and synchronizing table structures.

Prerequisites

You have logged in to a MySQL DB instance on the DAS console.

Procedure

Step 1 On the top menu bar, choose Structure Management > Table StructureComparison and Synchronization.

Search for tasks by task status and view task details.

Step 2 On the displayed page, click Create Task in the upper left corner.

Step 3 On the displayed page, specify the source database, target instance, targetdatabase, error tolerance, and synchronization type. Click Next.

Step 4 View comparison objects and click Compare.

You can also select the items you want to skip and click Skip to cancel thecomparison.

Step 5 View the comparison progress. In the comparison item list, click View Logs in theOperation column to obtain comparison details. You can also click DownloadDDL as needed.

Data Admin ServiceUser Guide

4 MySQL DB Instance Management (StandardEdition)

Issue 01 (2020-09-27) Copyright © Huawei Technologies Co., Ltd. 83

Page 93: User Guide...User. {{]}]} {}]}

Step 6 Click Next. On the Synchronize page, view the basic information about thiscomparison task, such as the source instance, source database, target instance,target database, and synchronization type, and specify the items to besynchronized.

Step 7 Skip synchronization items that may cause high risks and click Synchronize.

Step 8 After synchronization is complete, click View Logs in the Operation column toobtain comparison details. You can download DDL as required.

----End

4.11 Data Plan

4.11.1 Data Generator

Scenarios

During the functional testing of a program, a large amount of test data complyingwith specific rules needs to be inserted into the database. DAS allows you toautomatically, efficiently generate test data based on specific rules.

Prerequisites

You have logged in to a MySQL DB instance on the DAS console.

Data Admin ServiceUser Guide

4 MySQL DB Instance Management (StandardEdition)

Issue 01 (2020-09-27) Copyright © Huawei Technologies Co., Ltd. 84

Page 94: User Guide...User. {{]}]} {}]}

Method 1

Step 1 On the top menu bar, choose Data Scheme > Data Generator.

Figure 4-64 Generating test data-1

Step 2 On the displayed page, click Create Task. In the displayed dialog box, configurethe required parameters.

Figure 4-65 Creating a data generation task

Figure 4-66 Configuring task parameters

● Rows to GenerateA maximum of 1,000,000 rows of data can be generated.

● Conflict PolicyIf you select Ignore, the system skips the row that contains the conflicts andcontinues processing subsequent rows. If you select Replace, the system

Data Admin ServiceUser Guide

4 MySQL DB Instance Management (StandardEdition)

Issue 01 (2020-09-27) Copyright © Huawei Technologies Co., Ltd. 85

Page 95: User Guide...User. {{]}]} {}]}

deletes the rows that are causing the conflicts prior to inserting data. If aconflict occurs when a row with the same primary key value is inserted, theoriginal rule will be replaced.

● Generation type● You can set the rules for randomly generated data based on the column

settings. For example, if the column type is time, you can set the start time,end time, and format, or set the value to the current time.

Step 3 After setting the task information, click Preview to check whether the generateddata is as expected and then adjust the settings. You can also click Generate toobtain the test data.

Figure 4-67 Data preview

Figure 4-68 Test data generation progress

Step 4 In the task list, view details about the generated tasks in the table. You can alsodelete the task as required.

Data Admin ServiceUser Guide

4 MySQL DB Instance Management (StandardEdition)

Issue 01 (2020-09-27) Copyright © Huawei Technologies Co., Ltd. 86

Page 96: User Guide...User. {{]}]} {}]}

Figure 4-69 Task list

----End

4.11.2 Data Tracking

Scenarios● Audit core data changes, collect statistics on the number of changes, and view

sensitive change information.

For example: the revenue and expense information about a bank, statistics on neworders, and the key configuration change history of the configuration table.

● Roll back the data that is deleted by mistake and restore the data to thestatus before the change.

For example: If the WHERE condition is not added when DBA updates theconfiguration table, the configuration data may be deleted by mistake and a largeamount of dirty data may be generated.

Prerequisites

You have logged in to a MySQL DB instance on the DAS console.

Procedure

Step 1 On the top menu bar, choose Data Scheme > Data Tracking.● Search for tasks by time range or database name.● You can delete tasks as required by selecting check boxes next to task IDs. The

deletion operation is synchronized to DAS.● In the task list, click the task ID to view task details.● In the task list, locate the target task and click View Task in the Operation

column. Then, you can view task details under Task Information, Log Search,and Rollback Task List.

NO TE

A created task will expire in 15 days. Once the task expires, the system automaticallyretrieves and deletes the changes in DAS.

Data Admin ServiceUser Guide

4 MySQL DB Instance Management (StandardEdition)

Issue 01 (2020-09-27) Copyright © Huawei Technologies Co., Ltd. 87

Page 97: User Guide...User. {{]}]} {}]}

Step 2 On the displayed page, click Create Tracking Task. In the displayed dialog box,specify task details, including the task name, time range, and database name.

NO TE

● Users who create the tracking task for the first time need to check and agree to theagreement.

● The default time range for task tracing and rollback is 3 hours.

Step 3 Click Precheck to obtain the operation details at a specific point in time.

NO TE

● During the pre-check, binlog files are displayed based on time range. RDS DB instanceswith the backup function enabled periodically backs up the binlog file to the OBSbucket. The backup delay is no more than five minutes.

● When you create a tracking task, there may be no changes in the latest five minutes. Inthis case, you can create a task again later.

Step 4 Click Read Logs to obtain log details.

When reading logs, the system initiates binlog parsing and stores log changes forfiltering and displaying data.

Data Admin ServiceUser Guide

4 MySQL DB Instance Management (StandardEdition)

Issue 01 (2020-09-27) Copyright © Huawei Technologies Co., Ltd. 88

Page 98: User Guide...User. {{]}]} {}]}

NO TE

● You can search for logs only after all logs are successfully read.● If a new task is started before the last tracking task has not been completely read, it is

normal that the log start time is later than the end time.The following figure shows an example.

A tracing task reads logs from binlogs. If the data read in a task is the one notcompletely read in the previous task, that is, the log end time is the time of the logs inthe previous task, the log end time will be earlier than the start time.

Step 5 Click Log Search to obtain details about the event changes.

Step 6 Create a rollback task if you need to roll back multiple events. Specifically, clickRollback Tasks on the Log Search tab page. In the displayed dialog box, specifyevent IDs and storage of rollback statements, set advanced settings as required,and click OK.

Data Admin ServiceUser Guide

4 MySQL DB Instance Management (StandardEdition)

Issue 01 (2020-09-27) Copyright © Huawei Technologies Co., Ltd. 89

Page 99: User Guide...User. {{]}]} {}]}

NO TE

● The start and end event IDs are the ones in the task list and must be entered inascending order.

● Combing changesIf a record (primary key) is changed for three consecutive times (for example, 1->2->3->4), only the change of the last takes effect.

● Statement TypeGenerate event rollback SQL statements: generates SQL statements with reversechanges based on the images before and after data change.Obtain the original data before changes: generates rollback tables and insertstatements by mirroring before data change.

Step 7 In the rollback task list, view the current rollback task information or create arollback task.

● In the task list, click the task ID to view task details.● Locate the target rollback task and click View Details in the Operation

column to view task details.● In the Operation column, click Download to download the compressed data

package of the task.

NO TE

Changes (such as insert->delete, delete->insert, update->update) on the same recordwill be combined or canceled. Therefore, the generated file may have no rollback SQLstatements or original data.

----End

4.12 CloudDBA

4.12.1 Real-Time Performance

ScenariosWith CloudDBA, you can comprehensively analyze DB instances to understandtheir performance and operating statuses. CloudDBA provides multi-dimensional

Data Admin ServiceUser Guide

4 MySQL DB Instance Management (StandardEdition)

Issue 01 (2020-09-27) Copyright © Huawei Technologies Co., Ltd. 90

Page 100: User Guide...User. {{]}]} {}]}

and real-time performance monitoring information about a single instance,multiple DB instances, and displays performance dashboard of multiple DBinstances.

PrerequisitesYou have logged in to a MySQL DB instance on the DAS console.

Procedure

Step 1 On the top menu bar, choose CloudDBA > Real-Time Performance.

Figure 4-70 Real-Time Performance

Step 2 On the displayed page, view a variety of metrics, including slow SQL queries,connections, QPS/TPS. You can also pause or start the monitoring and set themonitoring interval (1 to 10 seconds).

Step 3 Click Set Metric in the upper right corner to select your required metrics. Thereare 26 performance metrics in total.

Figure 4-71 Real-Time Performance

Data Admin ServiceUser Guide

4 MySQL DB Instance Management (StandardEdition)

Issue 01 (2020-09-27) Copyright © Huawei Technologies Co., Ltd. 91

Page 101: User Guide...User. {{]}]} {}]}

Table 4-5 Real-time performance metrics

Metric Description

Slow Queries Difference between two adjacent slow querycollection points.

QPS | TPS QPS: Number of SQL statement executions persecond.TPS: Number of transactions executed per second.

Connections Total: Number of enabled connections.Active: Number of active connections among theenabled ones.

DML Executions select: Number of SELECT statement executions persecond.insert: Number of INSERT statement executions persecond.update: Number of UPDATE statement executionsper second.delete: Number of DELETE statement executionsper second.insert_select: Number of INSERT and QUERYstatement executions per second.

InnoDB Cache Cache Hit Ratio: Cache hit ratio.Cache Usage: Cache usage.

InnoDB Accessed Rows rows_read: Number of rows read from an InnoDBstorage engine table.rows_inserted: Number of rows inserted into anInnoDB storage engine table.rows_updated: Number of rows updated in anInnoDB storage engine table.rows_deleted: Number of rows deleted from anInnoDB storage engine table.

Logical Reads | PhysicalReads

Logic Reads: Number of logical reads per second.Physical Reads: Number of physical reads persecond.

InnoDB Average RowLock Duration (ms)

Average locking time of InnoDB row locks (ms).

InnoDB Row Lock Waits Average InnoDB Row Lock Waits: Average waittimes of InnoDB row locks.Current InnoDB Row Lock Waits: Number ofcurrent waits of InnoDB row locks.

Data Admin ServiceUser Guide

4 MySQL DB Instance Management (StandardEdition)

Issue 01 (2020-09-27) Copyright © Huawei Technologies Co., Ltd. 92

Page 102: User Guide...User. {{]}]} {}]}

Metric Description

Temporary Tables | Files Temporary tables: Number of temporary tablesthat are automatically created during SQLstatement execution.Temporary files: Number of temporary files thatare automatically created during SQL statementexecution.

Network Traffic Total: Total incoming and outgoing traffic of aninstance.Incoming: Incoming traffic of an instance.Outgoing: Outgoing traffic of an instance.

----End

4.12.2 Real-Time Sessions

ScenariosView the running duration and status of SQL statements online to detect andhandle abnormal processes in a timely manner to ensure that databases runsmoothly.

Prerequisites● You have logged in to a MySQL DB instance on the DAS console.● You have obtained the process permission.

ProcedureStep 1 On the top menu bar, choose CloudDBA > Real-Time Sessions.

Step 2 On the displayed page, view the total sessions, running sessions, and slowsessions.

Figure 4-72 Real-time sessions

Figure 4-73 Sessions

Data Admin ServiceUser Guide

4 MySQL DB Instance Management (StandardEdition)

Issue 01 (2020-09-27) Copyright © Huawei Technologies Co., Ltd. 93

Page 103: User Guide...User. {{]}]} {}]}

Figure 4-74 Slow sessions

● Define slow SQL thresholdSet a slow session threshold and click the refreshing button to filter the slowsessions that exceed this threshold.

----End

4.12.3 Performance History

ScenariosYou can view the service performance history by selecting metrics and specifying atime range.

Prerequisites● You have logged in to a MySQL DB instance on the DAS console.● You have obtained the process permission.

Procedure

Step 1 On the top menu bar, choose CloudDBA > Performance History.

Figure 4-75 Performance History

Step 2 On the Performance History tab page, select metrics for the database, InnoDBstorage engine, and MySQL service process to view historical records of real-timeperformance.

Data Admin ServiceUser Guide

4 MySQL DB Instance Management (StandardEdition)

Issue 01 (2020-09-27) Copyright © Huawei Technologies Co., Ltd. 94

Page 104: User Guide...User. {{]}]} {}]}

Figure 4-76 Specifying metrics

Step 3 Set a time period in the upper right corner so that you can view the DB instanceperformance during this period. Alternatively, click Detail on each metricperformance graph to set the data and time period.

----End

4.12.4 Daily Health Report & One-Click Diagnosis

ScenariosCheck the service security and continuity by viewing different metrics in the healthreport, including slow SQL queries, performance/disks, tablespace, and events.

Prerequisites● You have logged in to a MySQL DB instance on the DAS console.● You have obtained the process permission.

ProcedureStep 1 On the top menu bar, choose CloudDBA > Daily Health Report & One-Click

Diagnosis.

Figure 4-77 Daily Health Report & One-Click Diagnosis

Step 2 On the Diagnosis Overview page, click Diagnose to diagnose the currentinstance or click View History Report to view historical diagnosis reports.

Data Admin ServiceUser Guide

4 MySQL DB Instance Management (StandardEdition)

Issue 01 (2020-09-27) Copyright © Huawei Technologies Co., Ltd. 95

Page 105: User Guide...User. {{]}]} {}]}

Figure 4-78 Diagnosis overview

Figure 4-79 Historical diagnosis reports

Step 3 Under Risks, view the details in a report, including risks, severities, and possiblecauses.

Figure 4-80 Risks

Step 4 Under Specified Analysis, view the details in a report, including slow SQL analysis,performance and disk analysis, performance trend graphs, tablespace analysis, andevent analysis.

NO TE

In the upper right corner of the Daily Reports page, click Download to download thediagnosis report to your local PC. Click Subscribe to email you diagnosis reports.

----End

Data Admin ServiceUser Guide

4 MySQL DB Instance Management (StandardEdition)

Issue 01 (2020-09-27) Copyright © Huawei Technologies Co., Ltd. 96

Page 106: User Guide...User. {{]}]} {}]}

4.12.5 Slow Query Logs

ScenariosAfter the slow SQL function is enabled, DAS automatically stores the SQLstatements for analysis. You can view the SQL text content by viewing slow querylogs.

Prerequisites● You have logged in to a MySQL DB instance on the DAS console.● You have obtained the process permission.

Procedure

Step 1 On the top menu bar, choose CloudDBA > Slow Query Logs.

Figure 4-81 Slow Query Logs

Step 2 On the Log Trends page, click a trend chart to view details about slow query logsin a specified period.

Step 3 On the Details page, view the slow query log details.

Data Admin ServiceUser Guide

4 MySQL DB Instance Management (StandardEdition)

Issue 01 (2020-09-27) Copyright © Huawei Technologies Co., Ltd. 97

Page 107: User Guide...User. {{]}]} {}]}

Figure 4-82 Slow query log details

Step 4 On the Log Archiving tab page, view details about the archived slow query logs.You can also click Download in the Operation column to download the logs toyour local PC.

Figure 4-83 Log archiving

NO TE

Click Generate Latest Log File in the upper right corner to quickly generate the latest slowquery logs.

----End

4.12.6 Emergency Channel

Scenarios

If the maximum number of sessions for an instance has been reached and theinstance cannot be logged in to, you can view and kill unnecessary sessionsthrough the emergency channel.

Prerequisites● You have logged in to a MySQL DB instance on the DAS console.

● You have obtained the process permission.

Data Admin ServiceUser Guide

4 MySQL DB Instance Management (StandardEdition)

Issue 01 (2020-09-27) Copyright © Huawei Technologies Co., Ltd. 98

Page 108: User Guide...User. {{]}]} {}]}

Procedure

Step 1 On the top menu bar, choose CloudDBA > Emergency Channel.

Figure 4-84 Emergency channel

Step 2 On the displayed page, view the description of Emergency Channel.

Figure 4-85 Emergency Channel

Step 3 On the History Logs page, view the sessions that have been killed.

Figure 4-86 History logs

----End

NO TE

A session supports a maximum of three tasks. Close unnecessary sessions temporarily forthe transaction to run properly.

Data Admin ServiceUser Guide

4 MySQL DB Instance Management (StandardEdition)

Issue 01 (2020-09-27) Copyright © Huawei Technologies Co., Ltd. 99

Page 109: User Guide...User. {{]}]} {}]}

4.12.7 Memory Parameter Setting Diagnosis

ScenariosYou can view memory parameter settings online to detect problems in a timelymanner. This prevents high memory usage.

Prerequisites● You have logged in to a MySQL DB instance on the DAS console.● You have obtained the process permission.

Procedure

Step 1 On the top menu bar, choose CloudDBA > Memory Parameter SettingDiagnosis.

Figure 4-87 Memory Parameter Setting Diagnosis

Step 2 On the displayed page, adjust parameter settings to estimate the maximumavailable memory for MySQL.

Data Admin ServiceUser Guide

4 MySQL DB Instance Management (StandardEdition)

Issue 01 (2020-09-27) Copyright © Huawei Technologies Co., Ltd. 100

Page 110: User Guide...User. {{]}]} {}]}

Figure 4-88 Memory Parameter Setting Diagnosis

----End

4.12.8 SQL Tuning

Scenarios

SQL tuning helps you identify the SQL statements that are executed frequently orslowly, and consume large volumes of resources. You can optimize the databaseaccording to the diagnosis suggestions to ensure database stability.

Prerequisites● You have logged in to a MySQL DB instance on the DAS console.

● SQL tuning has been performed in the SQL window.

Procedure

Step 1 On the top menu bar, choose CloudDBA > SQL Tuning.

Figure 4-89 SQL tuning-1

Data Admin ServiceUser Guide

4 MySQL DB Instance Management (StandardEdition)

Issue 01 (2020-09-27) Copyright © Huawei Technologies Co., Ltd. 101

Page 111: User Guide...User. {{]}]} {}]}

Step 2 On the SQL Tuning page, click Add SQL Performance Tuning to add a SQLtuning task. In the displayed dialog box, enter SQL statements or upload a SQLfile as required, and then click OK.

Figure 4-90 SQL tuning-2

Figure 4-91 SQL tuning-3

Step 3 In the SQL tuning task list, select a database and time range and click Search tofilter tuning reports. Then, click View Details in the Operation column to viewtuning details.

Figure 4-92 SQL tuning

On the displayed diagnosis details page, view the tuning details, including thebasic information, tuning status preview, tuning task list, and optimizationsuggestions.

Data Admin ServiceUser Guide

4 MySQL DB Instance Management (StandardEdition)

Issue 01 (2020-09-27) Copyright © Huawei Technologies Co., Ltd. 102

Page 112: User Guide...User. {{]}]} {}]}

Figure 4-93 SQL tuning details

Figure 4-94 Tuning details

NO TE

● The SQL tuning function obtains the table structure and data distribution information(non-original). The obtained data is only for logic diagnosis, but not stored on the DASserver.

● Obtaining table structure and data distribution information may add additional loads tothe DB instance, but has little impact on its performance.

● Only the SQL diagnosis history is stored on the DAS server. You can delete it from theserver permanently.

----End

4.12.9 Tuning Report

ScenariosThe diagnosis report displays the data in the database in a specified period, suchas the real-time performance data, session statistics, slow SQL statements, andSQL tuning content.

Prerequisites● You have logged in to a MySQL DB instance on the DAS console.● You have obtained the process permission.

Data Admin ServiceUser Guide

4 MySQL DB Instance Management (StandardEdition)

Issue 01 (2020-09-27) Copyright © Huawei Technologies Co., Ltd. 103

Page 113: User Guide...User. {{]}]} {}]}

Procedures

Step 1 On the top menu bar, choose CloudDBA > Tuning Report.

Figure 4-95 Tuning Report

Step 2 On the displayed page, click Start Diagnosis. In the displayed dialog box, setduration and frequency and click OK.

Figure 4-96 Starting a diagnosis task

Step 3 Search for diagnosis reports by time range. Click View Report in the Operationcolumn to view report details.

Step 4 On the details page, view metrics such as thread_conn, QPS, and com_del in realtime. You can analyze the diagnosis based on performance data, session statistics,slow SQL statements, and SQL tuning content, and download the diagnosis report.

Figure 4-97 Diagnosis details

----End

Data Admin ServiceUser Guide

4 MySQL DB Instance Management (StandardEdition)

Issue 01 (2020-09-27) Copyright © Huawei Technologies Co., Ltd. 104

Page 114: User Guide...User. {{]}]} {}]}

4.12.10 InnoDB Lock Query

ScenariosInnoDB lock status management allows you to diagnose conflicts during executionof transactions or sessions with a few clicks. By querying the lock status, you canobtain the lock-holding and lock-wait information of transactions, such as thetransaction status, session ID, locked table, and locked data range.

Currently, the InnoDB lock status query is in the open beta test period.

PrerequisitesYou have logged in to a MySQL DB instance on the DAS console.

Procedures1. On the menu bar, choose CloudDBA > InnoDB Lock Wait. If there is no

transaction waiting for a lock, click the refresh button to view the latest lockquery information.

Figure 4-98 InnoDB lock query

2. On the displayed page, the lock-holding and lock-wait information isdisplayed if a transaction is waiting for a lock.

Data Admin ServiceUser Guide

4 MySQL DB Instance Management (StandardEdition)

Issue 01 (2020-09-27) Copyright © Huawei Technologies Co., Ltd. 105

Page 115: User Guide...User. {{]}]} {}]}

Figure 4-99 Querying the InnoDB lock

3. Move the cursor above an icon to view its detailed information.

Figure 4-100 Lock details

4. Click the lock-holding or lock-wait icon. A dialog box for killing the session isdisplayed.

Data Admin ServiceUser Guide

4 MySQL DB Instance Management (StandardEdition)

Issue 01 (2020-09-27) Copyright © Huawei Technologies Co., Ltd. 106

Page 116: User Guide...User. {{]}]} {}]}

Figure 4-101 Killing a session

NO TE

● The default lock wait timeout is 50s. You can modify theinnodb_lock_wait_timeout parameter to change the timeout value.

● The SQL window execution timeout is 300s.

4.12.11 Binlog Query

ScenariosUse binlogs to query historical operations to trace data and quickly locateproblems.

PrerequisitesYou have logged in to a MySQL DB instance on the DAS console.

Procedure

Step 1 On the top menu bar, choose CloudDBA > Binlog Query.

Figure 4-102 Binlog Query-1

Step 2 On the displayed page, click the target file in the binlog file list to view eventdetails.

Data Admin ServiceUser Guide

4 MySQL DB Instance Management (StandardEdition)

Issue 01 (2020-09-27) Copyright © Huawei Technologies Co., Ltd. 107

Page 117: User Guide...User. {{]}]} {}]}

Figure 4-103 Binlog Query-2

----End

4.13 User Management

4.13.1 Creating a User

ScenariosMultiple users with different permissions can be created to access a DB instance ordatabase, but the permissions of these users cannot exceed the operationpermissions of the account.

PrerequisitesYou have logged in to a MySQL DB instance on the DAS console.

Procedure

Step 1 On the top menu bar, choose Other Operations > User Management.

Step 2 On the displayed page, click Create User. Then, configure required information,such as basic information, advanced settings, global permissions, and objectpermissions, and click Save. In the displayed dialog box, click OK.

Figure 4-104 Creating a user

Data Admin ServiceUser Guide

4 MySQL DB Instance Management (StandardEdition)

Issue 01 (2020-09-27) Copyright © Huawei Technologies Co., Ltd. 108

Page 118: User Guide...User. {{]}]} {}]}

Figure 4-105 Specifying parameters

Click Add DAS IP Address to add the DAS IP address to the user whitelist. In theuser management list, edit, rename, or delete the created users.

----End

4.13.2 Editing User Information

ScenariosThis topic describes how to edit user information, including the user name,password, global permissions, object permissions, and advanced settings.

PrerequisitesYou have logged in to a MySQL DB instance on the DAS console.

Procedure

Step 1 On the top menu bar, choose Other Operations > User Management. On thedisplayed page, locate the target username and click Edit in the Operationcolumn.

Data Admin ServiceUser Guide

4 MySQL DB Instance Management (StandardEdition)

Issue 01 (2020-09-27) Copyright © Huawei Technologies Co., Ltd. 109

Page 119: User Guide...User. {{]}]} {}]}

Figure 4-106 Editing user information

Step 2 On the displayed page, edit user information, set global and object permissions,and click Save. In the displayed dialog box, click OK.

----End

4.13.3 Deleting a User

Prerequisites

You have logged in to a MySQL DB instance on the DAS console.

NO TICE

Deleted users cannot be recovered. Exercise caution when performing thisoperation.

Procedure

Step 1 On the top menu bar, choose Other Operations > User Management.

Step 2 On the displayed page, locate the target user and click Delete in the Operationcolumn. In the displayed dialog box, click Yes.

----End

Data Admin ServiceUser Guide

4 MySQL DB Instance Management (StandardEdition)

Issue 01 (2020-09-27) Copyright © Huawei Technologies Co., Ltd. 110

Page 120: User Guide...User. {{]}]} {}]}

4.14 Task Scheduling

PrerequisitesYou have logged in to a MySQL DB instance on the DAS console.

Procedure

Step 1 On the top menu bar, choose Background Tasks > Task Scheduling.

NO TE

You can create a scheduling task only after agreeing to save the SQL statements in thedatabase.

Step 2 On the Scheduling Tasks page, click Create Task.

Step 3 On the displayed page, set the task name, scheduling type, and execution timetolerance.

Upon submission: Indicates that a scheduled task is executed immediately afterbeing submitted. The task is executed only once.

Scheduled: Indicates that a task is executed at a scheduled point in time afterbeing submitted. The task is executed only once.

Periodic: Indicates that a task is executed periodically at the specified time afterbeing submitted.

Execution Time Tolerance: Indicates the length of time (in seconds) to wait for atask to be executed before it is no longer scheduled. However, this will not affectthe task if it is scheduled again later.

Step 4 Under Add SQL Statements, click Add. In the displayed dialog box, set requiredparameters as required and click Save. Then, submit the task.

Data Admin ServiceUser Guide

4 MySQL DB Instance Management (StandardEdition)

Issue 01 (2020-09-27) Copyright © Huawei Technologies Co., Ltd. 111

Page 121: User Guide...User. {{]}]} {}]}

NO TE

After a task is executed, it is automatically displayed in the list of finished tasks.

Step 5 In the task list, view the scheduling type of the task.

You can search for tasks by status, scheduling type, task ID, or task name.

● Click Details in the Operation column to view the task information.Obtain the execution logs and group details from the group list and view theSQL content.Click the task name that is periodically scheduled to go to the TaskInformation page. Then, click Schedule Now to trigger a schedulingimmediately. Additionally, view the execution details on the SchedulingExecution Records tab page.

● Execution Details: Click it to view the task execution details and logs.

Data Admin ServiceUser Guide

4 MySQL DB Instance Management (StandardEdition)

Issue 01 (2020-09-27) Copyright © Huawei Technologies Co., Ltd. 112

Page 122: User Guide...User. {{]}]} {}]}

● View Logs: Click it to view log details.● Terminate: Click it to stop a scheduled task. A stopped task will be moved to

the Finished Tasks list.● Pause: Click it to pause a task. The task in scheduling will become paused.

You can also restore the task as required.

Step 6 On the Finished Tasks page, view tasks that can be executed upon submission orat a scheduled point in time.

You can search for tasks by status, scheduling type, task ID, or task name.

● Click Details in the Operation column to view the task information.Obtain the execution logs and group details from the group list and view ormodify the SQL statement list.

● Click Execution Records in the Operation column to view the task executiondetails, group status, SQL content, and group logs.

● Click View Logs in the Operation column to view log details.● Click Delete in the Operation column to delete selected tasks from a

database.

----End

Data Admin ServiceUser Guide

4 MySQL DB Instance Management (StandardEdition)

Issue 01 (2020-09-27) Copyright © Huawei Technologies Co., Ltd. 113

Page 123: User Guide...User. {{]}]} {}]}

5 Microsoft SQL Server DB InstanceManagement (Standard Edition)

5.1 Overview

5.1.1 Feature Overview

Logging In to a DB Instance

Step 1 Log in to the DAS console.

Step 2 In the login list, locate the DB instance you want to log in to and click Log In inthe Operation column.

----End

DAS Features

Figure 5-1 DAS interface for Microsoft SQL Server DB instances

Data Admin ServiceUser Guide

5 Microsoft SQL Server DB Instance Management(Standard Edition)

Issue 01 (2020-09-27) Copyright © Huawei Technologies Co., Ltd. 114

Page 124: User Guide...User. {{]}]} {}]}

Table 5-1 Functions

No. Item Description

1 Top menu bar Includes entries of the SQL operations, databasemanagement, data import and export, and othermodules.

2 Account informationand logout

Displays the current account information and alogout button.

3 DB instanceinformation

Displays the current database information, such asthe DB engine logo, DB instance name, and DBengine version.

4 Database list Displays the databases of the current DB instance,including user databases and system databases.Allows you to search for a database by name.Allows you to create databases.

5.1.2 Database Management

Prerequisites

You have logged in to a Microsoft SQL Server DB instance on the DAS console.

Overview

You can go to the Database Management page using either of the followingmethods:

● Select Database Management on the top menu bar.● In the database list of the Home page, locate the target database and click

Manage in the Operation column.

Objects

You can manage tables, views, stored procedures, triggers, and functions ofMicrosoft SQL Server databases. The main operations include creating, querying,and modifying objects.

Schemas

Step 1 On the Schemas tab page, click Create Schema in the upper left corner.

Step 2 In the displayed dialog box, enter a schema name and click OK to create aschema.

You can create objects in the created schema.

----End

Data Admin ServiceUser Guide

5 Microsoft SQL Server DB Instance Management(Standard Edition)

Issue 01 (2020-09-27) Copyright © Huawei Technologies Co., Ltd. 115

Page 125: User Guide...User. {{]}]} {}]}

Metadata Collection

DAS periodically collects DB instance metadata such as databases, tables, andfields and stores the collected data in databases. In addition, it collects onlystructural metadata, but not data in user tables, which ensures data security.Metadata collection delivers the following advantages:

● Reduces queries on user databases and the impact on the performance ofuser databases.

● Improves the search performance for DB instances that contain a largenumber of tables and supports pagination queries.

Step 1 On the Database Management page, enable Auto Metadata Collection in theupper right corner and click the Metadata Collection tab.

Step 2 On the displayed page, click Collect Now to start the collection. You can also stopthe collection or view collection details.● Clear Collected Data: Clears the collected data such as metadata, database

structure, and table structure.● Delete Logs: Deletes logs. Deleted logs cannot be restored.

----End

5.1.3 SQL Window

Prerequisites

You have logged in to a Microsoft SQL Server DB instance on the DAS console.

Procedure

Step 1 In the database list of the Home page, locate the target database and click QuerySQL Statements in the Operation column. The SQL Window is displayed.

Step 2 In the navigation pane, specify a database, table, or view.● Execute SQL: executes SQL statements.● Execute SQL Plan: reports the execution of SQL statements to facilitate

troubleshooting and optimize SQL processing performance.● SQL Favorites: allows you to add, view, and manage frequently used SQL

statements.● Format SQL: improves the readability of SQL statements. Formatting SQL

statements enables statements to be displayed in line break mode, but doesnot change their logic and semantics.

----End

5.1.4 Table Creation

Prerequisites

You have logged in to a Microsoft SQL Server DB instance on the DAS console.

Data Admin ServiceUser Guide

5 Microsoft SQL Server DB Instance Management(Standard Edition)

Issue 01 (2020-09-27) Copyright © Huawei Technologies Co., Ltd. 116

Page 126: User Guide...User. {{]}]} {}]}

ScenariosA data table consists of basic information, fields, indexes (optional), foreign keys(optional), and CHECK constraints (optional). Configure these items as required.

Procedure

Step 1 In the database list of the Home page, locate the target database and clickCreate Table in the Operation column.

Step 2 On the displayed page, specify the details under Basic Information (Table Nameand Schema are mandatory). Click Next.

Step 3 On the Column page, click Add and set Column Name, Type, Nullable, PrimaryKey, and Extended Information as needed.● If you do not need to add indexes, foreign keys, or CHECK constraints, directly

click Create. In the displayed SQL Preview dialog box, click Execute.● If you need to add indexes, foreign keys, or CHECK constraints, click Next until

all your desired parameters are specified. After the settings are complete, clickCreate.

NO TE

When you create a foreign key, the type of columns in the referenced table must be thesame as that of included columns, and must be the primary key or have a unique index.

Step 4 In the SQL Preview dialog box, click Execute to create a table.

----End

5.2 Table Management

5.2.1 Creating a Table

PrerequisitesYou have logged in to a Microsoft SQL Server DB instance on the DAS console.

Operation DescriptionA data table consists of basic information, fields, indexes, foreign keys, and CHECKconstraints, among which indexes, foreign keys, and CHECK constraints areoptional. Configure these items as required.

Procedure

Step 1 On the top menu bar, choose Database Management. On the displayed Objectspage, select Tables and click Create Table.

Step 2 On the displayed Basic Information page, specify the table name, schema, tablelock escalation, and comment. Click Next.

Step 3 On the Column page, click Add and set Column Name, Type, Nullable, PrimaryKey, and Extended Information as needed.

Data Admin ServiceUser Guide

5 Microsoft SQL Server DB Instance Management(Standard Edition)

Issue 01 (2020-09-27) Copyright © Huawei Technologies Co., Ltd. 117

Page 127: User Guide...User. {{]}]} {}]}

● If you do not need to add indexes, foreign keys, or CHECK constraints, clickCreate.

● If you need to add indexes, foreign keys, or CHECK constraints, click Next untilall your desired parameters are specified. After the settings are complete, clickCreate.

Step 4 In the SQL Preview dialog box, click Execute to create a table.

----End

5.2.2 Opening a Table

PrerequisitesYou have logged in to a Microsoft SQL Server DB instance on the DAS console.

ScenariosIf a table has primary keys, you can add, delete, modify, or query table data asyou do in Excel.

Procedure

Step 1 On the top menu bar, choose Database Management. On the displayed Objectspage, select Tables, locate the target table, and click Open in the Operationcolumn.

Step 2 On the table details page, double-click a cell to edit data. After adding or editingdata, submit and save the changes.

Table 5-2 Functions

Item Description

Where Condition Filters records.

Copy Row Copies data of selected rows. Specifically, double-click thetarget row and then click Copy Row.

Copy Column Allows you to copy all data in a column by selecting thiscolumn from the Copy Column drop-down list.

Column Settings Allows you to set the columns you want to display.

Refresh Allows you to update table data manually.

Row Details Shows the detailed information of a specified row.

Add Allows you to add rows.

Submit Allows you to submit and save the changes to data.

Delete Row Allows you to delete the selected rows.

Export Exports a maximum of 10,000 data records as CSV or SQLfiles.

Data Admin ServiceUser Guide

5 Microsoft SQL Server DB Instance Management(Standard Edition)

Issue 01 (2020-09-27) Copyright © Huawei Technologies Co., Ltd. 118

Page 128: User Guide...User. {{]}]} {}]}

----End

5.2.3 Viewing Table Details

Prerequisites

You have logged in to a Microsoft SQL Server DB instance on the DAS console.

Procedure

Step 1 On the top menu bar, choose Database Management.

Step 2 On the displayed Objects page, select Tables, locate the target table, and clickView in the Operation column.

Step 3 In the displayed dialog box, view basic table information and DDL information.

----End

5.2.4 Altering a Table

Prerequisites

You have logged in to a Microsoft SQL Server DB instance on the DAS console.

Procedure

Step 1 On the top menu bar, choose Database Management.

Step 2 On the displayed Objects page, select Tables, locate the target table, and clickAlter in the Operation column.

Step 3 Modify the table information as required. After the modification is complete, clickAlter.

Step 4 In the SQL Preview dialog box, click Execute.

----End

5.2.5 Renaming a Table

Prerequisites

You have logged in to a Microsoft SQL Server DB instance on the DAS console.

Procedure

Step 1 On the top menu bar, choose Database Management.

Step 2 On the displayed Objects page, select Tables, locate the target table, and clickRename in the Operation column.

Data Admin ServiceUser Guide

5 Microsoft SQL Server DB Instance Management(Standard Edition)

Issue 01 (2020-09-27) Copyright © Huawei Technologies Co., Ltd. 119

Page 129: User Guide...User. {{]}]} {}]}

Step 3 In the displayed dialog box, enter a new table name and click OK.

----End

5.2.6 Clearing a Table

PrerequisitesYou have logged in to a Microsoft SQL Server DB instance on the DAS console.

NO TICE

Cleared tables cannot be recovered. Exercise caution when performing thisoperation.

Procedure

Step 1 On the top menu bar, choose Database Management.

Step 2 On the displayed Objects page, select Tables, locate the target table, and chooseMore > Clear in the Operation column.

Step 3 In the displayed dialog box, click Yes.

----End

5.2.7 Dropping a Table

PrerequisitesYou have logged in to a Microsoft SQL Server DB instance on the DAS console.

NO TICE

Dropped tables cannot be recovered. Exercise caution when performing thisoperation.

Procedure

Step 1 On the top menu bar, choose Database Management.

Step 2 On the displayed Objects page, select Tables, locate the target table, and chooseMore > Drop in the Operation column.

Step 3 In the displayed dialog box, click Yes.

----End

5.3 View Management

Data Admin ServiceUser Guide

5 Microsoft SQL Server DB Instance Management(Standard Edition)

Issue 01 (2020-09-27) Copyright © Huawei Technologies Co., Ltd. 120

Page 130: User Guide...User. {{]}]} {}]}

5.3.1 Creating a View

Prerequisites

You have logged in to a Microsoft SQL Server DB instance on the DAS console.

Procedure

Step 1 On the top menu bar, choose Database Management. On the displayed Objectspage, select Views, and click Create View.

Step 2 On the displayed page, click Set Template Parameter. In the displayed dialogbox, set parameters as required and click Apply Template.

Step 3 Edit the view information. After the editing is complete, click Save.

----End

5.3.2 Dropping a View

Prerequisites

You have logged in to a Microsoft SQL Server DB instance on the DAS console.

Procedure

Step 1 On the top menu bar, choose Database Management. On the displayed Objectspage, select Views, locate the target view, and click Drop View in the Operationcolumn.

Step 2 In the displayed dialog box, click Yes.

----End

5.3.3 Opening a View

Prerequisites

You have logged in to a Microsoft SQL Server DB instance on the DAS console.

Procedure

Step 1 On the top menu bar, choose Database Management. On the displayed Objectspage, select Views, locate the target view, and click Open in the Operationcolumn.

Step 2 On the displayed page, check the view details directly or using Where Condition.

Data Admin ServiceUser Guide

5 Microsoft SQL Server DB Instance Management(Standard Edition)

Issue 01 (2020-09-27) Copyright © Huawei Technologies Co., Ltd. 121

Page 131: User Guide...User. {{]}]} {}]}

Table 5-3 Functions

Item Description

WhereCondition

Filters records.

Copy Row Copies data of selected rows. Specifically, double-click thetarget row and then click Copy Row.

Copy Column Allows you to copy all data in a column by selecting thiscolumn from the Copy Column drop-down list.

ColumnSettings

Allows you to set the columns you want to display.

Refresh Allows you to update table data manually.

Row Details Shows the detailed information of a specified row.

Export Exports a maximum of 10,000 data records as CSV or SQLfiles. If you choose Export > Export More, the system directsyou to the Export page, and you can create an export task orquickly export data.

NO TE

View data can be only queried, but not be edited, because views do not have primary keys.

----End

5.3.4 Altering a View

PrerequisitesYou have logged in to a Microsoft SQL Server DB instance on the DAS console.

Procedure

Step 1 On the top menu bar, choose Database Management. On the displayed Objectspage, select Views, locate the target view, and click Alter in the Operationcolumn.

Step 2 Modify the view information as required and click Alter.

----End

5.4 Stored Procedure Management

Data Admin ServiceUser Guide

5 Microsoft SQL Server DB Instance Management(Standard Edition)

Issue 01 (2020-09-27) Copyright © Huawei Technologies Co., Ltd. 122

Page 132: User Guide...User. {{]}]} {}]}

5.4.1 Creating a Stored Procedure

Scenarios

A stored procedure consists of a set of SQL statements that can complete specifictasks or process complex services. This topic describes how to create a storedprocedure. You can use loop statements in a stored procedure to insert objectsrepeatedly.

Prerequisites

You have logged in to a Microsoft SQL Server DB instance on the DAS console.

● You have obtained the CREATE PROCEDURE permission.

Procedure

Step 1 On the top menu bar, choose Database Management. On the displayed Objectspage, select Stored Procedures, and click Create Stored Procedure.

Step 2 On the displayed page, click Set Template Parameter. In the displayed dialogbox, set parameters as required and click OK.

Step 3 Click Execute. In the dialog box, set input parameters and click Execute.

Step 4 View the execution status on the Message and Result Set tab pages after theexecution of the stored procedure.

----End

5.4.2 Altering or Executing a Stored Procedure

Prerequisites

You have logged in to a Microsoft SQL Server DB instance on the DAS console.

Procedure

Step 1 On the top menu bar, choose Database Management. On the displayed Objectspage, select Stored Procedures, locate the target procedure, and click Alter orExecute in the Operation column.

Step 2 On the displayed page, edit the content and click Save.

Step 3 Click Execute. In the displayed dialog box, set the input parameters and clickExecute.

Step 4 View the execution status in the Message area.

----End

Data Admin ServiceUser Guide

5 Microsoft SQL Server DB Instance Management(Standard Edition)

Issue 01 (2020-09-27) Copyright © Huawei Technologies Co., Ltd. 123

Page 133: User Guide...User. {{]}]} {}]}

5.4.3 Dropping a Stored Procedure

PrerequisitesYou have logged in to a Microsoft SQL Server DB instance on the DAS console.

NO TICE

Dropped stored procedures cannot be recovered. Exercise caution whenperforming this operation.

Procedure

Step 1 On the top menu bar, choose Database Management. On the displayed Objectspage, select Stored Procedures, locate the target stored procedure, and click Dropin the Operation column.

Step 2 In the displayed dialog box, click Yes.

----End

5.4.4 Viewing Stored Procedure Details

PrerequisitesYou have logged in to a Microsoft SQL Server DB instance on the DAS console.

Procedure

Step 1 On the top menu bar, choose Database Management. On the displayed Objectspage, select Stored Procedures, locate the target stored procedure, and click ViewDetails in the Operation column.

Step 2 In the displayed dialog box, view the stored procedure details.

----End

5.5 Trigger Management

5.5.1 Creating a Trigger

PrerequisitesYou have logged in to a Microsoft SQL Server DB instance on the DAS console.

Procedure

Step 1 On the top menu bar, choose Database Management. On the displayed Objectspage, select DB Triggers, and click Create Trigger.

Data Admin ServiceUser Guide

5 Microsoft SQL Server DB Instance Management(Standard Edition)

Issue 01 (2020-09-27) Copyright © Huawei Technologies Co., Ltd. 124

Page 134: User Guide...User. {{]}]} {}]}

Step 2 On the displayed page, click Set Template Parameter. In the displayed dialogbox, set parameters as required and click OK.

Step 3 Edit the content and click Save.

----End

5.5.2 Altering a Trigger

PrerequisitesYou have logged in to a Microsoft SQL Server DB instance on the DAS console.

Procedure

Step 1 On the top menu bar, choose Database Management. On the displayed Objectspage, select DB Triggers, locate the target trigger, and click Alter in theOperation column.

Step 2 On the displayed page, edit the content and click Save.

----End

5.5.3 Dropping a Trigger

PrerequisitesYou have logged in to a Microsoft SQL Server DB instance on the DAS console.

NO TICE

Dropped triggers cannot be recovered. Exercise caution when performing thisoperation.

Procedure

Step 1 On the top menu bar, choose Database Management. On the displayed Objectspage, select Triggers, locate the target trigger, and click Drop in the Operationcolumn.

Step 2 In the displayed dialog box, click Yes.

----End

5.6 Function Management

5.6.1 Creating a Function

PrerequisitesYou have logged in to a Microsoft SQL Server DB instance on the DAS console.

Data Admin ServiceUser Guide

5 Microsoft SQL Server DB Instance Management(Standard Edition)

Issue 01 (2020-09-27) Copyright © Huawei Technologies Co., Ltd. 125

Page 135: User Guide...User. {{]}]} {}]}

Procedure

Step 1 On the top menu bar, choose Database Management. On the displayed Objectspage, select Functions, select a schema, and click Create Function.

Step 2 In the displayed dialog box, select a function type and click OK.

Step 3 On the displayed page, click Set Template Parameter. In the displayed dialogbox, set parameters as required and click OK.

Step 4 Click Save to complete the creation, or click Execute to invoke the function andview the result in the Message area.

----End

5.6.2 Altering or Executing a Function

PrerequisitesYou have logged in to a Microsoft SQL Server DB instance on the DAS console.

Procedure

Step 1 On the top menu bar, choose Database Management. On the Objects page,select Functions, locate the target function, and click Alter or Execute Functionin the Operation column.

Step 2 On the displayed page, modify the content as required. Then, click Save tocomplete the modification, or click Execute to invoke the function.

Step 3 View the execution result.

----End

5.6.3 Dropping a Function

PrerequisitesYou have logged in to a Microsoft SQL Server DB instance on the DAS console.

NO TICE

Dropped functions cannot be recovered. Exercise caution when performing thisoperation.

Procedure

Step 1 On the top menu bar, choose Database Management. On the displayed Objectspage, select Functions, locate the target function, and click Drop Function in theOperation column.

Step 2 In the displayed dialog box, click Yes.

----End

Data Admin ServiceUser Guide

5 Microsoft SQL Server DB Instance Management(Standard Edition)

Issue 01 (2020-09-27) Copyright © Huawei Technologies Co., Ltd. 126

Page 136: User Guide...User. {{]}]} {}]}

5.6.4 Viewing Function Details

PrerequisitesYou have logged in to a Microsoft SQL Server DB instance on the DAS console.

Procedure

Step 1 On the top menu bar, choose Database Management. On the displayed Objectspage, select Functions, locate the target function, and click View Function in theOperation column.

Step 2 In the displayed dialog box, view the function details.

----End

5.7 SQL Operations

5.7.1 SQL Window

PrerequisitesYou have logged in to a Microsoft SQL Server DB instance on the DAS console.

Procedure

Step 1 On the top menu bar, choose SQL Operations > SQL Window.

NO TE

You can click Switch SQL Execution Node to switch to the standby database to executescheduled task scripts and configure the database link.

Step 2 In the navigation pane, specify a database, table, or view.● Execute SQL: executes SQL statements.● Execute SQL Plan: reports the execution of SQL statements to facilitate

troubleshooting and optimize SQL processing performance.● SQL Favorites: allows you to add, view, and manage frequently used SQL

statements.

Data Admin ServiceUser Guide

5 Microsoft SQL Server DB Instance Management(Standard Edition)

Issue 01 (2020-09-27) Copyright © Huawei Technologies Co., Ltd. 127

Page 137: User Guide...User. {{]}]} {}]}

● Format SQL: improves the readability of SQL statements. Formatting SQLstatements enables statements to be displayed in line break mode, but doesnot change their logic and semantics.

----End

5.7.2 SQL History

PrerequisitesYou have logged in to a Microsoft SQL Server DB instance on the DAS console.

Procedure

Step 1 On the top menu bar, choose SQL Operations > SQL History.

Step 2 On the displayed page, search for execution information about the target SQLstatement by time range, database name, or keyword.● To access the Database Management, click a database name.● To copy and use your required SQL statements, click the SQL statement in the

SQL Statement column.● To directly execute a SQL statement, click Open in SQL Window in the

Operation column.

----End

5.8 Import and Export

5.8.1 Data Import

Operation DescriptionThis topic describes how to import data into a table for backup or data migration.The table structure to be imported must be the same as that of the target table. Ifyou import a CSV or SQL file, the data type of the target table must be the same.Only one file that is no larger than 10 GB can be imported at a time.

PrerequisitesYou have logged in to a Microsoft SQL Server DB instance on the DAS console.

Procedure

Step 1 On the top menu bar, choose Import and Export > Import.

Step 2 Import a file from your local PC or an OBS bucket.● From your local PC

On the displayed page, click Create Task. In the displayed dialog box, set FileSource to Upload file, specify the attachment storage, and upload a file fromyour local PC. Then, configure other parameters as required.

Data Admin ServiceUser Guide

5 Microsoft SQL Server DB Instance Management(Standard Edition)

Issue 01 (2020-09-27) Copyright © Huawei Technologies Co., Ltd. 128

Page 138: User Guide...User. {{]}]} {}]}

For security purposes, imported files are stored in OBS buckets.

NO TE

● To keep data secure, provide your own OBS bucket to store the attachments you upload.In this way, DAS automatically connects to your OBS bucket for in-memory reading.

● If you select Delete the uploaded file upon an import success, the file you upload willbe automatically deleted from the OBS bucket after being imported to the destinationdatabase.

● From an OBS bucketOn the displayed page, click Create Task. In the displayed dialog box, set FileSource to Choose from OBS, and configure other parameters as required.

NO TE

The file uploaded from an OBS bucket will not be deleted upon an import success.

Step 3 After settings are complete, click Create. Confirm the information again beforeyou click OK because original data may be overwritten after data import.

Step 4 View the import progress in the task list or check task details.

----End

5.8.2 Data Export

ScenariosDAS supports pagination query to meet your requirements for querying largeamounts of data. You can export all the data at a time when backing up ormigrating data.

PrerequisitesYou have logged in to a Microsoft SQL Server DB instance on the DAS console.

Procedure

Step 1 On the top menu bar, choose Import and Export > Export.

Step 2 On the displayed page, click Create Task and select Export Database or ExportSQL Result as required. The following takes database export as an example.

Alternatively, you can click Quick Export to export the specified databaseinformation quickly.

Step 3 In the displayed dialog box, set required parameters in areas Basic Informationand Advanced Settings, and select the tables to be exported.

Step 4 After settings are complete, click OK.

Step 5 In the task list, view the task ID, type, status, and progress.

Step 6 Click Details in the Operation column to view task details.

----End

Data Admin ServiceUser Guide

5 Microsoft SQL Server DB Instance Management(Standard Edition)

Issue 01 (2020-09-27) Copyright © Huawei Technologies Co., Ltd. 129

Page 139: User Guide...User. {{]}]} {}]}

5.9 CloudDBA

5.9.1 Real-Time Sessions

Scenarios

View the running duration and status of SQL statements online to detect andhandle abnormal processes in a timely manner to ensure that databases runsmoothly.

Prerequisites

You have logged in to a Microsoft SQL Server DB instance on the DAS console.

Procedure

Step 1 On the top menu bar, choose CloudDBA > Real-Time Sessions.

Step 2 On the displayed page, view the running sessions, session execution duration,session list, and slow sessions.● In the upper left area, the chart shows the number of global sessions, which

keeps the same as the search criteria change.● In the upper right area, the graph shows the query results based on your

search criteria.● Kill a session.

Select an abnormal session and click Kill to kill it so that the database canrecover.

● Query specified sessions by filters.Search for sessions by user, host, or database. The two search boxes areassociated.

● Set slow SQL threshold.Set a slow session threshold and click Refresh to filter the slow sessions thatexceed this threshold.

----End

5.10 Other Operations

5.10.1 Login Name

Scenarios

You can create login accounts with different permissions for accessing databasesto enhance data management security.

Data Admin ServiceUser Guide

5 Microsoft SQL Server DB Instance Management(Standard Edition)

Issue 01 (2020-09-27) Copyright © Huawei Technologies Co., Ltd. 130

Page 140: User Guide...User. {{]}]} {}]}

Prerequisites

You have logged in to a Microsoft SQL Server DB instance on the DAS console.

Procedure

Step 1 On the top menu bar, choose Other Operations > Login Name.

Step 2 On the displayed page, click Create Login Name. Set parameters on the BasicSettings, Server Roles, User Mapping, Securables, and Status tab pagesseparately, and click Save.

Step 3 Click Back to Login Name List and view the newly added login name.

Step 4 In the login name list, edit, rename, or delete the created login names as required.

----End

5.10.2 Database User Management

Prerequisites

You have logged in to a Microsoft SQL Server DB instance on the DAS console.

Procedure

Step 1 On the top menu bar, choose Other Operations > Database User Management.

Step 2 On the displayed page, select a database and click Create User.

Step 3 On the displayed page, set parameters under the Basic Settings, OwnedSchemas, Membership, and Securables tab pages separately, and click Save.

Step 4 In the displayed SQL Preview dialog box, click OK.

Step 5 In the user management list, edit, rename, or delete the created users.

----End

5.10.3 Database Role Management

Prerequisites

You have logged in to a Microsoft SQL Server DB instance on the DAS console.

Procedure

Step 1 On the top menu bar, choose Other Operations > Database Role Management.

Step 2 On the displayed page, select a database and click Create Role.

Step 3 On the displayed page, set parameters on the Basic Settings, Owned Schemas,Role Member, and Securables tab pages.

Step 4 Click Save. In the displayed SQL Preview dialog box, click OK.

Data Admin ServiceUser Guide

5 Microsoft SQL Server DB Instance Management(Standard Edition)

Issue 01 (2020-09-27) Copyright © Huawei Technologies Co., Ltd. 131

Page 141: User Guide...User. {{]}]} {}]}

Step 5 In the role management list, view information of database roles.

----End

Data Admin ServiceUser Guide

5 Microsoft SQL Server DB Instance Management(Standard Edition)

Issue 01 (2020-09-27) Copyright © Huawei Technologies Co., Ltd. 132

Page 142: User Guide...User. {{]}]} {}]}

6 DDS DB Instance Management(Standard Edition)

6.1 Home Page

6.1.1 Overview

Logging In to a DB Instance

Step 1 Log in to the DAS console.

Step 2 In the login list, locate the DB instance you want to log in to and click Log In inthe Operation column.

----End

Feature Overview

Figure 6-1 DAS interface for DDS DB instances

Data Admin ServiceUser Guide 6 DDS DB Instance Management (Standard Edition)

Issue 01 (2020-09-27) Copyright © Huawei Technologies Co., Ltd. 133

Page 143: User Guide...User. {{]}]} {}]}

Table 6-1 Functions

No. Item Description

1 Top menu bar Includes entries of the command operations,database management, and other operations.

2 Account informationand logout

Displays the current account information and alogout button.

3 DB instanceinformation

Displays the current database information, such asthe DB engine logo, DB instance name, and DBengine version.

4 Database list Displays the databases of the current DB instance,including user databases and system databases.● Allows you to search for a database by name.● Allows you to create databases.

6.1.2 Creating a Database

Prerequisites

You have logged in to a DDS DB instance on the DAS console.

Procedure

Step 1 In the database list of the Home page, click Create Database.

Step 2 On the displayed page, enter the database name and collection name.

NO TE

You must enter a collection name when creating a database. If not, default value test willbe used.

Step 3 Click OK. The database that you have created appears in the database list.

----End

6.1.3 Database Management

Prerequisites

You have logged in to a DDS DB instance on the DAS console.

Overview

You can go to the Database Management page using either of the followingmethods:

● Select Database Management on the top menu bar.

Data Admin ServiceUser Guide 6 DDS DB Instance Management (Standard Edition)

Issue 01 (2020-09-27) Copyright © Huawei Technologies Co., Ltd. 134

Page 144: User Guide...User. {{]}]} {}]}

● In the database list of the Home page, locate the target database and clickManage in the Operation column.

Objects

On the Objects page, you can manage collections and views. For details, seeCollection Management and View Management.

6.1.4 Command Window

Prerequisites

You have logged in to a DDS DB instance on the DAS console.

Procedure

Step 1 In the database list of the Home page, locate the target database and click Queryin the Operation column.

Step 2 In the displayed text box, enter the commands you want to execute and clickExecute Command.

Step 3 In the lower part of the page, view the execution results.

Data Admin ServiceUser Guide 6 DDS DB Instance Management (Standard Edition)

Issue 01 (2020-09-27) Copyright © Huawei Technologies Co., Ltd. 135

Page 145: User Guide...User. {{]}]} {}]}

● On the Executed Commands tab page, view the details about the commandsthat have been executed.

● On the Messages tab page, view the execution results (successful or failed)and execution duration of current commands.

● On the Result Set tab page, you can view the result set in JSON, tree, or tablemode.

----End

6.1.5 Dropping a Database

PrerequisitesYou have logged in to a DDS DB instance on the DAS console.

NO TICE

Dropped databases cannot be restored.

Procedure

Step 1 In the database list of the Home page, locate the database you want to drop andclick Drop in the Operation column.

Step 2 In the displayed dialog box, click Yes.

----End

6.2 Command Operation

6.2.1 Command Window

PrerequisitesYou have logged in to a DDS DB instance on the DAS console.

Data Admin ServiceUser Guide 6 DDS DB Instance Management (Standard Edition)

Issue 01 (2020-09-27) Copyright © Huawei Technologies Co., Ltd. 136

Page 146: User Guide...User. {{]}]} {}]}

Procedure

Step 1 On the top menu bar, choose Command Operation > Command Window.

Step 2 In the displayed text box, enter the commands you want to execute and clickExecute Command.

NO TE

● To ensure that your executed records are traceable, you are advised to enable SaveExecuted Commands.

When this function is enabled, the commands executed lately will be saved to theserver, and you can view the executed commands on the Executed Commands tabpage.

● Currently, the db.collection.aggregate() command is not supported. You can run thedb.runCommand command instead.

Step 3 In the lower part of the page, view the execution results.

● On the Executed Commands tab page, view the details about the commandsthat have been executed.

● On the Messages tab page, view the execution results (successful or failed)and execution duration of current commands.

Data Admin ServiceUser Guide 6 DDS DB Instance Management (Standard Edition)

Issue 01 (2020-09-27) Copyright © Huawei Technologies Co., Ltd. 137

Page 147: User Guide...User. {{]}]} {}]}

● On the Result Set tab page, you can view the result set in JSON, tree, or tablemode.

----End

6.2.2 Command History

Prerequisites● You have logged in to a DDS DB instance on the DAS console.● You have enabled Save Executed Commands in the command window.

Procedure

Step 1 On the top menu bar, choose Command Operation > Command History.

Step 2 In the command execution list, view the execution records.

● You can search execution records by time range, database name, or keyword.● Database name: Click a database name to go to the database management

page.● SQL Statement: Click a statement view or copy it.● Open in command window: Click it to view the executed commands in a

window for easy view and use.

----End

6.3 Collection Management

6.3.1 Creating a Collection

Prerequisites

You have logged in to a DDS DB instance on the DAS console.

Procedure

Step 1 On the top menu bar, choose Database Management.

Step 2 On the displayed Objects page, select Collections, and click New Collection.

Step 3 On the displayed page, enter the collection name. You can select Cappedcollection, Auto index, and No padding as required.

Data Admin ServiceUser Guide 6 DDS DB Instance Management (Standard Edition)

Issue 01 (2020-09-27) Copyright © Huawei Technologies Co., Ltd. 138

Page 148: User Guide...User. {{]}]} {}]}

● Capped collection: Set the maximum number of bytes and the maximumnumber of documents. If the specified value is reached, an error is reported.The value specified must be greater than 0.

● Auto index: Automatically create an index on the _id field.● No padding: A storage policy that eliminates the need to reserve storage

space for the growth of a record when inserting it.

Step 4 After setting the collection information, click OK. The collection that you havecreated appears in the collection list, and you can perform operations on it.

----End

6.3.2 Opening a Collection

Prerequisites

You have logged in to a DDS DB instance on the DAS console.

Procedure

Step 1 On the top menu bar, choose Database Management.

Step 2 On the displayed Objects page, select Collections, locate the target collection,and click Open Collection in the Operation column.

Step 3 Set parameters Query, Projection, Sort, Limit, and Skip to query the currentcollection documents.

Data Admin ServiceUser Guide 6 DDS DB Instance Management (Standard Edition)

Issue 01 (2020-09-27) Copyright © Huawei Technologies Co., Ltd. 139

Page 149: User Guide...User. {{]}]} {}]}

On the JSON tab page, view the filtered documents. To facilitate viewing, DASallows you to view the documents in Table and Tree mode.

NO TE

● Projection: mapping condition.

● Sort: sorting condition.

● Query: query criteria.

● Limit: maximum number of records.

● Skip: pagination condition.

Step 4 Click Create Document. On the displayed page, enter a valid JSON file and clickSave.

NO TE

Currently, RegExp, BinData, and function data types cannot be edited.

----End

Data Admin ServiceUser Guide 6 DDS DB Instance Management (Standard Edition)

Issue 01 (2020-09-27) Copyright © Huawei Technologies Co., Ltd. 140

Page 150: User Guide...User. {{]}]} {}]}

6.3.3 Altering Validator

PrerequisitesYou have logged in to a DDS DB instance on the DAS console.

Procedure

Step 1 On the top menu bar, choose Database Management.

Step 2 On the displayed Objects page, select Collections, locate the target collection,and click Alter Validator in the Operation column.

Step 3 On the displayed page, edit the validation rule and set the validation level andaction. Then, click OK.

Data Admin ServiceUser Guide 6 DDS DB Instance Management (Standard Edition)

Issue 01 (2020-09-27) Copyright © Huawei Technologies Co., Ltd. 141

Page 151: User Guide...User. {{]}]} {}]}

NO TE

● Options for Validation Level include:

strict: a strict validation level.

moderate: a moderate validation level.

off: no validation level.

● Options for Validation Action include:

error

warn

----End

6.3.4 Renaming a Collection

Prerequisites

You have logged in to a DDS DB instance on the DAS console.

Procedure

Step 1 On the top menu bar, choose Database Management.

Step 2 On the displayed Objects page, select Collections, locate the target collection,and click Rename in the Operation column.

Step 3 On the displayed page, set a new name for the collection and click OK.

----End

6.3.5 Clearing a Collection

Prerequisites

You have logged in to a DDS DB instance on the DAS console.

NO TICE

Cleared collections cannot be recovered. Exercise caution when performing thisoperation.

Procedure

Step 1 On the top menu bar, choose Database Management.

Step 2 On the displayed Objects page, select Collections, locate the target collection,and click Clear in the Operation column.

Step 3 In the displayed dialog box, click Yes.

----End

Data Admin ServiceUser Guide 6 DDS DB Instance Management (Standard Edition)

Issue 01 (2020-09-27) Copyright © Huawei Technologies Co., Ltd. 142

Page 152: User Guide...User. {{]}]} {}]}

6.3.6 Dropping a Collection

PrerequisitesYou have logged in to a DDS DB instance on the DAS console.

NO TICE

Dropped collections cannot be recovered. Exercise caution when performing thisoperation.

Procedure

Step 1 On the top menu bar, choose Database Management.

Step 2 On the displayed Objects page, select Collections, locate the target collection,and click Delete in the Operation column.

Step 3 In the displayed dialog box, click Yes.

----End

6.4 View Management

6.4.1 Creating a View

PrerequisitesYou have logged in to a DDS DB instance on the DAS console.

Procedure

Step 1 On the top menu bar, choose Database Management.

Step 2 On the displayed Objects page, select Views, and click Create View.

Step 3 Enter the view name and collection name.

Step 4 On the Aggregation Pipeline tab, click Add Pipeline Stage. On the displayedpage, select an operator, edit the expression, and click Save.

The aggregation pipeline that you have created appears in the list, and you canedit, delete, move up, or move down it.

Data Admin ServiceUser Guide 6 DDS DB Instance Management (Standard Edition)

Issue 01 (2020-09-27) Copyright © Huawei Technologies Co., Ltd. 143

Page 153: User Guide...User. {{]}]} {}]}

Step 5 On the Collation page, click Custom Collation and set collation rules as needed.

Step 6 After setting the view information, click Save.

----End

6.4.2 Opening a View

Prerequisites

You have logged in to a DDS DB instance on the DAS console.

Procedure

Step 1 On the top menu bar, choose Database Management.

Step 2 On the displayed Objects page, select Views, locate the target view, and clickOpen in the Operation column.

Step 3 Set parameters Query, Projection, Sort, Limit, and Skip to query the currentcollection documents.

On the JSON tab page, view the filtered documents. To facilitate viewing, DASallows you to view the documents in Table and Tree mode.

----End

6.4.3 Editing a View

Prerequisites

You have logged in to a DDS DB instance on the DAS console.

Data Admin ServiceUser Guide 6 DDS DB Instance Management (Standard Edition)

Issue 01 (2020-09-27) Copyright © Huawei Technologies Co., Ltd. 144

Page 154: User Guide...User. {{]}]} {}]}

Procedure

Step 1 On the top menu bar, choose Database Management.

Step 2 On the displayed Objects page, select Views, locate the target view, and click Editin the Operation column.

Step 3 Change the collection name.

Step 4 On the Aggregation Pipeline tab, click Add Pipeline Stage. On the displayedpage, select an operator, edit the expression, and click Save.

The aggregation pipeline that you have created appears in the list, and you canedit, delete, move up, or move down it.

Step 5 If you have set a collation as a custom one, click Custom Collation to set thecollation rules as needed.

Step 6 After setting the view information, click Save.

----End

6.4.4 Dropping a View

Prerequisites

You have logged in to a DDS DB instance on the DAS console.

NO TICE

Dropped views cannot be recovered. Exercise caution when performing thisoperation.

Procedure

Step 1 On the top menu bar, choose Database Management.

Step 2 On the displayed Objects page, select Views, locate the target view, and clickDrop in the Operation column.

Data Admin ServiceUser Guide 6 DDS DB Instance Management (Standard Edition)

Issue 01 (2020-09-27) Copyright © Huawei Technologies Co., Ltd. 145

Page 155: User Guide...User. {{]}]} {}]}

Step 3 In the displayed dialog box, click Yes.

----End

6.5 Other Operations

6.5.1 User Management

PrerequisitesYou have logged in to a DDS DB instance on the DAS console.

Procedure

Step 1 On the top menu bar, choose Other Operations > User Management.

Step 2 In the upper left corner, select the database for which the user is to be createdfrom the Database drop-down list and click Create User.

Step 3 On the displayed page, enter the username and password, and confirm thepassword.

Step 4 On the Role tab page, click Add Roles. In the displayed dialog box, select the rolesyou want to add and click Add. Then, on the Custom Data tab page, customizedata as needed.

NO TE

If you assign a role from another database to this created user, the user has the operationpermissions on that database.

Step 5 After setting required parameters, click Save. In the preview dialog box, click OK.

----End

6.5.2 Role Management

PrerequisitesYou have logged in to a DDS DB instance on the DAS console.

Data Admin ServiceUser Guide 6 DDS DB Instance Management (Standard Edition)

Issue 01 (2020-09-27) Copyright © Huawei Technologies Co., Ltd. 146

Page 156: User Guide...User. {{]}]} {}]}

Procedure

Step 1 On the top menu bar, choose Other Operations > Role Management.

Step 2 In the upper left corner, select the database for which the roles are to be createdfrom the Database drop-down list and click Add Roles.

Step 3 On the displayed page, enter the role name. Then, on the Permission tab page,click Add Privileges. In the displayed dialog box, specify required parameters andclick Add.

Step 4 On the Role tab page, click Add Roles. In the displayed dialog box, select the rolesyou want to add and click Add.

Step 5 After setting the roles, click Save.

Data Admin ServiceUser Guide 6 DDS DB Instance Management (Standard Edition)

Issue 01 (2020-09-27) Copyright © Huawei Technologies Co., Ltd. 147

Page 157: User Guide...User. {{]}]} {}]}

NO TE

1. If a role is created for the admin database, you can select other databases when addingprivileges or roles, to grant the privileges of other databases to this role.

2. Users with this role have the permissions to operate the selected database.

----End

Data Admin ServiceUser Guide 6 DDS DB Instance Management (Standard Edition)

Issue 01 (2020-09-27) Copyright © Huawei Technologies Co., Ltd. 148

Page 158: User Guide...User. {{]}]} {}]}

7 PostgreSQL DB Instance Management(Standard Edition)

7.1 Overview

7.1.1 Feature Overview

Logging In to a DB Instance

Step 1 Log in to the DAS console.

Step 2 In the login list, locate the DB instance you want to log in to and click Log In inthe Operation column.

For details, see Logging In to a Database (Using DAS).

----End

DAS Features

This topic briefly describes the page for managing databases to help you betterunderstand DAS.

Table 7-1 Functions

No. Item Description

1 Top menu bar Provides entries to functional modules such asSQL operations and database management.

2 Account informationand logout

Displays the current account information anda logout button.

3 DB instanceinformation

Displays the current database information,such as the DB engine logo, DB instancename, and DB engine version.

Data Admin ServiceUser Guide

7 PostgreSQL DB Instance Management (StandardEdition)

Issue 01 (2020-09-27) Copyright © Huawei Technologies Co., Ltd. 149

Page 159: User Guide...User. {{]}]} {}]}

No. Item Description

4 Database list Displays the databases of the current DBinstance, including user databases and systemdatabases.Allows you to search for a database by name.Allows you to create databases.

5 SQL history Displays the executed SQL statements in theSQL window when Show Executed SQLStatements is enabled for adding a databaselogin.

7.1.2 Database Management

PrerequisitesYou have logged in to a PostgreSQL DB instance on the DAS console.

OverviewYou can go to the Database Management page using either of the followingmethods:

● In the database list of the Home page, locate the target database and clickManage in the Operation column.

● Select Database Management on the top menu bar.

Table 7-2 Functions

No. Description

1 Displays the name of the current database.

2 Allows you to change databases in the current DB instance.

3 Displays the IP address, port number, and character set of the currentDB instance.

4 Allows you to open the SQL window of the current database.

5 Periodically collects metadata such as databases, tables, and fields ofthe DB instance and stores the data to the databases of DAS.Advantages:● Reduces queries on user databases and the impact on the

performance of user databases.● Improves the search performance for DB instances that contain a

large number of tables and supports pagination queries.Only structural metadata is collected, which means that user's tabledata is not included.

Data Admin ServiceUser Guide

7 PostgreSQL DB Instance Management (StandardEdition)

Issue 01 (2020-09-27) Copyright © Huawei Technologies Co., Ltd. 150

Page 160: User Guide...User. {{]}]} {}]}

No. Description

6 Provides three functional modules: Schemas, Objects, and MetadataCollection.

7 Allows you to perform operations.

Schema List

Step 1 On the Schemas tab page, click Create Schema in the upper left corner.

Step 2 In the displayed dialog box, enter a schema name and click OK to create aschema.

----End

Objects

You can create objects such as tables, views, and triggers by executing SQLstatements.

Metadata Collection

DAS periodically collects DB instance metadata of databases, tables, and fieldsand stores the collected data in the DAS database. In addition, it collects onlystructural metadata, but not data in user tables, which ensures data security.Metadata collection delivers the following advantages:

● Reduces queries on user databases and the impact on the performance ofuser databases.

● Improves the search performance for DB instances that contain a largenumber of tables and supports pagination queries.

Step 1 On the Database Management page, enable Auto Metadata Collection in theupper right corner and click the Metadata Collection tab.

Step 2 On the displayed page, click Collect Now to start the collection. You can also stopthe collection or view collection details.

● Clear Collected Data: Clears the collected data such as metadata, databasestructure, and table structure.

● Delete Logs: Deletes logs. Deleted logs cannot be restored.

----End

7.1.3 Querying SQL Statements

Prerequisites

You have logged in to a PostgreSQL DB instance on the DAS console.

Data Admin ServiceUser Guide

7 PostgreSQL DB Instance Management (StandardEdition)

Issue 01 (2020-09-27) Copyright © Huawei Technologies Co., Ltd. 151

Page 161: User Guide...User. {{]}]} {}]}

Procedure

Step 1 In the database list of the Home page, locate the target database and click QuerySQL Statements in the Operation column. The SQL Window is displayed.

Step 2 In the navigation pane, specify a database, table, or view.

● Execute SQL: executes SQL statements.

● Execute SQL Plan: reports the execution of SQL statements to facilitatetroubleshooting and optimize SQL processing performance.

● SQL Favorites: allows you to add, view, and manage frequently used SQLstatements.

● Format SQL: improves the readability of SQL statements. Formatting SQLstatements enables statements to be displayed in line break mode, but doesnot change their logic and semantics.

----End

7.2 SQL Operations

7.2.1 SQL Window

Prerequisites

You have logged in to a PostgreSQL DB instance on the DAS console.

Procedure

Step 1 On the top menu bar, choose SQL Operations > SQL Window.

Step 2 In the navigation pane, specify a database, table, or view.

● Execute SQL: executes SQL statements.

● Format SQL: improves the readability of SQL statements. Formatting SQLstatements enables statements to be displayed in line break mode, but doesnot change their logic and semantics.

● Execute SQL Plan: reports the execution of SQL statements to facilitatetroubleshooting and optimize SQL processing performance.

● SQL Favorites: allows you to add, view, and manage frequently used SQLstatements.

----End

7.2.2 SQL History

Prerequisites

You have logged in to a PostgreSQL DB instance on the DAS console.

Data Admin ServiceUser Guide

7 PostgreSQL DB Instance Management (StandardEdition)

Issue 01 (2020-09-27) Copyright © Huawei Technologies Co., Ltd. 152

Page 162: User Guide...User. {{]}]} {}]}

Procedure

Step 1 On the top menu bar, choose SQL Operations > SQL History.

Step 2 On the displayed page, search for execution information about the target SQLstatement by time range, database name, or keyword.

● To access the Database Management, click a database name.● To copy and use your required SQL statements, click the SQL statement in the

SQL Statement column.● To directly execute a SQL statement, click Open in SQL Window in the

Operation column.

----End

Data Admin ServiceUser Guide

7 PostgreSQL DB Instance Management (StandardEdition)

Issue 01 (2020-09-27) Copyright © Huawei Technologies Co., Ltd. 153

Page 163: User Guide...User. {{]}]} {}]}

8 GaussDB(for MySQL) DB InstanceManagement (Standard Edition)

8.1 Overview

8.1.1 Feature Overview

Logging In to a DB Instance

Step 1 In the login list, locate the DB instance you want to log in to and click Log In inthe Operation column.

For more login information, see Logging In to a Database (Using DAS).

----End

DAS FeaturesThis topic briefly describes the page for managing databases to help you betterunderstand DAS.

Table 8-1 Functions

No. Item Description

1 Top menu bar Includes entries of the SQL operations, databasemanagement, data import and export, and othermodules.

2 Accountinformation andlogout

Displays the current account information and alogout button.

3 DB instanceinformation

Displays the current database information, such asthe DB engine logo, DB instance name, and DBengine version.

Data Admin ServiceUser Guide

8 GaussDB(for MySQL) DB Instance Management(Standard Edition)

Issue 01 (2020-09-27) Copyright © Huawei Technologies Co., Ltd. 154

Page 164: User Guide...User. {{]}]} {}]}

No. Item Description

4 Database list Displays the databases of the current DB instance,including user databases and system databases.Allows you to search for a database by name.Allows you to create databases.

8.1.2 Database Management

PrerequisitesYou have logged in to a GaussDB(for MySQL) DB instance on the DAS console.

OverviewYou can go to the Database Management page using either of the followingmethods:

● In the database list of the Home page, locate the target database and clickManage in the Operation column.

● Select Database Management on the top menu bar.

Table 8-2 Functions

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 currentDB instance.

4 Allows you to open the SQL window of the current database.

5 Periodically collects metadata such as databases, tables, and fields ofthe DB instance and stores the data to the databases of DAS.Advantages:● Reduces queries on user databases and the impact on the

performance of user databases.● Improves the search performance for DB instances that contain a

large number of tables and supports pagination queries.Note:Only structural metadata is collected, which means that user's tabledata is not included.

6 Database management consists of three functional modules: objects,SQL tuning, and metadata collection.

7 Allows you to perform operations.

Data Admin ServiceUser Guide

8 GaussDB(for MySQL) DB Instance Management(Standard Edition)

Issue 01 (2020-09-27) Copyright © Huawei Technologies Co., Ltd. 155

Page 165: User Guide...User. {{]}]} {}]}

Objects

You can manage tables, views, stored procedures, events, triggers, and functions ofdatabases. 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.

Step 1 On the Database Management page, click the SQL Tuning tab. You can searchfor SQL tuning history by date to view details or you can add or delete SQL tuningrecords.

Step 2 Click Add SQL Performance Tuning. In the displayed dialog box, choose SQLstatement or SQL file. If you select SQL statement, enter the SQL statementsand click OK. The tuning results can be viewed in the SQL tuning list.

NO TE

● 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 toSELECT statements for tuning. The tuning task that contains unsupported SQL syntaxwill 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. AnINSERT statement must contain a SELECT clause.

● Querying stored SQL statements such as information_schema, test, mysql, is notsupported.

● View statements are not supported.

Step 3 In the SQL tuning list, locate the target task and click View Details in theOperation column.

You can view the tuning details at the bottom of the task list.

----End

Metadata Collection

In DAS 2.0, metadata of a DB instance such as databases, tables, and files can beautomatically collected and stored in the DAS database. In addition, onlystructural metadata is collected, and the data in your table is not included toprotect your data privacy.

Data Admin ServiceUser Guide

8 GaussDB(for MySQL) DB Instance Management(Standard Edition)

Issue 01 (2020-09-27) Copyright © Huawei Technologies Co., Ltd. 156

Page 166: User Guide...User. {{]}]} {}]}

● Reduces queries on user databases and the impact on the user databaseperformance.

● Improves the search performance for DB instances that contain a largenumber of tables and supports pagination queries.

Step 1 On the Database Management page, click the Metadata Collection tab andenable Auto Metadata Collection.

Step 2 Click Collect Now to start the collection. You can also stop the collection or viewcollection details by clicking corresponding buttons in the Operation column.● 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.

----End

8.1.3 SQL-based Query

Prerequisites

You have logged in to a GaussDB(for MySQL) DB instance on the DAS console.

Procedure

Step 1 In the database list of the Home page, locate the target database and click QuerySQL Statements in the Operation column. The SQL Window is displayed.

Step 2 In the navigation pane, specify a database, table, or view.● Execute SQL: executes SQL statements.● Tune SQL: queries the SQL statements that are executed frequently, consume

a large amount of resources, or take a long time to execute.● Execute SQL Plan: reports the execution of SQL statements to facilitate

troubleshooting and optimize SQL processing performance.● SQL Favorites: allows you to add, view, and manage frequently used SQL

statements.● Format SQL: improves the readability of SQL statements. Formatting SQL

statements enables statements to be displayed in line break mode, but doesnot change their logic and semantics.

Step 3 After SQL statements are executed, view SQL execution status on the ExecutedSQL Statements, Messages, and Result Set tab pages.

----End

8.1.4 Table Creation

Prerequisites

You have logged in to a GaussDB(for MySQL) DB instance on the DAS console.

Data Admin ServiceUser Guide

8 GaussDB(for MySQL) DB Instance Management(Standard Edition)

Issue 01 (2020-09-27) Copyright © Huawei Technologies Co., Ltd. 157

Page 167: User Guide...User. {{]}]} {}]}

ScenariosA data table consists of basic information, field or column information, virtualcolumns, indexes, and foreign keys. The virtual columns, indexes, and foreign keysare optional and can be configured based on service requirements.

Procedure

Step 1 In the database list of the Home page, locate the target database and clickCreate Table in the Operation column.

Step 2 On the displayed page, specify the details under Basic Information (Table Nameis mandatory). Click Next.

Step 3 Set the column name, type, length, nullable, primary key, and extendedinformation based on service requirements.● If you do not need to add virtual columns, indexes, or foreign keys, click

Create at the bottom of the page. In the displayed SQL Preview dialog box,click Execute.

● If you need to add virtual columns, indexes, and foreign keys, click Next.Then, set the column name, type, length, nullable, primary key, expression,storage type, comment, and extended information. If you need to set thetable index or foreign key, click Next. After the setting, click Create.

NO TE

When you create a foreign key, the type of columns in the referenced table must be thesame as that of included columns, and must be the primary key or have a unique index.

Step 4 In the SQL Preview dialog box, click Execute to create a table.

----End

8.2 SQL Operations

8.2.1 SQL Window

PrerequisitesYou have logged in to a GaussDB(for MySQL) DB instance on the DAS console.

Procedure

Step 1 On the top menu bar, click SQL Window or choose SQL Operations > SQLWindow.

Step 2 In the navigation pane, specify a database, table, or view.● Execute SQL: executes SQL statements.● Tune SQL: queries the SQL statements that are executed frequently, consume

a large amount of resources, or take a long time to execute.● Execute SQL Plan: reports the execution of SQL statements to facilitate

troubleshooting and optimize SQL processing performance.

Data Admin ServiceUser Guide

8 GaussDB(for MySQL) DB Instance Management(Standard Edition)

Issue 01 (2020-09-27) Copyright © Huawei Technologies Co., Ltd. 158

Page 168: User Guide...User. {{]}]} {}]}

● SQL Favorites: allows you to add, view, and manage frequently used SQLstatements.

● Format SQL: improves the readability of SQL statements. Formatting SQLstatements enables statements to be displayed in line break mode, but doesnot change their logic and semantics.

Step 3 After SQL statements are executed, view SQL execution status on the ExecutedSQL Statements, Messages, and Result Set tab pages.

----End

8.2.2 SQL History

Prerequisites

You have logged in to a GaussDB(for MySQL) DB instance on the DAS console.

Procedure

Step 1 On the top menu bar, choose SQL Operations > SQL History.

Step 2 On the displayed page, search for execution information about the target SQLstatement by time range, database name, or keyword.● To access the Database Management, click a database name.● To copy and use your required SQL statements, click the SQL statement in the

SQL Statement column.● To directly execute a SQL statement, click Open in SQL Window in the

Operation column.

----End

8.3 Import and Export

8.3.1 Data Import

Scenarios

This topic describes how to import data into a table for backup or data migration.The table structure to be imported must be the same as that of the target table. Ifyou import a CSV or SQL file, the data type of the target table must be the same.The imported file should be no larger than 10 GB.

Prerequisites

You have logged in to a GaussDB(for MySQL) DB instance on the DAS console.

Procedure

Step 1 On the top menu bar, choose Import and Export > Import.

Data Admin ServiceUser Guide

8 GaussDB(for MySQL) DB Instance Management(Standard Edition)

Issue 01 (2020-09-27) Copyright © Huawei Technologies Co., Ltd. 159

Page 169: User Guide...User. {{]}]} {}]}

Step 2 Import a file from your local PC or an OBS bucket.● From your local PC

On the displayed page, click Create Task. In the displayed dialog box, set FileSource to Upload file, specify the attachment storage, and upload a file fromyour local PC. Then, configure other parameters as required.

For security purposes, imported files are stored in OBS buckets.

NO TE

● To keep data secure, provide your own OBS bucket to store the attachments you upload.In this way, DAS automatically connects to your OBS bucket for in-memory reading.

● If you select Delete the uploaded file upon an import success, the file you upload willbe automatically deleted from the OBS bucket after being imported to the destinationdatabase.

● From an OBS bucketOn the displayed page, click Create Task. In the displayed dialog box, set FileSource to Choose from OBS, and configure other parameters as required.

NO TE

The file uploaded from an OBS bucket will not be deleted upon an import success.

Step 3 After setting the import parameters, click Create. Confirm the information againbefore you click OK because original data may be overwritten after data import.

Step 4 View the import progress in the task list or check task details.

----End

8.3.2 Data Export

Scenarios

DAS supports pagination query to meet your requirements for querying largeamounts of data. You can export all the data at a time when backing up ormigrating data.

Prerequisites

You have logged in to a GaussDB(for MySQL) DB instance on the DAS console.

Procedure

Step 1 On the top menu bar, choose Import and Export > Export.

Step 2 On the displayed page, click Create Task and select Export Database or ExportSQL Result as required. The following takes database export as an example.

Alternatively, click Quick Export and select the target database. In the displayeddialog box, select a storage path and click OK.

Step 3 In the displayed dialog box, set required parameters in areas Basic Informationand Advanced Settings, and select the tables to be exported.

Data Admin ServiceUser Guide

8 GaussDB(for MySQL) DB Instance Management(Standard Edition)

Issue 01 (2020-09-27) Copyright © Huawei Technologies Co., Ltd. 160

Page 170: User Guide...User. {{]}]} {}]}

NO TE

DAS connects to your standby database to export data. This prevents the primary databasefrom being affected by data export. However, if the standby database has a high replicationdelay, the exported data may not be the latest.

Step 4 After settings are complete, click OK.

Step 5 In the task list, view the task ID, type, status, and progress.

Step 6 Click Details in the Operation column to view task details.

----End

8.4 CloudDBA

8.4.1 Real-Time Sessions

Procedure

Step 1 On the top menu bar, choose CloudDBA > Real-Time Sessions.

Figure 8-1 Real-Time Sessions

Step 2 On the Sessions tab page, select the abnormal sessions you want to end and clickKill for the databases to recover.

On the Slow Sessions tab page, set the slow SQL threshold and click therefreshing button or enable Auto Refresh to single out the SQL statements whoseexecution time exceeds the threshold. Select the sessions you want to end andclick Kill for the databases to recover.

----End

Data Admin ServiceUser Guide

8 GaussDB(for MySQL) DB Instance Management(Standard Edition)

Issue 01 (2020-09-27) Copyright © Huawei Technologies Co., Ltd. 161

Page 171: User Guide...User. {{]}]} {}]}

8.4.2 SQL Tuning

PrerequisitesYou have logged in to the DAS console.

Procedure

Step 1 On the top menu bar, choose CloudDBA > SQL Tuning.

Step 2 In the displayed dialog box, select an instance and click OK.

Step 3 On the SQL Tuning page, click Add SQL Performance Tuning. In the displayeddialog box, enter the SQL statements to be diagnosed and click OK.

Step 4 Click View Details in the Operation column to view tuning details.

Step 5 Under Tuned SQL List, click View Tuning Result Detail in the Operation columnto view tuning details.

Data Admin ServiceUser Guide

8 GaussDB(for MySQL) DB Instance Management(Standard Edition)

Issue 01 (2020-09-27) Copyright © Huawei Technologies Co., Ltd. 162

Page 172: User Guide...User. {{]}]} {}]}

NO TE

● The SQL tuning function obtains the table structure and data distribution information(non-original). The obtained data is only for logic diagnosis, but not stored on the DASserver.

● Obtaining table structure and data distribution information may add additional loads tothe DB instance, but has little impact on its performance.

● Only the SQL diagnosis history is stored on the DAS server. You can delete it from theserver permanently.

----End

8.4.3 Tuning Report

ScenariosA diagnosis report displays the database data in a specified period, including real-time performance data, session statistics, slow SQL statements, and SQL tuningstatistics.

Prerequisites● You have logged in to a GaussDB(for MySQL) DB instance on the DAS

console.● You have obtained the process permission.

Procedures

Step 1 On the top menu bar, choose CloudDBA > Tuning Report.

Step 2 On the displayed page, click Start Diagnosis. In the displayed dialog box, setduration and frequency and click OK.

Figure 8-2 Starting a diagnosis task

Step 3 Search for diagnosis reports by time range. Click View Report in the Operationcolumn to view report details.

Step 4 On the details page, view metrics such as thread_conn, QPS, and com_del in realtime. You can analyze the diagnosis based on performance data, session statistics,slow SQL statements, and SQL tuning content, and download the diagnosis report.

Data Admin ServiceUser Guide

8 GaussDB(for MySQL) DB Instance Management(Standard Edition)

Issue 01 (2020-09-27) Copyright © Huawei Technologies Co., Ltd. 163

Page 173: User Guide...User. {{]}]} {}]}

Figure 8-3 Tuning details

----End

8.5 User Management

Scenarios

Multiple users with different permissions can be created to access a DB instance ordatabase, but the permissions of these users cannot exceed the operationpermissions of the account.

Prerequisites

You have logged in to a GaussDB(for MySQL) DB instance on the DAS console.

Procedure

Step 1 On the top menu bar, choose Other Operations > User Management.

Step 2 On the displayed page, click Create User. Then, configure required information,such as basic information, advanced settings, global permissions, and objectpermissions.● Add DAS IP Address: You can add the IP address segment where DAS locates

to the whitelist of the user. This network segment is used by DAS only. Otherservices do not use this network segment to connect to databases.

● Password: To ensure data security, the password must:– Contain 8 to 12 characters.– Be a strong password.– Be different from the username or the username spelled backwards.– Must contain at least three types of the following characters: uppercase

letters, lowercase letters, digits, and special characters, including ~!@#%^*-_+=?

Step 3 Click Save. In the displayed SQL Preview dialog box, click OK.

Step 4 In the user management list, view, edit, or delete information about created users.● Search

Data Admin ServiceUser Guide

8 GaussDB(for MySQL) DB Instance Management(Standard Edition)

Issue 01 (2020-09-27) Copyright © Huawei Technologies Co., Ltd. 164

Page 174: User Guide...User. {{]}]} {}]}

Enter a username in the search box in the upper right corner to query userinformation.

● EditOn the displayed page, locate the target username and click Edit in theOperation column.On the displayed page, edit user information, set global and objectpermissions, and click Save. In the displayed dialog box, click OK.

● DeleteOn the displayed page, locate the target user and click Delete in theOperation column. In the displayed dialog box, click Yes.

----End

Data Admin ServiceUser Guide

8 GaussDB(for MySQL) DB Instance Management(Standard Edition)

Issue 01 (2020-09-27) Copyright © Huawei Technologies Co., Ltd. 165

Page 175: User Guide...User. {{]}]} {}]}

9 DDM DB Instance Management(Standard Edition)

9.1 Overview

9.1.1 Feature Overview

Logging In to a DB Instance

Step 1 Log in to the DAS console.

Step 2 In the login list, locate the DB instance you want to log in to and click Log In inthe Operation column.

For more login information, see Logging In to a Database (Using DAS).

Figure 9-1 Logging in to a DB instance

----End

DAS FeaturesThis topic briefly describes the page for managing databases to help you betterunderstand DAS.

Data Admin ServiceUser Guide 9 DDM DB Instance Management (Standard Edition)

Issue 01 (2020-09-27) Copyright © Huawei Technologies Co., Ltd. 166

Page 176: User Guide...User. {{]}]} {}]}

Figure 9-2 DAS interface for DDM DB instances

Table 9-1 Functions

No. Item Description

1 Top menu bar Includes entries of the SQL operation, databasemanagement, and CloudDBA.

2 Accountinformation andlogout

Displays the current account information and alogout button.

3 DB instanceinformation

Displays the current database information, such asthe DB engine logo, DB instance name, and DBengine version.

4 Database list Displays the databases of the current DB instance,including user databases and system databases.Allows you to search for a database by name.

9.1.2 Database Management

PrerequisitesYou have logged in to a DDM DB instance on the DAS console.

OverviewYou can go to the Database Management page using either of the followingmethods:

● In the database list of the Home page, locate the target database and clickManage in the Operation column.

● Select Database Management on the top menu bar.

Figure 9-3 Database management page

Data Admin ServiceUser Guide 9 DDM DB Instance Management (Standard Edition)

Issue 01 (2020-09-27) Copyright © Huawei Technologies Co., Ltd. 167

Page 177: User Guide...User. {{]}]} {}]}

Table 9-2 Functions

No. Description

1 Displays the name of the database opened on the current page. Youcan change the database to a non-system database in the current DBinstance.

2 Displays the IP address, port number, and character set of the currentDB instance.

3 Allows you to open the SQL window of the current database.

4 Periodically collects metadata such as databases, tables, and fields ofthe DB instance and stores the data to the databases of DAS.Advantages:● Reduces queries on user databases and the impact on the

performance of user databases.● Improves the search performance for DB instances that contain a

large number of tables and supports pagination queries.Note:Only structural metadata is collected, which means that user's tabledata is not included.

5 Provides two functional modules: objects and metadata collection.

6 Allows you to perform operations.

Objects

Currently, you can manage DDM instance tables, such as creating, querying, andmodifying objects.

For details on how to manage tables, see Table Management.

Metadata Collection

DAS periodically collects DB instance metadata of databases, tables, and fieldsand stores the collected data in the DAS database. In addition, it collects onlystructural metadata, but not data in user tables, which ensures data security.Metadata collection delivers the following advantages:

● Reduces queries on user databases and the impact on the performance ofuser databases.

● Improves the search performance for DB instances that contain a largenumber of tables and supports pagination queries.

Step 1 On the Database Management page, enable Auto Metadata Collection in theupper right corner and click the Metadata Collection tab.

Step 2 On the displayed page, click Collect Now to start the collection. You can also stopthe collection or view collection details.

Data Admin ServiceUser Guide 9 DDM DB Instance Management (Standard Edition)

Issue 01 (2020-09-27) Copyright © Huawei Technologies Co., Ltd. 168

Page 178: User Guide...User. {{]}]} {}]}

● Clear Collected Data: Clears the collected data such as metadata, databasestructure, and table structure.

● Delete Logs: Deletes logs. Deleted logs cannot be restored.

----End

9.1.3 SQL Window

PrerequisitesYou have logged in to a DDM DB instance on the DAS console.

Procedure

Step 1 In the database list of the Home page, locate the target database and click QuerySQL Statements in the Operation column. The SQL Window is displayed.

Step 2 In the navigation pane, specify a database, table, or view.

● Execute SQL: executes SQL statements.● Format SQL: improves the readability of SQL statements. Formatting SQL

statements enables statements to be displayed in line break mode, but doesnot change their logic and semantics.

● Execute SQL Plan: reports the execution of SQL statements to facilitatetroubleshooting and optimize SQL processing performance.

● SQL Favorites: allows you to add, view, and manage frequently used SQLstatements.

Step 3 After SQL statements are executed, view SQL execution status on the ExecutedSQL Statements, Messages, and Result Set tab pages.

----End

9.2 Table Management

9.2.1 Creating a Table

PrerequisitesYou have logged in to a DDM DB instance on the DAS console.

Data Admin ServiceUser Guide 9 DDM DB Instance Management (Standard Edition)

Issue 01 (2020-09-27) Copyright © Huawei Technologies Co., Ltd. 169

Page 179: User Guide...User. {{]}]} {}]}

Operation DescriptionA data table consists of basic information, columns, and indexes. As thesupplement to table information, indexes are optional and can be configuredbased on service requirements.

Procedure

Step 1 On the top menu bar, choose Database Management. On the displayed Objectspage, select Tables and click Create Table.

Step 2 On the displayed page, specify required parameters and set advanced options asrequired. The table name is mandatory. Click Next.

Step 3 Set the column name, type, length, nullable, primary key, and extendedinformation based on service requirements.● If you do not need to add indexes, click Create directly. In the displayed SQL

Preview dialog box, click Execute.

NO TE

DDM supports global tables, unsharded tables, and sharded tables. On the basicinformation page, if you select Yes for Global Table, the table created is a global table. Ifyou select No for Global Table, you need to run SQL statements in the SQL window tocreate sharded tables.

● If you need to add indexes, click Next and set the index information. After thesetting is complete, click Create at the bottom of the page.

Step 4 In the SQL Preview dialog box, click Execute to create a table.

----End

9.2.2 Opening a Table

PrerequisitesYou have logged in to a DDM DB instance on the DAS console.

Procedure

Step 1 On the top menu bar, choose Database Management. On the displayed Objectspage, select Tables, locate the target table, and click Open in the Operationcolumn.

Step 2 Currently, tables in DDM databases cannot be edited. On the table details page,view the table information.

Table 9-3 Functions

Item Description

Where Condition Filters records.

Copy Row Copies data of selected rows. Specifically, double-click thetarget row and then click Copy Row.

Data Admin ServiceUser Guide 9 DDM DB Instance Management (Standard Edition)

Issue 01 (2020-09-27) Copyright © Huawei Technologies Co., Ltd. 170

Page 180: User Guide...User. {{]}]} {}]}

Item Description

Delete Row Deletes data of selected rows. Specifically, double-clickthe target row and then click Delete Row.

Copy Column Allows you to copy all data in a column by selecting thiscolumn from the Copy Column drop-down list.

Column Settings Allows you to set the columns you want to display.

Binary toHexadecimal

Prevents binary data in columns from being displayed asgarbled characters. If there is binary data in columns, youmust select this option.

Add Allows you to add data to a table.

Refresh Allows you to update table data manually.

Submit Allows you to edit data for the second time.

Row Details Shows the detailed information of a specified row.

----End

9.2.3 Viewing Table Details

Prerequisites

You have logged in to a DDM DB instance on the DAS console.

Procedure

Step 1 On the top menu bar, choose Database Management.

Step 2 On the displayed Objects page, select Tables, locate the target table, and clickView in the Operation column.

Step 3 In the displayed dialog box, view basic information and SQL statements.

----End

9.2.4 Altering a Table

Prerequisites

You have logged in to a DDM DB instance on the DAS console.

NO TE

DDM supports global tables, unsharded tables, and sharded tables. Only global tables andunsharded tables can be modified.

To modify sharded tables, execute SQL statements in the SQL window.

Data Admin ServiceUser Guide 9 DDM DB Instance Management (Standard Edition)

Issue 01 (2020-09-27) Copyright © Huawei Technologies Co., Ltd. 171

Page 181: User Guide...User. {{]}]} {}]}

Procedure

Step 1 On the top menu bar, choose Database Management.

Step 2 On the displayed Objects page, select Tables, locate the target table, and clickAlter in the Operation column.

Step 3 On the displayed page, modify the basic table information and click Next.

Step 4 Make modifications on the Column page. After the operation is complete, modifythe index information as required or click Alter.

Step 5 In the SQL Preview dialog box, click Execute.

----End

9.2.5 Clearing a Table

Prerequisites

You have logged in to a DDM DB instance on the DAS console.

NO TICE

Cleared tables cannot be recovered. Exercise caution when performing thisoperation.

Procedure

Step 1 On the top menu bar, choose Database Management.

Step 2 On the displayed Objects page, select Tables, locate the target table, and chooseMore > Clear in the Operation column.

Step 3 In the displayed dialog box, click Yes.

----End

9.2.6 Dropping a Table

Prerequisites

You have logged in to a DDM DB instance on the DAS console.

NO TICE

Dropped tables cannot be recovered. Exercise caution when performing thisoperation.

Data Admin ServiceUser Guide 9 DDM DB Instance Management (Standard Edition)

Issue 01 (2020-09-27) Copyright © Huawei Technologies Co., Ltd. 172

Page 182: User Guide...User. {{]}]} {}]}

Procedure

Step 1 On the top menu bar, choose Database Management.

Step 2 On the displayed Objects page, select Tables, locate the target table, and chooseMore > Drop in the Operation column.

Step 3 In the displayed dialog box, click Yes.

----End

9.2.7 Maintaining a Table

Scenarios

While working with MySQL databases, you do a lot of changes such as data insert,update, and deletion, which may cause table fragmentation. As a result, thedatabase server performance is deteriorated. To handle this, periodic maintenanceis required.

Prerequisites

You have logged in to a DDM DB instance on the DAS console.

Functions● Optimize

Allows you to optimize tables using the OPTIMIZE TABLE statement and sortout fragmented files for later use.During the optimization, a read-only lock will be added to target tables.Therefore, optimizing tables during off-peak hours is recommended.

● AnalyzeAllows you to analyze tables using the ANALYZE TABLE statement. During theanalysis, a read-only lock is added to the tables. Tables can only be readduring the analysis.

Procedure

The following operations show how to optimize a database table. The procedurefor analyzing tables is similar.

Step 1 On the top menu bar, choose Database Management.

Step 2 On the displayed Objects page, select Tables, locate the target table, and chooseMore > Maintain > Optimize in the Operation column.

Step 3 In the displayed dialog box, click Yes.

----End

9.3 SQL Operations

Data Admin ServiceUser Guide 9 DDM DB Instance Management (Standard Edition)

Issue 01 (2020-09-27) Copyright © Huawei Technologies Co., Ltd. 173

Page 183: User Guide...User. {{]}]} {}]}

9.3.1 SQL Window

PrerequisitesYou have logged in to a DDM DB instance on the DAS console.

Procedure

Step 1 On the top menu bar, choose SQL Operations > SQL Window.

Step 2 In the navigation pane, specify a database, table, or view.

● Execute SQL: executes SQL statements.● Execute SQL Plan: reports the execution of SQL statements to facilitate

troubleshooting and optimize SQL processing performance.● SQL Favorites: allows you to add, view, and manage frequently used SQL

statements.● Format SQL: improves the readability of SQL statements. Formatting SQL

statements enables statements to be displayed in line break mode, but doesnot change their logic and semantics.

Step 3 After SQL statements are executed, view SQL execution status on the ExecutedSQL Statements, Messages, and Result Set tab pages.

----End

9.3.2 SQL History

PrerequisitesYou have logged in to a DDM DB instance on the DAS console.

Procedure

Step 1 On the top menu bar, choose SQL Operations > SQL History.

Step 2 On the displayed page, search for execution information about the target SQLstatement by time range, database name, or keyword.● To access the Database Management, click a database name.● To copy and use your required SQL statements, click the SQL statement in the

SQL Statement column.

Data Admin ServiceUser Guide 9 DDM DB Instance Management (Standard Edition)

Issue 01 (2020-09-27) Copyright © Huawei Technologies Co., Ltd. 174

Page 184: User Guide...User. {{]}]} {}]}

● To directly execute a SQL statement, click Open in SQL Window in theOperation column.

----End

9.4 CloudDBA

9.4.1 Real-Time Sessions

ScenariosView the running duration and status of SQL statements online to detect andhandle abnormal processes in a timely manner to ensure that databases runsmoothly.

Prerequisites● You have logged in to a DDM DB instance on the DAS console.● You have obtained the process permission.

Procedure

Step 1 On the top menu bar, choose CloudDBA > Real-Time Sessions.

Step 2 On the displayed page, view the running sessions, session execution duration,session list, and slow sessions.

● In the upper left area, the chart shows the number of global sessions, whichkeeps the same as the search criteria change.

● In the upper right area, the graph shows the query results based on yoursearch criteria.

● Kill a session.Select an abnormal session and click Kill to kill it so that the database canrecover.

● Query specified sessions by filters.Search for sessions by user, host, or database.

● Set slow SQL threshold.

Data Admin ServiceUser Guide 9 DDM DB Instance Management (Standard Edition)

Issue 01 (2020-09-27) Copyright © Huawei Technologies Co., Ltd. 175

Page 185: User Guide...User. {{]}]} {}]}

Set a slow session threshold and click Refresh to filter the slow sessions thatexceed this threshold.

----End

Data Admin ServiceUser Guide 9 DDM DB Instance Management (Standard Edition)

Issue 01 (2020-09-27) Copyright © Huawei Technologies Co., Ltd. 176

Page 186: User Guide...User. {{]}]} {}]}

10 GaussDB(for Cassandra) DB InstanceManagement (Standard Edition)

10.1 Overview

10.1.1 Feature Overview

Logging In to a DB Instance

Step 1 Log in to the DAS console.

Step 2 In the login list, locate the DB instance you want to log in to and click Log In inthe Operation column.

For more login information, see Logging In to a Database (Using DAS).

----End

DAS Features

This topic briefly describes the page for managing databases to help you betterunderstand DAS.

Table 10-1 Functions

No. Function Description

1 Top menu bar Includes entries of the SQL operations, keyspacemanagement, and other operations.

2 Accountinformation andlogout

Displays the current account information and alogout button.

Data Admin ServiceUser Guide

10 GaussDB(for Cassandra) DB InstanceManagement (Standard Edition)

Issue 01 (2020-09-27) Copyright © Huawei Technologies Co., Ltd. 177

Page 187: User Guide...User. {{]}]} {}]}

No. Function Description

3 DB instanceinformation

Displays the current keyspace information, such asthe DB engine logo, DB instance name, and DBengine version.

4 Keyspace List Displays the keyspaces on the current DB instance,including user keyspaces and system keyspaces.Allows you to search for a keyspace by name.

10.1.2 Keyspace Management

Prerequisites

You have logged in to a GaussDB(for Cassandra) DB instance on the DAS console.

Keyspace Management Description

You can go to the keyspace management page using either of the followingmethods:

● In the keyspace list of the Home page, locate the target keyspace and clickManage in the Operation column.

● Choose Keyspace Management on the top menu bar.

Figure 10-1 Keyspace management page

Table 10-2 Functions

No. Description

1 Displays the name of the keyspace opened on the current page. Youcan change the keyspace to a non-system keyspace in the current DBinstance.

2 Displays the IP address and port number of the current DB instance.

3 Allows you to open the SQL window of the current keyspace.

Data Admin ServiceUser Guide

10 GaussDB(for Cassandra) DB InstanceManagement (Standard Edition)

Issue 01 (2020-09-27) Copyright © Huawei Technologies Co., Ltd. 178

Page 188: User Guide...User. {{]}]} {}]}

No. Description

4 Periodically collects data and stores it to the databases of DAS.Advantages:● Reduces queries on user databases and the impact on the

performance of user databases.● Improves the search performance for DB instances that contain a

large number of tables and supports pagination queries.Note:Only structural metadata is collected, which means that user's tabledata is not included.

5 Consists of object list and metadata collection functional modules.

6 Allows you to perform operations.

Object List

Currently, you can manage instance tables, views, and custom types, includingopening and viewing objects.

For details on how to manage tables, see Table Management.

Metadata Collection

In DAS 2.0, the instance metadata is periodically collected at the background andstored in the DAS database. In addition, only structural metadata is collected. Forprivacy reasons, the data in your table is not collected.

● Reduces queries on user keyspace and the impact on the performance of userdatabases.

● Improves the search performance for DB instances that contain a largenumber of tables and supports pagination queries.

Step 1 On the Keyspace Management page, click the Metadata Collection tab.

Step 2 On the displayed page, click Collect Now to start the collection. You can also stopthe collection or view collection details.● Clear Collected Data: Clears the collected data such as metadata, keyspace

structure, and table structure.● Delete Logs: Deletes logs. Deleted logs cannot be restored.

----End

10.1.3 Creating a Keyspace

Prerequisites

You have logged in to a GaussDB(for Cassandra) DB instance on the DAS console.

Data Admin ServiceUser Guide

10 GaussDB(for Cassandra) DB InstanceManagement (Standard Edition)

Issue 01 (2020-09-27) Copyright © Huawei Technologies Co., Ltd. 179

Page 189: User Guide...User. {{]}]} {}]}

Procedure

Step 1 On the Home page, click Create Keyspace.

Step 2 On the displayed page, enter a keyspace name, set the number of replicationfactors, and determine whether to enable Durable Writes.

Step 3 After settings are complete, click OK.

----End

10.1.4 SQL Window

Prerequisites

You have logged in to a GaussDB(for Cassandra) DB instance on the DAS console.

Procedure

Step 1 In the keyspace list of the Home page, locate the target keyspace and click QuerySQL Statements in the Operation column to open the SQL window.

NO TE

You are advised to enable Save Executed SQL Statements in the upper right corner of theSQL window so that the recently executed SQL statements will be saved to the server.

Step 2 In the navigation pane on the left, view the keyspace, tables, and views.

● Execute SQL: executes SQL statements.

● Format SQL: improves the readability of SQL statements. If you click thisbutton, the SQL statements are displayed in line break mode but the logicand semantics of the SQL statements will not be changed.

● SQL Favorites: allows you to add, view, and manage frequently used SQLstatements.

Step 3 After the SQL statements are executed, view the SQL execution status on theExecuted SQL Statements, Messages and Result Set tabs in the lower part ofthe page.

----End

Data Admin ServiceUser Guide

10 GaussDB(for Cassandra) DB InstanceManagement (Standard Edition)

Issue 01 (2020-09-27) Copyright © Huawei Technologies Co., Ltd. 180

Page 190: User Guide...User. {{]}]} {}]}

10.2 Table Management

10.2.1 Opening a Table

Prerequisites● You have logged in to a GaussDB(for Cassandra) DB instance on the DAS

console.● At least one table has been created in the current keyspace.

NO TE

You can create tables in the SQL window.

Procedure

Step 1 On the top menu bar, choose Keyspace Management. On the displayed Objectspage, select Tables, locate the target table, and click Open in the Operationcolumn.

Step 2 On the displayed page, double-click a cell to edit data. After adding or editingdata, submit and save the changes.

Table 10-3 Functions

Item Description

Where Condition Filters records.

Copy Row Copies data of selected rows. Specifically, double-click thetarget row and then click Copy Row.

Copy Column Allows you to copy all data in a column by selecting thiscolumn from the Copy Column drop-down list.

Column Settings Allows you to set the columns you want to display.

Refresh Allows you to update table data manually.

Row Details Shows the detailed information of a specified row.

Add Allows you to add rows.

Submit Allows you to submit and save the changes to data.

Delete Row Allows you to delete the selected rows.

----End

Data Admin ServiceUser Guide

10 GaussDB(for Cassandra) DB InstanceManagement (Standard Edition)

Issue 01 (2020-09-27) Copyright © Huawei Technologies Co., Ltd. 181

Page 191: User Guide...User. {{]}]} {}]}

10.2.2 Viewing Table Details

Prerequisites● You have logged in to a GaussDB(for Cassandra) DB instance on the DAS

console.● At least one table has been created in the current keyspace.

Procedure

Step 1 On the top menu bar, choose Keyspace Management.

Step 2 On the displayed Objects tab, choose Tables on the left, locate the target table,and click View in the Operation column.

Step 3 In the displayed dialog box, view basic table information and DDL statements.

----End

10.3 View Management

10.3.1 Opening a View

Prerequisites● You have logged in to a GaussDB(for Cassandra) DB instance on the DAS

console.● At least one view has been created in the current keyspace.

NO TE

You can create views in the SQL window.

Procedure

Step 1 On the top menu bar, choose Keyspace Management. On the displayed Objectspage, select Views, locate the target view, and click Open in the Operationcolumn.

Step 2 On the displayed page, you can obtain the view details, but cannot edit them.

Table 10-4 Functions

Item Description

Where Condition Filters records.

Copy Column Allows you to copy all data in a column by selecting thiscolumn from the Copy Column drop-down list.

Column Settings Allows you to set the columns you want to display.

Refresh Allows you to update table data manually.

Data Admin ServiceUser Guide

10 GaussDB(for Cassandra) DB InstanceManagement (Standard Edition)

Issue 01 (2020-09-27) Copyright © Huawei Technologies Co., Ltd. 182

Page 192: User Guide...User. {{]}]} {}]}

----End

10.3.2 Obtaining View Details

Prerequisites● You have logged in to a GaussDB(for Cassandra) DB instance on the DAS

console.● At least one view has been created in the current keyspace.

NO TE

You can create views in the SQL window.

Procedure

Step 1 On the top menu bar, choose Keyspace Management. On the displayed Objectstab, choose Views on the left. You may filter the target view by view name.

Step 2 Locate the target view and click View in the Operation column.

Step 3 Obtain details of the current view. Then, click Close.

----End

10.4 Custom Type

10.4.1 Viewing Custom Type

Prerequisites● You have logged in to a GaussDB(for Cassandra) DB instance on the DAS

console.● At least one user-defined type has been created in the current keyspace.

NO TE

If the basic types do not meet your requirements or are inconvenient for use, you cancreate a new type in the SQL window.

Procedure

Step 1 On the top menu bar, choose Keyspace Management. On the displayed Objectstab, choose Custom Type on the left. You may filter the target user type by usertype name.

Step 2 Locate the target user type and click View in the Operation column.

Step 3 Obtain details of the current user type. Then, click Close.

----End

Data Admin ServiceUser Guide

10 GaussDB(for Cassandra) DB InstanceManagement (Standard Edition)

Issue 01 (2020-09-27) Copyright © Huawei Technologies Co., Ltd. 183

Page 193: User Guide...User. {{]}]} {}]}

10.5 Import and Export

10.5.1 Data Import

DescriptionThis topic describes how to import data into a table for backup or data migration.The table structure to be imported must be the same as that of the target table. Ifyou import a CSV or SQL file, the data type of the target table must be the same.

Only a file smaller than 10 GB can be imported.

PrerequisitesYou have logged in to a GaussDB(for Cassandra) DB instance on the DAS console.

Procedure

Step 1 On the top menu bar, choose Import and Export > Import.

Step 2 Import a file from your local PC or an OBS bucket.● From your local PC

On the Import page, click Create Task in the upper left corner. In the displayeddialog box, select a required import type, set File Source to Upload File, specifyAttachment Storage, and upload a file. Select the keyspace, charset, and option,and enter the remarks as required.

NO TE

● To keep data secure, provide your own OBS bucket to store the attachments you upload.In this way, DAS automatically connects to your OBS bucket for in-memory reading.

● If you select Delete the uploaded file upon an import success, the file you upload willbe automatically deleted from the OBS bucket after being imported to the destinationdatabase.

● From an OBS bucketOn the Import page, click Create Task in the upper left corner. In thedisplayed dialog box, select a required import type, set File Source to ChooseFrom OBS, and select the file to be imported from the displayed OBSBrowser. Then, select the keyspace, charset, and option, and enter remarks asrequired.

NO TE

The file uploaded from an OBS bucket will not be deleted upon an import success.

Step 3 After settings are complete, click Create. Confirm the information again beforeyou click OK because original data may be overwritten after data import.

Step 4 View the import progress in the task list or check task details.

----End

Data Admin ServiceUser Guide

10 GaussDB(for Cassandra) DB InstanceManagement (Standard Edition)

Issue 01 (2020-09-27) Copyright © Huawei Technologies Co., Ltd. 184

Page 194: User Guide...User. {{]}]} {}]}

10.5.2 Data Export

ScenariosDAS supports pagination query to meet your requirements for querying largeamounts of data. You can export all the data at a time when backing up ormigrating data.

PrerequisitesYou have logged in to a GaussDB(for Cassandra) DB instance on the DAS console.

ProcedureStep 1 On the top menu bar, choose Import and Export > Export.

Step 2 On the Export page, click Create Task in the upper left corner and select ExportKeyspace or Export CQL Result as required. The following describes how toexport keyspace. The procedure for exporting a CQL result set is similar.

Alternatively, you can click Quick Export to export the specified data informationquickly.

Step 3 In the displayed dialog box, set parameters under Basic Information and selectoptions under Advanced Settings as required, and select the table to be exportedin the right pane.

Step 4 After settings are complete, click OK.

Step 5 In the task list, view the task ID, type, status, and progress.

Step 6 Click Detail in the Operation column to view task details.

----End

10.6 SQL Operations

10.6.1 SQL Window

PrerequisitesYou have logged in to a GaussDB(for Cassandra) DB instance on the DAS console.

ProcedureStep 1 On the top menu bar, choose SQL Operations > SQL Window.

Step 2 In the navigation pane on the left, view the keyspace, tables, and views.

Data Admin ServiceUser Guide

10 GaussDB(for Cassandra) DB InstanceManagement (Standard Edition)

Issue 01 (2020-09-27) Copyright © Huawei Technologies Co., Ltd. 185

Page 195: User Guide...User. {{]}]} {}]}

● Execute SQL: executes SQL statements.● SQL Favorites: allows you to add, view, and manage frequently used SQL

statements.● Format SQL: improves the readability of SQL statements. If you click this

button, the SQL statements are displayed in line break mode but the logicand semantics of the SQL statements will not be changed.

Step 3 After SQL statements are executed, view SQL execution status on the ExecutedSQL Statements, Messages, and Result Set tab pages.

----End

10.6.2 SQL History

PrerequisitesYou have logged in to a GaussDB(for Cassandra) DB instance on the DAS console.

Procedure

Step 1 On the top menu bar, choose SQL Operations > SQL History.

Step 2 On the displayed page, search for the execution information about the target SQLby time range, keyspace name, or keyword.

● To go to the Keyspace Management page, click a keyspace name.● To copy and use your required SQL statements, click the SQL statement in the

SQL Statement column.● To directly execute a SQL statement, click Open in SQL Window in the

Operation column.

----End

10.7 Other Operations

10.7.1 Role Management

PrerequisitesYou have logged in to a GaussDB(for Cassandra) DB instance on the DAS console.

Procedure

Step 1 On the top menu bar, choose Other Operations > Role Management.

Step 2 On the role management page, click Create Role in the upper left corner.

Data Admin ServiceUser Guide

10 GaussDB(for Cassandra) DB InstanceManagement (Standard Edition)

Issue 01 (2020-09-27) Copyright © Huawei Technologies Co., Ltd. 186

Page 196: User Guide...User. {{]}]} {}]}

Step 3 Set the parameters under the Basic Information, Data Permissions, and RolePermissions tabs.

On the Basic Information tab, enter a role name (mandatory), set a password,and confirm the password. You can select a role name from role members toassign the permissions of an existing role to the current role. If you do not need toset data permissions and role permissions for the role, click Save in the lower partof the page and then click OK in the displayed SQL Preview dialog box.

NO TE

If no password is set for the role (for example, role_03) or Allow Login is not selected forthe role, role_03 cannot be used to log in to the database. If the permissions of role_03 arethen assigned to another role (for example, test_02), test_02 will have all the permissionsof role_03.

Step 4 (Optional) On the Data Permissions tab, click Add. On the displayed page, setparameters as required, and then click OK. If you do not need to set other options,click Save in the lower part of the page and then click OK in the displayed SQLPreview dialog box.

Step 5 (Optional) On the Role Permissions tab, click Add. On the displayed page, selecta resource type, role name, and permissions as required, and then click OK. If youdo not need to set other options, click Save in the lower part of the page and thenclick OK in the displayed SQL Preview dialog box.

Step 6 On the role management page, edit existing roles if needed. For how to edit arole, see 3 to 5. You can also delete existing roles. Deleted roles cannot berestored. Exercise caution when performing this operation.

NO TE

The admin, monitor, backupuser, and rwuser roles are system roles and cannot be edited ordeleted.

----End

Data Admin ServiceUser Guide

10 GaussDB(for Cassandra) DB InstanceManagement (Standard Edition)

Issue 01 (2020-09-27) Copyright © Huawei Technologies Co., Ltd. 187

Page 197: User Guide...User. {{]}]} {}]}

11 GaussDB(openGauss) DB InstanceManagement (Standard Edition)

11.1 Feature Overview

Logging In to a DB Instance

Step 1 Log in to the DAS console.

Step 2 In the login list, locate the DB instance you want to log in to and click Log In inthe Operation column.

For more login information, see Adding Login Information.

----End

DAS FeaturesThis topic briefly describes the page for managing databases to help you betterunderstand DAS.

Table 11-1 Functions

No. Item Description

1 Top menu bar Provides entries to functional modules such asSQL operations and database management.

2 Account informationand logout

Displays the current account information anda logout button.

3 DB instanceinformation

Displays the current database information,such as the DB engine logo, DB instancename, and DB engine version.

Data Admin ServiceUser Guide

11 GaussDB(openGauss) DB Instance Management(Standard Edition)

Issue 01 (2020-09-27) Copyright © Huawei Technologies Co., Ltd. 188

Page 198: User Guide...User. {{]}]} {}]}

No. Item Description

4 Database list Displays the databases of the current DBinstance, including user databases and systemdatabases.Allows you to search for a database by name.Allows you to create databases.

5 SQL history Displays the executed SQL statements in theSQL window when Show Executed SQLStatements is enabled for adding a databaselogin.

11.2 SQL Operations

11.2.1 SQL Window

Prerequisites

You have logged in to the DAS console.

Procedure

Step 1 On the Home page, locate the target database in the Database List area, andclick Query SQL Statements in the Operation column. Alternatively, choose SQLOperations > SQL Window from the top menu bar.

Step 2 In the navigation pane on the left, view the database, tables, and views.

● Execute SQL: executes SQL statements.

● Format SQL: improves the readability of SQL statements. If you click thisbutton, the SQL statements are displayed in line break mode but the logicand semantics of the SQL statements will not be changed.

● Execute SQL Plan: reports the execution of SQL statements to facilitatetroubleshooting and optimize SQL processing performance.

● SQL Favorites: allows you to add, view, and manage frequently used SQLstatements.

----End

11.2.2 SQL History

Prerequisites

You have logged in to the DAS console.

Data Admin ServiceUser Guide

11 GaussDB(openGauss) DB Instance Management(Standard Edition)

Issue 01 (2020-09-27) Copyright © Huawei Technologies Co., Ltd. 189

Page 199: User Guide...User. {{]}]} {}]}

Procedure

Step 1 On the top menu bar, choose SQL Operations > SQL History.

Step 2 On the displayed page, search for execution information about the target SQLstatement by time range, database name, or keyword.● To access the Database Management, click a database name.● To copy and use your required SQL statements, click the SQL statement in the

SQL Statement column.● To directly execute a SQL statement, click Open in SQL Window in the

Operation column.

----End

11.3 Database Management

PrerequisitesYou have logged in to the DAS console.

OverviewYou can go to the Database Management page using either of the followingmethods:

● In the database list of the Home page, locate the target database and clickManage in the Operation column.

● Select Database Management on the top menu bar.

Table 11-2 Functions

No. Description

1 Displays the name of the current database.

2 Allows you to change databases in the current DB instance.

3 Displays the IP address, port number, and character set of the currentDB instance.

4 Allows you to open the SQL window of the current database.

Data Admin ServiceUser Guide

11 GaussDB(openGauss) DB Instance Management(Standard Edition)

Issue 01 (2020-09-27) Copyright © Huawei Technologies Co., Ltd. 190

Page 200: User Guide...User. {{]}]} {}]}

No. Description

5 Periodically collects metadata such as databases, tables, and fields ofthe DB instance and stores the data to the databases of DAS.Advantages:● Reduces queries on user databases and the impact on the

performance of user databases.● Improves the search performance for DB instances that contain a

large number of tables and supports pagination queries.Note:Only structural metadata is collected, which means that user's tabledata is not included.

6 Provides three functional modules: Schemas, Objects, and MetadataCollection.

7 Allows you to perform operations.

Schemas

Step 1 On the Schemas tab page, click Create Schema in the upper left corner.

Step 2 In the displayed dialog box, enter a schema name and click OK to create aschema.

● Open: Click it to display the table name, row value, and character set of thecorresponding database schema.

● Drop: Click it to drop a schema. A dropped schema cannot be restored.Exercise caution when performing this operation.

----End

Objects

You can create objects such as tables, views, and triggers by executing SQLstatements.

Metadata Collection

In DAS 2.0, DB instance metadata such as databases, tables, and field can beautomatically collected and stored in the DAS database. In addition, it collectsonly structural metadata, but not data in user tables, which ensures data security.Metadata collection delivers the following advantages:

● Reduces queries on user databases and the impact on the performance ofuser databases.

● Improves the search performance for DB instances that contain a largenumber of tables and supports pagination queries.

Data Admin ServiceUser Guide

11 GaussDB(openGauss) DB Instance Management(Standard Edition)

Issue 01 (2020-09-27) Copyright © Huawei Technologies Co., Ltd. 191

Page 201: User Guide...User. {{]}]} {}]}

Procedure

Step 1 On the Database Management page, enable Auto Metadata Collection in theupper right corner and click the Metadata Collection tab.

Step 2 On the displayed page, click Collect Now to start the collection. You can also stopthe collection or view collection details.● Clear Collected Data: Clears the collected data such as metadata, database

structure, and table structure.● Delete Logs: Deletes logs. Deleted logs cannot be restored.

----End

11.4 Other Operations

11.4.1 Role Management

PrerequisitesYou have logged in to the DAS console.

Procedure

Step 1 On the top menu bar, choose Other Operations > Role Management.

Step 2 In the user management list, filter and manage created users by role name.● Edit: Locate the target role name and click Edit in the Operation column.

Then, you can reset the password, modify the role group, and addpermissions.

● Rename: Click Rename in the Operation column. Then, enter a new rolename, and click OK.

● Delete: Click Delete in the Operation column to delete the current role.

Step 3 (Optional) Click Create Role. On the displayed page, set the parameters under theBasic Settings, Role Groups and Permissions, and click Save. In the displayedSQL Preview dialog box, click OK.

----End

Data Admin ServiceUser Guide

11 GaussDB(openGauss) DB Instance Management(Standard Edition)

Issue 01 (2020-09-27) Copyright © Huawei Technologies Co., Ltd. 192

Page 202: User Guide...User. {{]}]} {}]}

12 Enterprise Edition

12.1 Introduction

12.1.1 What Is DAS Enterprise Edition?

IntroductionThe DAS Enterprise Edition is a DevOps database product with focus on databaseaccess, operation security, and communication of programmers, DBAs, andenterprise managers. It combines automatic identification of modification risksand the permission approval process to ensure data change security and improvedevelopment efficiency. Compared with Standard Edition, Enterprise Edition ismore suitable for enterprise users.

Features● DB instances are added by DBAs. Developers no longer have access to

database usernames and passwords.● You can customize approval processes on specific operations, such as data

query, structure modification, on databases to achieve fine-grainedmanagement.

● Each database has an owner who can assign permissions to other users tocontrol their access to the database.

● All the operations, including user login, SQL query, and data modification, canbe audited.

● You can flexibly set the maximum number of rows that can be returned for asingle SQL query in each database.

● When data is modified, the rows containing the modified data areautomatically backed up.

● The rows affected by data modifications are automatically verified to preventdevelopers from executing unexpected SQL statements.

● Data fields can be masked or tagged with sensitivity labels to protect the coredata.

Data Admin ServiceUser Guide 12 Enterprise Edition

Issue 01 (2020-09-27) Copyright © Huawei Technologies Co., Ltd. 193

Page 203: User Guide...User. {{]}]} {}]}

● By customizing approval processes, DBAs can delegate some SQL changepermissions to the development and service owners to improve thedevelopment efficiency. DBAs can devote more time on core businessdevelopment.

12.1.2 User Roles

RolesEnterprise Edition has the following user roles: system administrator, DBA, andcommon user. Each database has an owner role.

System AdministratorEnterprise administrator who buys and enables HUAWEI CLOUD accounts bydefault. The administrator is mainly responsible for managing enterprise useraccounts and adding cloud accounts of DBAs and developers to the enterprise.

DBADatabase administrator of enterprises. The DBA is mainly responsible for addingDB instances, defining the approval processes of DB instance and databaseoperations, and approving the service tickets modified by developers.

Common UserCommon enterprise developer. Before performing any operation on the enterprisedatabases, the developer needs to apply for corresponding permissions.

NO TE

Database Owner● Service owner. Databases are used by service groups. The database owner is mainly

responsible for approving the permission changes of developers.● The owner and system roles are also common users and responsible for approving

permission changes of developers.

12.1.3 Scenarios

System AdministratorAfter purchasing Enterprise Edition as a system administrator, perform thefollowing operations to configure your database:

Step 1 On the Home page, choose System Management > User Management on thetop menu bar.

Data Admin ServiceUser Guide 12 Enterprise Edition

Issue 01 (2020-09-27) Copyright © Huawei Technologies Co., Ltd. 194

Page 204: User Guide...User. {{]}]} {}]}

Figure 12-1 Home page

Step 2 On the User Management page, click Add User to add a DBA user.

Figure 12-2 Adding a DBA user

Step 3 On the User Management page, repeat the preceding steps to add a commonuser. For details, see User Management.

Data Admin ServiceUser Guide 12 Enterprise Edition

Issue 01 (2020-09-27) Copyright © Huawei Technologies Co., Ltd. 195

Page 205: User Guide...User. {{]}]} {}]}

Figure 12-3 Adding a common user

----End

DBAPerform the following operations as a DBA role:

Step 1 Define an approval process. For details, see Adding an Approval Process.

Figure 12-4 Approval process

Data Admin ServiceUser Guide 12 Enterprise Edition

Issue 01 (2020-09-27) Copyright © Huawei Technologies Co., Ltd. 196

Page 206: User Guide...User. {{]}]} {}]}

Figure 12-5 Adding a user by role

Step 2 Add an instance. For details, see Instance Management.

Figure 12-6 Adding an instance

Step 3 Configure an OBS bucket. For details, see Global Configuration Management.

Figure 12-7 Configuring an OBS bucket

----End

Common User

Step 1 Apply for required permissions on databases. For details, see Creating a ServiceTicket.

Data Admin ServiceUser Guide 12 Enterprise Edition

Issue 01 (2020-09-27) Copyright © Huawei Technologies Co., Ltd. 197

Page 207: User Guide...User. {{]}]} {}]}

Figure 12-8 Creating a service ticket

Step 2 Execute an SQL query. For details, see SQL Window.

Figure 12-9 Executing an SQL query

----End

12.2 Enterprise Edition Enablement

PrerequisitesYou have logged in to the DAS console.

Procedure

Step 1 In the navigation pane on the left, click Enterprise Edition.

NO TE

● Currently, only MySQL and GaussDB(for MySQL) databases are supported.● You can only increase the number of purchased instances after a purchase. Exercise

caution when selecting the instance quantity.

Step 2 Click Enable Enterprise in the upper right corner of the page. On the displayedpage, set parameters as prompted.

Data Admin ServiceUser Guide 12 Enterprise Edition

Issue 01 (2020-09-27) Copyright © Huawei Technologies Co., Ltd. 198

Page 208: User Guide...User. {{]}]} {}]}

Figure 12-10 Yearly/Monthly

Figure 12-11 Pay-per-use

Step 3 After the settings are complete, click Buy Now in the lower part of the page.

Step 4 On the Confirm page, confirm the settings.● If you need to modify the settings, click Previous to modify parameters.● If you do not need to modify the settings, click Submit and pay for the order.

Step 5 After the payment is complete, you can view the enterprise information on theEnterprise Edition page, such as the administrator, specifications, billing mode,joined time, enabled time, and expiration date.

Step 6 If you are accessing the Enterprise Edition for the first time, click AccessEnterprise. In the displayed dialog box, modify enterprise name. Alternatively,

click to modify the enterprise name and then click Access Enterprise.

Step 7 On the Home page, perform related operations as required.

NO TE

Billing details of DAS Enterprise Edition:● Yearly/Monthly: provides a larger discount than pay-per-use. Therefore, it is highly cost-

effective for long-term subscribers.● If your enterprise specifications are different from the expected ones due to incorrect

settings, choose Billing Center > My Orders.On the displayed page, click Unsubscriptions and Changes. For details, clickUnsubscription Rules on the current page.

● Pay-per-use: You are charged based on the actual usage by hour. Partial hours are billedas full hours.

● When enabling Enterprise Edition, select the specifications and click Buy Now. If youneed to change the specifications, choose More > Change Specification on theEnterprise Edition page.

● If you want to disable the pay-per-use billing mode, choose More > Delete on theEnterprise Edition page.

----End

12.3 Home PageBased on the minimum permission control and approval process mechanism,Enterprise Edition features data protection, change review, operation audit, andself-service R&D functions, implementing standardized management on yourlarge-scale databases.

Data Admin ServiceUser Guide 12 Enterprise Edition

Issue 01 (2020-09-27) Copyright © Huawei Technologies Co., Ltd. 199

Page 209: User Guide...User. {{]}]} {}]}

Process

Enterprise Edition uses several methods including data access, sensitive dataprotection, and role-based management to improve the security and reliability ofenterprise data management. The following figure shows the process.

Home Page

Figure 12-12 Home page

No. Function Description

1 Top menu bar Includes entries of the service tickets, SQL console,database management and data scheme.

2 Accountinformationand logout

Displays the current account information and a logoutbutton.

3 EnterpriseEditioninformation

Displays the enterprise name, current specification,added instances, and instance expiration date. It alsoincludes upgrade and renew specification entries.

Data Admin ServiceUser Guide 12 Enterprise Edition

Issue 01 (2020-09-27) Copyright © Huawei Technologies Co., Ltd. 200

Page 210: User Guide...User. {{]}]} {}]}

No. Function Description

4 Operationguide andquick entries

Displays Enterprise Edition operation usage processand database permission application, SQL console andother entries.

5 Ticketsinformation

Displays approval statuses of tickets.

6 My favoritesand recentlyused

Allows you to add databases to favorites. You canquickly view information about your favoritedatabases and recently used databases.

12.4 Service Tickets

12.4.1 Creating a Service Ticket

PrerequisitesYou have entered the Enterprise Edition page and have required permissions.

ScenariosThere are five types of service tickets that are used to request permissions ondatabases and sensitive columns, as well as request SQL modification, big dataimport modification, and data export.

NO TE

If you are a common user, request permissions on databases first.SQL modification refers to the permissions to execute SQL statements such as DML andDDL.

Procedure

Step 1 On the top navigation bar, click Tickets.

Step 2 In the upper right corner of the page, click Create Ticket. In Create Ticket dialogbox, select the required permission type. The following uses Request SQLModification as an example to describe how to create a ticket. The operations forother tickets are similar.

Step 3 In Create Ticket dialog box, choose Request SQL Modification and click OK. Youcan see the permission application details page.

Step 4 Click Add Database. In the displayed database list, you can filter databases byPermission Types, Environment Type, and DB Engine. Choose required database,and click Add.

Step 5 On the details page, choose SQL text and enter SQL statements in the text box, orclick to Upload file to upload a .sql file. After the file is successfully uploaded, theSQL file will be automatically added to the text box.

Data Admin ServiceUser Guide 12 Enterprise Edition

Issue 01 (2020-09-27) Copyright © Huawei Technologies Co., Ltd. 201

Page 211: User Guide...User. {{]}]} {}]}

Step 6 In Estimated Affected Rows text box, enter the number of rows that may beaffected in this data modification. Check the previous settings if there is a bigdifference between the estimated value and the actual value.

Step 7 In Reason for Modification text box, enter the reason for the SQL modification.Please enter the reason in detail to facilitate the approval.

Step 8 In Task Control Items, there are three Execution Modes.● Manually execution after approval: After SQL modification is approved, you

need to manually perform the operation.● Automatically execution after approval: After SQL modification is approved,

the system automatically performs the operation.● Execute at a specified time point: After SQL modification is approved, you

can customize the execution time.

Step 9 Click Submit. The system automatically performs prechecks. The check result anderror type are displayed in the lower part of the pre-check operation page.

Step 10 After checking and confirming the request information again, the systemautomatically performs approval operation, and processes transaction according tothe preset approval process.

----End

NO TE

1 You must have at least one of the following permissions to perform SQL modification: 1)data modification permission 2) structure modification permission 3) High-risk operationpermission 4) O&M permission.2 You can select a maximum of 10 databases.3 A single SQL modification supports only the databases that use the same DB engine.

12.5 Instances/Databases/Sensitive Columns

12.5.1 DatabasesDatabase permissions are classified into Common Permissions, OwnerPermissions, and DBA Permissions.

PrerequisitesYou have entered the Enterprise Edition page and have required permissions.

Request for AuthorityNO TE

● The database permissions you apply for this time will overwrite the existing databasepermissions.

● The application cannot be submitted repeatedly for the database being approved.Submit a new application after the current application is approved.

Step 1 On the top navigation bar, choose Instance/Databases/Sensitive Columns >Databases.

Data Admin ServiceUser Guide 12 Enterprise Edition

Issue 01 (2020-09-27) Copyright © Huawei Technologies Co., Ltd. 202

Page 212: User Guide...User. {{]}]} {}]}

Step 2 In database list, click Request for authority.

Step 3 Click Add. In the dialog box, select the database for which you want to requestpermissions and click Add.

Step 4 Choose Database Permission Application, Database Owner, or Database DBA.

Step 5 Configure Permission, Duration, and Application Reason. Click Submit.

NO TE

Query: data query, such as SQL window query and table data query.

Data modification: data write for modification.

Structure modification: used for table structure modification.

O&M: O&M personnel write certain commands, such as grant and kill.

High-risk operation: operations involving physical deletion, such as dropping databases\tables, truncating tables, and dropping tables.

Step 6 In the database list, to view authority details, click Authority detail. To go to thedatabase management page, click Manage Database. To perform SQL query, clickQuery.● Authority Detail

In the database list, click Authority detail. In the dialog box, you can viewthe Current database name, Database DBA, Database Owner, and UserList.

● For details about how to manage databases, see Database Management.● For details about how to query SQL, see SQL Query.

----End

12.5.2 Instances

Prerequisites

You have entered the Enterprise Edition page and have required permissions.

Procedure

Step 1 On the top navigation bar, choose Instance/Databases/Sensitive Columns >Instances.

Step 2 View instance in the instance list.

Step 3 Locate the target instance and click View Database in the Operation column.

----End

12.5.3 Sensitive Columns

Prerequisites

You have entered the Enterprise Edition page and have required permissions.

Data Admin ServiceUser Guide 12 Enterprise Edition

Issue 01 (2020-09-27) Copyright © Huawei Technologies Co., Ltd. 203

Page 213: User Guide...User. {{]}]} {}]}

Requesting for Sensitive Column Authority

Step 1 On the top menu bar, choose Instances/Databases/Sensitive Columns >Sensitive Columns.

Step 2 On the Sensitive Column List page, click Request for sensitive columnauthority.

Step 3 On the displayed page, click Add. In the dialog box, select the sensitive columns tobe added and click Add.

You can remove one sensitive column or remove them in batches.

NO TE

● The permissions you request this time will overwrite the existing permissions.● The application cannot be submitted repeatedly for the sensitive column being

approved. Submit a new application after the current application is approved.

Step 4 Select a permission type based on your business requirements.

Step 5 Select 1 month, 3 months, 6 months, 1 year, 2 years, 3 years, or customize aduration.

Step 6 Enter your reason for requesting the sensitive column to ensure the approval isapproved.

Step 7 After entering application information, click Submit to enter the approval process.

Step 8 After submitting the application, on the top navigation bar, choose Tickets to viewthe basic information and approval progress.

----End

12.6 SQL Query

12.6.1 SQL Window

PrerequisitesYou have entered the Enterprise Edition page and have required permissions.

Procedure

Step 1 On the top menu bar, select SQL Console. In the displayed Select Databasedialog box, select a database, and click OK.

Step 2 In the navigation pane, specify a database, table, or view.

Data Admin ServiceUser Guide 12 Enterprise Edition

Issue 01 (2020-09-27) Copyright © Huawei Technologies Co., Ltd. 204

Page 214: User Guide...User. {{]}]} {}]}

● Execute SQL: executes SQL statements.● Format: improves the readability of SQL statements. If you click this button,

the SQL statements are displayed in line break mode but the logic andsemantics of the SQL statements will not be changed.

● Execute SQL Plan: reports the execution of SQL statements to facilitatetroubleshooting and optimize SQL processing performance.

● Stored SQL: allows you to add, view, and manage frequently used SQLstatements.

Step 3 After SQL statements are executed, view SQL execution status on the ExecutedSQL Statements, Messages, and Result Set tab pages.

----End

12.6.2 Metadata Collection

PrerequisitesYou have entered the Enterprise Edition page and have required permissions.

Procedure

Step 1 On the top menu bar, select SQL Console. In the displayed Select Databasedialog box, select the database to be queried and click OK.

Step 2 On the displayed page, click Metadata Collection. You can select and operate aresult set from the metadata collection information list.

Data Admin ServiceUser Guide 12 Enterprise Edition

Issue 01 (2020-09-27) Copyright © Huawei Technologies Co., Ltd. 205

Page 215: User Guide...User. {{]}]} {}]}

Figure 12-13 Metadata collection details

----End

12.7 Database Management

PrerequisitesYou have entered the Enterprise Edition page and have required permissions.

12.7.1 Table Management

PrerequisitesYou have entered the Enterprise Edition page and have required permissions.

Procedure

Step 1 On the top navigation bar, click Database Management. In the Select Databasedialog box, select a database and click OK.

Step 2 Click + before a table name to view the Column, Indexes, and Foreign Keys ofthe current table.

Click Column to view Column Name, Type, and Index Type of the current table.In Operation column, you can perform following operations:● Click Adjust security level to configure Is it a sensitive field.● Click Adjust Log to view when the column was modified and the user who

has modified the column.● Click Permission Change Log to view the authority type, dredge way, and

dredge time.

Data Admin ServiceUser Guide 12 Enterprise Edition

Issue 01 (2020-09-27) Copyright © Huawei Technologies Co., Ltd. 206

Page 216: User Guide...User. {{]}]} {}]}

Figure 12-14 Objects details

Step 3 On objects details page, in Operation column, you can perform followingoperations:● Click Query and you will be redirected to SQL Window page and perform

SQL query.● Click Open and you go to the detail page of the current table. You can view

the name, type, and other information of the current table.

Figure 12-15 Clicking Open

● Click View and you can see a text box, showing Basic Information about thecurrent table, including the name of Database, Table Name, and RowsCount.

Figure 12-16 Clicking View

● In this text box, you can also click SQL Statements for Creating Table toview details about the SQL statements for creating the current table.

Data Admin ServiceUser Guide 12 Enterprise Edition

Issue 01 (2020-09-27) Copyright © Huawei Technologies Co., Ltd. 207

Page 217: User Guide...User. {{]}]} {}]}

Figure 12-17 Clicking SQL Statements for Creating Table

----End

12.7.2 View Management View Management

PrerequisitesYou have entered the Enterprise Edition page and have required permissions.

Procedure

Step 1 On the top menu bar, choose Database Management. In the Select Databasedialog box, select a database and click OK. On the displayed Objects page, selectView, locate the target view, and click Open in the Operation column.

Step 2 On the displayed page, you can check the view directly or click Where Conditionto get the view information.

Data Admin ServiceUser Guide 12 Enterprise Edition

Issue 01 (2020-09-27) Copyright © Huawei Technologies Co., Ltd. 208

Page 218: User Guide...User. {{]}]} {}]}

Table 12-1 Functions

Item Description

Where Condition Filters records.

Copy Row Copies data of selected rows. Specifically, double-click thetarget row and then click Copy Row.

Copy Column Allows you to copy all data in a column by selecting thiscolumn from the Copy Column drop-down list.

Column Settings Allows you to set the columns you want to display.

Refresh Allows you to update table data manually.

Row Details Shows the detailed information of a specified row.

NO TE

View data can be only queried, but not be edited, because views do not have primary keys.

----End

12.7.3 Stored Procedure Management

Prerequisites

You have entered the Enterprise Edition page and have required permissions.

Procedure

Step 1 On the top menu bar, choose Database Management. On the displayed Objectspage, select Stored Procedures, locate the target stored procedure, and click ViewDetails in the Operation column.

Data Admin ServiceUser Guide 12 Enterprise Edition

Issue 01 (2020-09-27) Copyright © Huawei Technologies Co., Ltd. 209

Page 219: User Guide...User. {{]}]} {}]}

Figure 12-18 Stored procedure

Figure 12-19 Viewing details of a stored procedure

----End

12.7.4 Event Management

Prerequisites

You have entered the Enterprise Edition page and have required permissions.

Procedure

Step 1 On the top menu bar, choose Database Management. On the displayed Objectstab page, select Event, locate the target event, and click Event Detail in theOperation column.

Data Admin ServiceUser Guide 12 Enterprise Edition

Issue 01 (2020-09-27) Copyright © Huawei Technologies Co., Ltd. 210

Page 220: User Guide...User. {{]}]} {}]}

Figure 12-20 Event management

Figure 12-21 Viewing details of an event

----End

12.7.5 Trigger Management

Prerequisites

You have entered the Enterprise Edition page and have required permissions.

Procedure

Step 1 On the top navigation bar, choose Database Management. On the displayedObjects tab page, choose Trigger on the left, locate the target trigger, and clickDetails in the Operation column.

Data Admin ServiceUser Guide 12 Enterprise Edition

Issue 01 (2020-09-27) Copyright © Huawei Technologies Co., Ltd. 211

Page 221: User Guide...User. {{]}]} {}]}

Figure 12-22 Trigger management

Figure 12-23 View details of a trigger

----End

12.7.6 Function Management

PrerequisitesYou have entered the Enterprise Edition page and have required permissions.

Data Admin ServiceUser Guide 12 Enterprise Edition

Issue 01 (2020-09-27) Copyright © Huawei Technologies Co., Ltd. 212

Page 222: User Guide...User. {{]}]} {}]}

Procedure

Step 1 On the top menu bar, choose Database Management. On the displayed Objectstab page, choose Function on the left, locate the target function, and click ViewDetails in the Operation column.

Figure 12-24 Function management

Figure 12-25 Viewing details of a function

----End

Data Admin ServiceUser Guide 12 Enterprise Edition

Issue 01 (2020-09-27) Copyright © Huawei Technologies Co., Ltd. 213

Page 223: User Guide...User. {{]}]} {}]}

12.8 Data Scheme

Prerequisites

You have entered the Enterprise Edition page and have required permissions.

12.8.1 SQL Modification

Prerequisites

You have entered the Enterprise Edition page and have required permissions.

SQL Modification

To modify SQL statements, see Creating a Service Ticket.

12.8.2 Big Data Import Modification

Prerequisites

You have entered the Enterprise Edition page and have required permissions.

Scenarios

When importing large amounts of local data to database, you can perform relatedoperations in Big Data Import Modification.

Procedure

Step 1 On the top navigation bar, choose Data Scheme > Big Data Import Modification.The SQL Modification Management / Big Data Import Modification page isdisplayed.

Step 2 On the Basic Information tab page, select the databases which the file is to beimported into. You can import the file to multiple databases in batches.

Step 3 Click Upload file or drag the file to the + area.

Step 4 Select Auto Detect, UTF8, or GBK for Charset.

Step 5 In the Background Information area, in Reason for modification box, enter yourreasons.

Step 6 In the Task Control Items area, select an execution mode.

Step 7 Click Submit and wait for the approval.

Data Admin ServiceUser Guide 12 Enterprise Edition

Issue 01 (2020-09-27) Copyright © Huawei Technologies Co., Ltd. 214

Page 224: User Guide...User. {{]}]} {}]}

NO TE

● To perform a big data import modification, you must have at least one of the followingpermissions: data modification permission, structure modification permission, high-riskoperation permission, or O&M permission.

● A maximum of 10 databases can be selected at a time.● In one big data import modification, the selected databases must be of the same DB

engine.● Only one .sql or .zip file no larger than 10 GB can be uploaded.

----End

12.8.3 Data Export

PrerequisitesYou have entered the Enterprise Edition page and have required permissions.

ScenariosDAS allows you to export a large amount of data at a time to facilitate data queryor to back up data for migration. This topic describes how to export data.

● Both databases and SQL result sets of the primary and standby DB instancescan be exported.

● For single-node DB instances, databases and SQL result sets can be exported.

Procedure

Step 1 On the top navigation bar, choose Database Scheme > Data Export. The dataexport details page is displayed.

Step 2 Enter your reasons for export.

Step 3 Choose Database or SQL Result.

Step 4 If you select Database, please proceed as follows:

Step 5 On the Request Export tab page, select the database to be exported. You canselect All tables or Specific tables in the selected database. If there are a largenumber of tables in the selected database, you can search for them by name inthe search box.

Step 6 (Optional) For Others to Export, select Procedures, Events, Functions, Triggers,or Views as needed.

Step 7 For Object to Export, select Data, Structure, or Data and Structure as needed

Step 8 For File Type, select SQL or CSV.

Step 9 For Character Set, select UTF8 or GBK.

Step 10 (Optional) Click Advanced Options. For File Options, select Combine INSERTstatements or Generate a file for each table as needed.

Step 11 For Extended Options, select Generate a TRUNCATE TABLE statement beforethe INSERT statement as needed

Data Admin ServiceUser Guide 12 Enterprise Edition

Issue 01 (2020-09-27) Copyright © Huawei Technologies Co., Ltd. 215

Page 225: User Guide...User. {{]}]} {}]}

Step 12 For Data Options, select the data type to be exported. Click OK.

NO TE

● Before selecting a database, you need to apply for the required database permission. Fordetails, see Databases.

● When selecting a table, you can select a column of the table and set the WHEREcondition for further filtering.

----End

12.9 System Management

12.9.1 Instance Management

Prerequisites● You have logged in to the DAS console and entered the Enterprise Edition

page.● You have the permissions required to manage instances.

Procedure

Step 1 On the top menu bar, choose System Management > Instance Management.The instance management page is displayed.

Step 2 Click Add Instance in the upper left corner of the page.

Step 3 On the displayed page, set the instance information.

Table 12-2 Basic information

Parameter Description

Region Specifies region where all instances of youraccount are located.

Select Instance Specifies instances that can be added to thecurrent account.

Table 12-3 Instance properties

Parameter Description

Environment Type Set to the test environment or productionenvironment.

Instance DBA Set to the DBA of the current instance.

Service Owner Set to the service owner of the current instance.

Data Admin ServiceUser Guide 12 Enterprise Edition

Issue 01 (2020-09-27) Copyright © Huawei Technologies Co., Ltd. 216

Page 226: User Guide...User. {{]}]} {}]}

Table 12-4 Security control items

Parameter Description

Maximum Number ofRows Returned in aQuery

Specifies the number of rows returned in a singlequery.

Allow DML Execution inSQL Console

Data Manipulation Language (DML) is used toperform simple operations on data in a database,such as INSERT, DELETE, UPDATE, and SELECT. Youcan determine whether to enable Allow DMLExecution in SQL Console as required.

Allow DDL Execution inSQL Console

Data Definition Language (DDL) is used to managesome objects (such as databases and tables) in adatabase, such as CREATE, ALTER, and DROP. Youcan determine whether to enable Allow DDLExecution in SQL Console as required.

Table 12-5 Approval process management

Parameter Description

Enable Instance ApprovalProcess Management

The instance is approved according to relatedapproval processes.

During DatabasePermission Application

You can enable this parameter and set approvalprocess as required. After this parameter is enabled,when a user applies for permissions on databases,the approval process of the service ticket is enabled.

During Data Modification You can enable this parameter and set approvalprocess as required. After this parameter is enabled,when a user applies for permissions on datamodification (DML statements), the approvalprocess of the service ticket is enabled.

During StructureModification

You can enable this parameter and set approvalprocess as required. After this parameter is enabled,when a user applies for permissions on structuremodification (DDL statements), the approval processof the service ticket is enabled.

During O&M You can enable this parameter and set approvalprocess as required. After this parameter is enabled,when a user applies for permissions on O&M (DCLstatements, QUERY SESSIONS, KILL SESSIONS, andCREATE USERS), the approval process of the serviceticket is enabled.

Data Admin ServiceUser Guide 12 Enterprise Edition

Issue 01 (2020-09-27) Copyright © Huawei Technologies Co., Ltd. 217

Page 227: User Guide...User. {{]}]} {}]}

Parameter Description

During Data Export You can enable this parameter and set approvalprocess as required. After this parameter is enabled,when a user applies for permissions on data export,the approval process of the service ticket is enabled.

During High-RiskOperation

Supports the execution of deletion statements,including DROP DATABASE, TRUNCATE TABLE, andDROP USER. After enabling the parameter, you needto select an approval process.

Step 4 After settings are complete, click OK.

Step 5 On the Instance Management page, view information about existing instances,such as the environment type, instance name, and DB engine. You can alsoperform the following operations.● Quick Edit

Click Quick Edit in the Operation column. In the displayed dialog box, viewthe basic information about the current instance and edit the parameters asshown Table 12-6. After completing the settings, click OK.

Table 12-6 Editing instance information

Parameter Description

Username Database name.

Password Password for logging in to the database.

Environment Type Test environment or production environment

Instance DBA Instance O&M personnel

Service Owner Service operator of instance

● Synchronize Dictionary

Generally, metadata is automatically collected once a day. ClickSynchronizing Dictionary in the Operation column or in the upper leftcorner of the page to collect the databases, tables, and fields in the instanceto DAS.You can view the details of the instance synchronization results.

----End

Data Admin ServiceUser Guide 12 Enterprise Edition

Issue 01 (2020-09-27) Copyright © Huawei Technologies Co., Ltd. 218

Page 228: User Guide...User. {{]}]} {}]}

12.9.2 User Management

PrerequisitesYou have logged in to the DAS console and entered the Enterprise Edition page.

Adding a User

Step 1 On the top menu bar, choose System Management > User Management.

Step 2 On the User Management page, click Add User in the upper left corner.

Step 3 In the displayed dialog box, set user information as required.

Table 12-7 Adding a user

Parameter Description

Mode Includes Manually add, Synchronize IAM User, andSynchronize EPS User.● Manually add: Enter the user information. If multiple users

need to be added, separate the user IDs with semicolons (;).● Synchronize IAM User: Select a IAM user to be synchronized

from available users.● Synchronize EPS User: Select an enterprise project and a

user group, and then select an EPS user from available users.

Role Includes common user, DBA, and administrator.

Step 4 After settings are complete, click OK.

Step 5 After the user is added, you can enable, disable, and remove it.● Edit

You can modify the information about an added user in normal state, such asalias, role, employee ID, and mobile number.

● Enable/DisableYou can enable or disable an added user as required to manage permissions.You cannot disable the user who enables the current enterprise.

● RemoveYou can remove a user that is no longer required. After the user is removed,its data cannot be restored. Exercise caution when performing this operation.

----End

12.9.3 Approval Process Management

PrerequisitesYou have logged in to the DAS console and entered the Enterprise Edition page.

Data Admin ServiceUser Guide 12 Enterprise Edition

Issue 01 (2020-09-27) Copyright © Huawei Technologies Co., Ltd. 219

Page 229: User Guide...User. {{]}]} {}]}

Adding an Approval Process

Step 1 On the top menu bar, choose System Management > Approval ProcessManagement.

Step 2 On the upper left of the Approval Process Management page, click Create.

Step 3 In the displayed dialog box, enter an approval process name, add an approver, andenter remarks as required.

Step 4 After settings are complete, click Submit.

----End

Managing an Approval ProcessAfter creating an approval process, you can perform the following managementoperations on the Approval Process Management page:

● EditClick Edit in the Operation column. In the displayed dialog box, editparameters as required and click Submit.

NO TE

After Enterprise Edition is enabled, a system-level process is automatically created andcannot be edited.

● View Associated InstanceClick View Associated Instance in the Operation column. In the displayeddialog box, view details about the associated instance.

● View Associated DatabaseChoose More > View Associated Database in the Operation column. In thedisplayed dialog box, view the details about the associated database.

● Batch Delete/DeleteYou can delete an approval process that is no longer required.By default, there are two approval processes for system initialization: Owner >DBA and Owner -> DBA -> Admin.The approver of each approval stage can be a role or a user. The role can beAdmin (system administrator), DBA, or Owner. Take the approval processOwner -> DBA -> Admin as an example. The first approver is the serviceowner of the database, the second approver is the database DBA, and thethird approver is the system administrator. If a user is both the owner andDBA of a database, after the first-stage application is approved, the second-stage application is also approved by default. Then, the system goes to thethird stage for approval.

Data Admin ServiceUser Guide 12 Enterprise Edition

Issue 01 (2020-09-27) Copyright © Huawei Technologies Co., Ltd. 220

Page 230: User Guide...User. {{]}]} {}]}

NO TE

If you wonder whether a user can serve as three roles Owner, DBA and Admin, seeCan I Have Permissions of Three Roles (Owner, DBA, and System Administrator) at theSame Time?

To delete the approval process of an associated instance or database, cancel theassociation.

Deleted approval processes cannot be restored. Exercise caution when performing thisoperation.

12.9.4 Access ControlTo secure database access, you can configure a whitelist to control IP addressesthat access your database. This topic describes how to configure such a whitelist inthe Enterprise Edition.

Prerequisites

You have entered the Enterprise Edition page and have required permissions.

Adding IP Addresses to a Whitelist

Step 1 On the top navigation bar, choose System Management > Access Control.

Step 2 On the Access Control page, click New Whitelist.

Step 3 In the displayed dialog box, enter the IP addresses to be controlled and enterremarks as required

Step 4 Click Submit.

----End

Editing a Whitelist

Step 1 In the list, view the IP addresses trusted by the current account.

Step 2 Locate the target whitelist and click Edit in the Operation column.

Step 3 In the displayed dialog box, edit the whitelist. You can enter multiple IP addressesat a time, with each two separated using semicolons (;). You can also enter an IPaddress range, for example, 127.1.10.6;192.168.1.64/24.

Step 4 Click OK to save the modification.

----End

Deleting a Whitelist

Step 1 In the list, view the IP addresses trusted by the current account. You can deletewhitelists that do not need to be restricted.

Step 2 Locate the target whitelist and click Delete in the Operation column. In thedisplayed dialog box, click Yes.

Data Admin ServiceUser Guide 12 Enterprise Edition

Issue 01 (2020-09-27) Copyright © Huawei Technologies Co., Ltd. 221

Page 231: User Guide...User. {{]}]} {}]}

CA UTION

Deleted whitelists cannot be recovered. Exercise caution when performing thisoperation.

----End

12.9.5 Operation Audit

PrerequisitesYou have entered the Enterprise Edition page and have required permissions.

Procedure

Step 1 On the top navigation bar, choose System Management > Operation Audit.

Step 2 On the Operation Audit page, search for audit tasks by setting Search By,Functional Module, and Operated.

Step 3 In operation audit list, locate the target audit and click View Details in theOperation column.

----End

12.9.6 Global Configuration Management

ScenariosGlobal configuration management is used to save files.

During data modification, if the backup is enabled, backup files will be saved tothe OBS bucket configured here.

If the OBS bucket is not configured, certain functions such as data backup in datamodification cannot be used properly.

PrerequisitesYou have entered the Enterprise Edition page and have required permissions.

Configuring an OBS Bucket

Step 1 On the top navigation bar, choose System Management > Global ConfigurationManagement.

Step 2 In the navigation pane on the left, choose Configure OBS Bucket > click Set OBSBucket. If you have an available OBS bucket, select it.● If you have no OBS buckets available, click Create OBS Bucket to create one.

For details, see Creating a Bucket.

Step 3 Click Configure Now.

----End

Data Admin ServiceUser Guide 12 Enterprise Edition

Issue 01 (2020-09-27) Copyright © Huawei Technologies Co., Ltd. 222

Page 232: User Guide...User. {{]}]} {}]}

Setting Sensitive Column Approval ProcessNO TE

● The approval process of sensitive columns is globally unified and the setting takes effectfor sensitive columns in all databases.

● When a user applies for the query permission on sensitive columns, the user can set thecorresponding approver.

Step 1 On the top navigation bar, choose System Management > Global ConfigurationManagement.

Step 2 In the navigation tree on the left, choose Set Sensitive Column Approval Process>and click Set Approval Process.

Step 3 Select the target approval process.

Step 4 To create a process, click Create Approval Process and click Create.

Step 5 In Create Approval Process dialog box, enter the approval process name, add anapprover, and enter remarks as required.

Step 6 Click Submit to save the process information. You can view and manage approvalprocesses in the approval process list.

----End

Data Admin ServiceUser Guide 12 Enterprise Edition

Issue 01 (2020-09-27) Copyright © Huawei Technologies Co., Ltd. 223

Page 233: User Guide...User. {{]}]} {}]}

A Change History

Date Description

2020-09-27 This issue is the seventh official release, which incorporates thefollowing change:Updated the description of permission management andoptimized CloudDBA for GaussDB(for MySQL).

2019-02-18 This issue is the sixth official release, which incorporates thefollowing changes:Supported the management of Microsoft SQL Server databaseson ECSs in Adding Login Information.Added the following content in MySQL databases:Supported table maintenance in Maintaining a Table.Supported batch export.Supported SQL templates.Supported querying InnoDB lock statuses in InnoDB LockQuery.Optimized the document.

2019-01-31 This issue is the sixth official release, which incorporates thefollowing changes:Supported the management of Microsoft SQL Server databaseson ECSs in Adding Login Information.Added the following content in MySQL databases:Supported table maintenance in Maintaining a Table.Supported batch export.Supported SQL templates.Supported querying InnoDB lock statuses in InnoDB LockQuery.Optimized the document.

Data Admin ServiceUser Guide A Change History

Issue 01 (2020-09-27) Copyright © Huawei Technologies Co., Ltd. 224

Page 234: User Guide...User. {{]}]} {}]}

Date Description

2018-12-21 This issue is the fourth official release, which incorporates thefollowing changes:Supported the management of self-built databases on ECSs.For details, see Connecting to Self-built Databases on ECSs.Added the page for monitoring database information.Added the following content in MySQL databases:Supported the query of binlogs in Binlog Query.Added the following functions for Microsoft SQL Serverdatabases:Added stored procedure management in Stored ProcedureManagement.Added function management in Function Management.Added trigger management in Trigger Management.

2018-11-13 This issue is the third official release, which incorporates thefollowing changes:Added the following content in MySQL databases:Supported event management in Event Management.Supported stored procedure management in Stored ProcedureManagement.Supported function management in Function Management.Supported batch import.Added the viewing of saved SQL statements in SQL Favorites.Added the following functions for Microsoft SQL Serverdatabases:User management in Database User ManagementViewing of saved SQL statements in SQL Window

2018-09-14 This issue is the second official release, which incorporates thefollowing changes:Supported the management of triggers in MySQL databases inCreating a Database Trigger.Added the database structure export.Added the table structure export.Added the view structure export.Added the export of trigger structures of MySQL databases.Added the viewing of table details in Viewing Table Details.Supported setting an empty password during the creation of aconnection and supported the automatic creation of SQLconnections when users execute SQL statements in the SQLwindow.

2018-08-30 This issue is the first official release.

Data Admin ServiceUser Guide A Change History

Issue 01 (2020-09-27) Copyright © Huawei Technologies Co., Ltd. 225