user guide · relational database service user guide issue 16 date 2018-08-03 huawei technologies...

126
Relational Database Service User Guide Issue 16 Date 2018-08-03 HUAWEI TECHNOLOGIES CO., LTD.

Upload: others

Post on 06-Aug-2020

4 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: User Guide · Relational Database Service User Guide Issue 16 Date 2018-08-03 HUAWEI TECHNOLOGIES CO., LTD

Relational Database Service

User Guide

Issue 16

Date 2018-08-03

HUAWEI TECHNOLOGIES CO., LTD.

Page 2: User Guide · Relational Database Service User Guide Issue 16 Date 2018-08-03 HUAWEI TECHNOLOGIES CO., LTD

Copyright © Huawei Technologies Co., Ltd. 2018. All rights reserved.No part of this document may be reproduced or transmitted in any form or by any means without prior writtenconsent 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 and thecustomer. All or part of the products, services and features described in this document may not be within thepurchase 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, guarantees orrepresentations 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.

Huawei Technologies Co., Ltd.Address: Huawei Industrial Base

Bantian, LonggangShenzhen 518129People's Republic of China

Website: http://e.huawei.com

Issue 16 (2018-08-03) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

i

Page 3: User Guide · Relational Database Service User Guide Issue 16 Date 2018-08-03 HUAWEI TECHNOLOGIES CO., LTD

Contents

1 Managing DB Instances............................................................................................................... 11.1 Getting Started................................................................................................................................................................11.2 DB Instance Operations..................................................................................................................................................11.2.1 Changing a Pay-per-Use DB Instance to Yearly/Monthly...........................................................................................11.2.2 Changing a DB Instance Type from Single to Primary/Standby.................................................................................21.2.3 Manually Switching Between Primary and Standby DB Instances............................................................................ 31.2.4 Changing the CPU or Memory of a DB Instance........................................................................................................41.2.5 Renewing DB Instances...............................................................................................................................................61.2.6 Rebooting a DB Instance.............................................................................................................................................61.2.7 Exporting a DB Instance List...................................................................................................................................... 71.2.8 Modifying the Switchover Policy................................................................................................................................81.2.9 Changing a DB Instance Name................................................................................................................................... 81.2.10 Selecting Displayed Items......................................................................................................................................... 91.2.11 Deleting a DB Instance............................................................................................................................................ 101.2.12 Buying a Same DB Instance.................................................................................................................................... 111.3 Backup and Restore...................................................................................................................................................... 121.3.1 Managing an Automated Backup Policy................................................................................................................... 121.3.2 Creating a Manual Backup........................................................................................................................................ 151.3.3 Restoring a DB Instance to a Point in Time.............................................................................................................. 171.3.4 Restoring a DB Instance from a Backup................................................................................................................... 171.3.5 Downloading a Backup File and Restoring Data from It.......................................................................................... 171.3.6 Replicating a Backup.................................................................................................................................................191.3.7 Deleting a Manual Backup........................................................................................................................................ 201.4 Parameter Groups......................................................................................................................................................... 201.4.1 Creating a Parameter Group...................................................................................................................................... 211.4.2 Modifying Parameters in a Parameter Group............................................................................................................ 221.4.3 Comparing Parameter Groups................................................................................................................................... 231.4.4 Replicating a Parameter Group..................................................................................................................................231.4.5 Resetting a Parameter Group.....................................................................................................................................241.4.6 Associating a Parameter Group with DB Instances...................................................................................................251.4.7 Changing a Parameter Group Description.................................................................................................................261.4.8 Deleting a Parameter Group...................................................................................................................................... 261.5 Storage Space............................................................................................................................................................... 27

Relational Database ServiceUser Guide Contents

Issue 16 (2018-08-03) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

ii

Page 4: User Guide · Relational Database Service User Guide Issue 16 Date 2018-08-03 HUAWEI TECHNOLOGIES CO., LTD

1.5.1 Scaling Up Storage Space..........................................................................................................................................271.6 Network........................................................................................................................................................................ 291.6.1 Configuring and Changing a Private IP Address.......................................................................................................291.6.2 Binding and Unbinding an EIP..................................................................................................................................301.6.3 Changing the Database Port...................................................................................................................................... 321.7 Security.........................................................................................................................................................................331.7.1 Resetting the Administrator Password...................................................................................................................... 331.7.2 Changing a Security Group....................................................................................................................................... 351.7.3 Configuring a Whitelist............................................................................................................................................. 351.7.4 Performing a Server-Side Encryption........................................................................................................................361.8 Viewing Task Execution Progresses and Results......................................................................................................... 371.9 Cloud DBA................................................................................................................................................................... 381.9.1 System Resources...................................................................................................................................................... 381.9.2 Storage Space............................................................................................................................................................ 391.9.3 Slow SQL Analysis................................................................................................................................................... 411.9.4 Transaction Management...........................................................................................................................................421.9.5 Lock Management..................................................................................................................................................... 431.9.6 Intelligent Diagnosis..................................................................................................................................................441.10 Tags.............................................................................................................................................................................471.11 Account Management (Non-Administrator)...............................................................................................................491.11.1 Creating an Account................................................................................................................................................ 491.11.2 Resetting a Password............................................................................................................................................... 501.11.3 Changing Permissions..............................................................................................................................................511.11.4 Deleting an Account................................................................................................................................................ 511.12 Database Management................................................................................................................................................521.12.1 Creating a Database................................................................................................................................................. 521.12.2 Authorizing Permissions for Users..........................................................................................................................531.12.3 Deleting a Database................................................................................................................................................. 53

2 Monitoring DB Instances...........................................................................................................552.1 Monitoring DB Instances Using Cloud Eye................................................................................................................. 552.1.1 Supported Metrics......................................................................................................................................................552.1.2 Setting Alarm Rules...................................................................................................................................................572.1.3 Viewing Monitoring Metrics..................................................................................................................................... 572.2 Interconnecting with CTS.............................................................................................................................................582.2.1 Key Operations Supported by CTS........................................................................................................................... 582.2.2 Viewing Tracing Records.......................................................................................................................................... 602.3 Viewing Logs................................................................................................................................................................60

3 Working with RDS for MySQL................................................................................................ 613.1 Migrating MySQL Data Using DRS............................................................................................................................ 613.2 Migrating MySQL Data Using mysqldump................................................................................................................. 613.2.1 Preparing for Data Migration.................................................................................................................................... 613.2.2 Exporting Data...........................................................................................................................................................62

Relational Database ServiceUser Guide Contents

Issue 16 (2018-08-03) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

iii

Page 5: User Guide · Relational Database Service User Guide Issue 16 Date 2018-08-03 HUAWEI TECHNOLOGIES CO., LTD

3.2.3 Importing Data...........................................................................................................................................................633.3 Configuring Database Security.....................................................................................................................................643.4 Modifying Parameters in a Parameter Group............................................................................................................... 653.5 Restoring a MySQL DB Instance to a Point in Time................................................................................................... 673.6 Restoring a DB Instance from a Backup...................................................................................................................... 693.7 Viewing Monitoring Metrics........................................................................................................................................ 703.8 Viewing Logs................................................................................................................................................................723.8.1 Viewing and Downloading Error Logs......................................................................................................................723.8.2 Viewing and Downloading Slow Query Logs...........................................................................................................74

4 Working with RDS for PostgreSQL.........................................................................................774.1 Migrating PostgreSQL Data Using psql.......................................................................................................................774.1.1 Preparing for Data Migration.................................................................................................................................... 774.1.2 Exporting Data...........................................................................................................................................................774.1.3 Importing Data...........................................................................................................................................................784.2 Configuring Database Security.....................................................................................................................................794.3 Modifying Parameters in a Parameter Group............................................................................................................... 804.4 Restoring a PostgreSQL DB Instance to a Point in Time.............................................................................................824.5 Restoring a DB Instance from a Backup...................................................................................................................... 834.6 Viewing Monitoring Metrics........................................................................................................................................ 854.7 Viewing and Downloading Error Logs.........................................................................................................................854.8 Managing a Plugin........................................................................................................................................................864.9 Managing Tablespaces..................................................................................................................................................90

5 Working with RDS for SQL Server......................................................................................... 925.1 Migrating SQL Server Data Using DRS...................................................................................................................... 925.2 Migrating SQL Server Data Using SQL Server Management Studio..........................................................................925.2.1 Preparing for Data Migration.................................................................................................................................... 925.2.2 Exporting Data...........................................................................................................................................................935.2.3 Importing Data...........................................................................................................................................................945.3 Configuring Database Security.....................................................................................................................................955.4 Changing a User-Created Database Name................................................................................................................... 965.5 Modifying Parameters in a Parameter Group............................................................................................................... 975.6 Restoring a Microsoft SQL Server DB Instance to a Point in Time.............................................................................985.7 Restoring a DB Instance from a Backup.................................................................................................................... 1005.8 Viewing Monitoring Metrics...................................................................................................................................... 1025.9 Viewing and Downloading System Logs................................................................................................................... 104

6 Troubleshooting........................................................................................................................ 1066.1 Failed to Connect to MySQL DB Instances............................................................................................................... 1066.2 Failed to Change the Password of MySQL 5.7 by Modifying the user Table............................................................1076.3 Viewing RDS DB Instance Storage Space................................................................................................................. 1096.4 Viewing Slow Query Logs..........................................................................................................................................1096.5 The Replication Relationship Is Abnormal Between Primary and Standby RDS DB Instances................................111

Relational Database ServiceUser Guide Contents

Issue 16 (2018-08-03) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

iv

Page 6: User Guide · Relational Database Service User Guide Issue 16 Date 2018-08-03 HUAWEI TECHNOLOGIES CO., LTD

6.6 Failed to Connect to an RDS Microsoft SQL Server DB Instance.............................................................................1126.7 CPU Resource Exhaustion Caused by a Large Number of Concurrent Slow Queries...............................................112

A Change History ........................................................................................................................ 115

Relational Database ServiceUser Guide Contents

Issue 16 (2018-08-03) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

v

Page 7: User Guide · Relational Database Service User Guide Issue 16 Date 2018-08-03 HUAWEI TECHNOLOGIES CO., LTD

1 Managing DB Instances

This section provides guidance on how to manage you RDS DB instances, including changinginstance specifications, rebooting DB instances, managing parameter groups, backing up andrestoring data, and deleting DB instances.

You can view the statuses of DB instances or parameter groups in Statuses.

1.1 Getting StartedIf you use RDS for the first time, see the Relational Database Service Quick Start to help youunderstand RDS.

l Quick Start for MySQLl Quick Start for PostgreSQLl Quick Start for SQL Server

1.2 DB Instance OperationsDB instances are the smallest management units used by RDS. Each is an isolated databaseenvironment on the cloud. A DB instance can contain multiple databases created by users.You can use the same tool or program to access these databases. You can use the RDS consoleor APIs to create DB instances and manage them easily.

RDS supports the following DB engines:

l MySQL

l PostgreSQL

l Microsoft SQL Server

1.2.1 Changing a Pay-per-Use DB Instance to Yearly/Monthly

Scenarios

If you use RDS for a long time, you can change the billing mode of a DB instance from pay-per-use to yearly/monthly for a lower tariff.

Relational Database ServiceUser Guide 1 Managing DB Instances

Issue 16 (2018-08-03) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

1

Page 8: User Guide · Relational Database Service User Guide Issue 16 Date 2018-08-03 HUAWEI TECHNOLOGIES CO., LTD

Procedure

Step 1 Log in to the management console.

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

You can select a DCC to create a DB instance.

Step 3 Under Database, click Relational Database Service to go to the RDS console.

Step 4 On the Instance Management page, locate the target DB instance and click Change toYearly/Monthly in the Operation column.

Step 5 Select the renewal duration in the unit of month. The minimum duration is one month.l If you do not need to modify your settings, click Submit to go to the payment page.l If you are not sure about the settings, you can click Submit & Pay Later. The system

will reserve your order. You can choose Fees > My Orders in the upper right corner andpay or cancel the order.

Step 6 Select a payment method and click OK.

Step 7 After the DB instance billing mode is changed from pay-per-use to yearly/monthly, you canview and manage the instance on the Instance Management page.

In the upper right corner of the DB instance list, click to refresh the list. After the DBinstance billing mode is changed to yearly/monthly, the instance status will change toAvailable and the billing mode will change to Yearly/Monthly.

----End

1.2.2 Changing a DB Instance Type from Single to Primary/Standby

ScenariosYou can change a DB instance type from single to primary/standby to improve the instancereliability. The original instance resources are retained.

Procedure

Step 1 Log in to the management console.

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

You can select a DCC to create a DB instance.

Step 3 Under Database, click Relational Database Service to go to the RDS console.

Step 4 On the Instance Management page, locate the target DB instance and choose More >Change to Primary/Standby Instances in the Operation column.

Step 5 View the primary and standby DB instance information. By default, the primary DB instanceinformation is the same as that of the original single DB instance. For the standby DBinstance, you can select the AZ only. The other configurations cannot be modified and are the

Relational Database ServiceUser Guide 1 Managing DB Instances

Issue 16 (2018-08-03) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

2

Page 9: User Guide · Relational Database Service User Guide Issue 16 Date 2018-08-03 HUAWEI TECHNOLOGIES CO., LTD

same as those of the primary DB instance. For Microsoft SQL Server DB instances, you needto enter the original administrator password. Then, confirm the specifications and click Next.

For yearly/monthly DB instances, click Pay Now.

Step 6 After a single DB instance is changed to primary/standby instances, you can view and manageit on the Instance Management page.l The DB instance is in the Change to Primary/Standby Instances status. You can view

the progress on the Task Center page. For details, see section Viewing Task ExecutionProgresses and Results.

l In the upper right corner of the DB instance list, click to refresh the list. After theDB instance type is changed to primary/standby, the instance status will change toAvailable and the instance type will change to Primary/Standby.

----End

1.2.3 Manually Switching Between Primary and Standby DBInstances

Scenarios

If you choose to create primary/standby DB instances, RDS will create a primary DB instanceand a synchronous standby DB instance in the same region. You can access only the primaryDB instance. The standby instance serves as a backup. If the primary DB instance is faulty,the standby DB instance is promoted to the new primary instance and takes over services forfailover support.

Prerequisites1. A DB instance is running properly.2. The replication relationship between the primary and standby instances is normal.3. If you enable the operation protection function, second authentication is required when

you perform sensitive operations to improve the security of your account and cloudproduct. For details about how to enable operation protection, see the Identity and AccessManagement User Guide.

Procedure

Step 1 Log in to the management console.

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

You can select a DCC to create a DB instance.

Step 3 Under Database, click Relational Database Service to go to the RDS console.

Step 4 On the Instance Management page, locate the target primary/standby DB instance and clickthe DB instance name.

Step 5 On the Basic Information page, click Switch in the DB Instance Type field in the InstanceInformation area.

Relational Database ServiceUser Guide 1 Managing DB Instances

Issue 16 (2018-08-03) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

3

Page 10: User Guide · Relational Database Service User Guide Issue 16 Date 2018-08-03 HUAWEI TECHNOLOGIES CO., LTD

Step 6 If you have enabled operation security, click Start verification in the Switch Primary/Standby DB Instance dialog box. On the displayed page, click Send Code, enter theobtained verification code, and click Verify. The page is closed automatically.

Step 7 In the Switch Primary/Standby DB Instance dialog box, click OK to switch between theprimary and standby DB instances.

If the replication status is Available and the replication delay is greater than 300s, theprimary/standby switchover task cannot be delivered.

----End

1.2.4 Changing the CPU or Memory of a DB Instance

ScenariosYou can change the CPU or memory of a DB instance as required. If the status of a DBinstance changes from Changing instance class to Available, the change is successful.

For details about how to scale up storage space of a DB instance, see section Scaling UpStorage Space.

NOTE

You can change the CPU and memory of a DB instance only when your account balance is more than¥0.

A DB instance cannot be deleted while its CPU or memory is being changed.

Procedure

Step 1 Log in to the management console.

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

You can select a DCC to create a DB instance.

Step 3 Under Database, click Relational Database Service to go to the RDS console.

Step 4 On the Instance Management page, locate the target DB instance and click Scale in theOperation column. You can also click the target DB instance name to go to the BasicInformation page. In the Configuration area, click Change in the Instance Class field.

Step 5 On the displayed page, click CPU/Memory, specify the desired CPU and memory, and clickNext.

Relational Database ServiceUser Guide 1 Managing DB Instances

Issue 16 (2018-08-03) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

4

Page 11: User Guide · Relational Database Service User Guide Issue 16 Date 2018-08-03 HUAWEI TECHNOLOGIES CO., LTD

Figure 1-1 Changing a DB instance class

You can change the CPU or memory of a DB instance as required.

Currently, you can only select a different CPU/memory for the same instance class. Forexample, if the current instance class is general-purpose, you can only select another CPU/memory option for this instance class.

DB instances in a DCC only support the general-purpose instance class.

Step 6 Confirm your specifications.l If you need to modify your settings, click Previous.l For pay-per-use DB instances, click Submit.

To view the cost incurred by the CPU or memory change, choose Fees > My Orders inthe upper right corner.

l For yearly/monthly DB instances:– If you scale down the CPU or memory, click Submit.

The refund is automatically returned to your account. You can choose Fees > MyOrders in the upper right corner to check the refund.

– If you scale up the CPU or memory, click Pay Now. The scaling starts only afterthe payment is successful.

Step 7 View the DB instance CPU or memory modification result.

Changing the CPU or memory takes 5-15 minutes. During this time, the status of the DBinstance on the Instance Management page will be Changing instance class. To verify thatthe change has succeeded, click the DB instance and view the instance class on the displayedBasic Information page.

Relational Database ServiceUser Guide 1 Managing DB Instances

Issue 16 (2018-08-03) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

5

Page 12: User Guide · Relational Database Service User Guide Issue 16 Date 2018-08-03 HUAWEI TECHNOLOGIES CO., LTD

NOTICEl After you change the CPU or memory of a MySQL instance, the values of the following

parameters will also be changed accordingly: back_log (only for MySQL 5.7),innodb_buffer_pool_size, innodb_log_buffer_size, innodb_log_files_in_group,max_connections, innodb_page_cleaners, innodb_buffer_pool_instances,threadpool_size, and slave_parallel_workers.

l After you change the CPU or memory of a PostgreSQL instance, the values of thefollowing parameters will also be changed: shared_buffers, max_connections,maintenance_work_mem, and effective_cache_size.

l After you change the CPU or memory of an RDS SQL Server DB instance, the value ofmax server memory will also be changed accordingly. You are advised to set it to a sizeequal to the memory size minus 520 MB. For example, if there is 1 GB of memory, youare advised to set max server memory to 504 MB.

----End

1.2.5 Renewing DB Instances

Scenarios

This section describes how to renew your yearly/monthly DB instances.

NOTE

The pay-per-use DB instances do not support this function.

Procedure

Step 1 Log in to the management console.

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

You can select a DCC to create a DB instance.

Step 3 Under Database, click Relational Database Service to go to the RDS console.

Step 4 On the Instance Management page, locate the target DB instance and click Renew.

Step 5 Renew the DB instance.

----End

1.2.6 Rebooting a DB Instance

Scenarios

You may need to reboot a DB instance for maintenance purposes. For example, if the status ofa DB instance is Abnormal, you can try rebooting it to restore its status to Available. Aftermodifying some parameters, you must reboot the DB instance for the modifications to takeeffect. You can reboot a primary DB instance or a read replica on the management console.

Relational Database ServiceUser Guide 1 Managing DB Instances

Issue 16 (2018-08-03) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

6

Page 13: User Guide · Relational Database Service User Guide Issue 16 Date 2018-08-03 HUAWEI TECHNOLOGIES CO., LTD

For primary/standby DB instances, rebooting the primary DB instance will automaticallycause the standby DB instance to also be rebooted.

You can reboot a DB instance only when its status is Available.

The time required for rebooting a DB instance depends on the crash recovery process of theDB engine. To shorten the reboot time, you are advised to reduce database activities duringthe reboot to reduce rollback activities of transit transactions.

NOTICERebooting DB instances will reboot database services. Rebooting a DB instance will causeservice interruption. During this period, the DB instance status is Rebooting.

BackgroundIf you enable the operation protection function, second authentication is required when youperform sensitive operations to improve the security of your account and cloud product. Fordetails about how to enable operation protection, see the Identity and Access ManagementUser Guide.

Procedure

Step 1 Log in to the management console.

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

You can select a DCC to create a DB instance.

Step 3 Under Database, click Relational Database Service to go to the RDS console.

Step 4 On the Instance Management page, locate the target DB instance, or click and then locatethe target read replica. Choose More > Reboot in the Operation column.

For primary/standby DB instances, if you reboot the primary DB instance, the standby DBinstance is also rebooted automatically.

Step 5 If you have enabled the operation protection function, click Start Verification in the RebootDB Instance dialog box. On the displayed page, click Send Code, enter the obtainedverification code, and click Verify. The page is closed automatically.

Step 6 In the displayed Reboot DB Instance dialog box, click OK to restart the instance.

Step 7 Refresh the DB instance list and view the status of the DB instance. If its status is Available,it has rebooted successfully.

----End

1.2.7 Exporting a DB Instance List

ScenariosThis section describes how to export a DB instance list and analyze instance information.

Relational Database ServiceUser Guide 1 Managing DB Instances

Issue 16 (2018-08-03) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

7

Page 14: User Guide · Relational Database Service User Guide Issue 16 Date 2018-08-03 HUAWEI TECHNOLOGIES CO., LTD

Procedure

Step 1 Log in to the management console.

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

You can select a DCC to create a DB instance.

Step 3 Under Database, click Relational Database Service to go to the RDS console.

Step 4 On the Instance Management page, click . In the displayed dialog box, click OK.

Step 5 View export details.

----End

1.2.8 Modifying the Switchover Policy

ScenariosYou can modify the switchover policy with a priority on availability or reliability to meetservice requirements.

Procedure

Step 1 Log in to the management console.

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

You can select a DCC to create a DB instance.

Step 3 Under Database, click Relational Database Service to go to the RDS console.

Step 4 On the Instance Management page, locate the target primary/standby DB instance and clickthe DB instance name.

Step 5 On the displayed Basic Information page, click Modify in the Switchover Priority field. Inthe displayed dialog box, select a priority and click OK.l Reliability first: This option is selected by default. Data consistency is preferentially

ensured during the primary/standby switchover. This is recommended for users whosehighest priority is data consistency.

l Availability first: Database availability is preferentially ensured during the primary/standby switchover. This is recommended for users who require their databases toprovide uninterrupted online services.

Step 6 View the result of the change on the Basic Information page.

----End

1.2.9 Changing a DB Instance Name

ScenariosThis section describes how to change the name of a primary DB instance or read replica.

Relational Database ServiceUser Guide 1 Managing DB Instances

Issue 16 (2018-08-03) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

8

Page 15: User Guide · Relational Database Service User Guide Issue 16 Date 2018-08-03 HUAWEI TECHNOLOGIES CO., LTD

Procedure

Step 1 Log in to the management console.

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

You can select a DCC to create a DB instance.

Step 3 Under Database, click Relational Database Service to go to the RDS console.

Step 4 On the Instance Management page, click the target DB instance or click and then thetarget read replica.

Step 5 On the displayed Basic Information page, click in the DB Instance Name field.

The DB instance name must start with a letter and consist of 4 to 64 characters. It is case-sensitive and can contain only letters, digits, hyphens (-), and underscores (_).

l To submit the change, click .

l To cancel the change, click .

Step 6 View the result of the change on the Basic Information page.

----End

1.2.10 Selecting Displayed Items

ScenariosYou can customize instance information items displayed on the Instance Management pagebased on your requirements.

Procedure

On the Instance Management page, click .

Figure 1-2 Selecting Displayed Items

l The following items are displayed by default: DB instance name/ID, DB instance type,DB engine version, status, billing mode, private IP address, and operation.These default displayed items cannot be customized.

Relational Database ServiceUser Guide 1 Managing DB Instances

Issue 16 (2018-08-03) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

9

Page 16: User Guide · Relational Database Service User Guide Issue 16 Date 2018-08-03 HUAWEI TECHNOLOGIES CO., LTD

l In a single project, you can select a maximum of 10 items: DB instance name/ID, DBinstance type, DB engine version, status, billing mode, private IP address, creation time,database port, storage type, and operation.

l In multiple projects, if you have enabled the ProjectMan permissions, you can select amaximum of 11 items: DB instance name/ID, DB instance type, DB engine version,status, billing mode, private IP address, creation time, database port, storage type,operation, and project.

1.2.11 Deleting a DB Instance

ScenariosYou can manually delete the following DB instances that are not in use to release resources:

l Primary DB instancesl Read replicas (RDS for SQL Server does not support read replicas.)

Restrictions:

l Yearly/Monthly DB instances cannot be deleted.l DB instances in the creating status cannot be deleted.

NOTICEl If you delete a primary DB instance, its read replicas are also deleted automatically.

Exercise caution when performing this operation.l Deleted DB instances cannot be recovered. Exercise caution when performing this

operation.

If you delete a DB instance, its automated backups are also deleted and you are no longercharged for them. Manual backups are still retained and will incur additional costs.

BackgroundIf you enable the operation protection function, second authentication is required when youperform sensitive operations to improve the security of your account and cloud product. Fordetails about how to enable operation protection, see the Identity and Access ManagementUser Guide.

Procedure

Step 1 Log in to the management console.

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

You can select a DCC to create a DB instance.

Step 3 Under Database, click Relational Database Service to go to the RDS console.

Step 4 On the Instance Management page, locate the target DB instance or read replica, and chooseMore > Delete in the Operation column.

Relational Database ServiceUser Guide 1 Managing DB Instances

Issue 16 (2018-08-03) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

10

Page 17: User Guide · Relational Database Service User Guide Issue 16 Date 2018-08-03 HUAWEI TECHNOLOGIES CO., LTD

Step 5 If you have enabled the operation protection function, click Start Verification in the DeleteDB Instance dialog box. On the displayed page, click Send Code, enter the obtainedverification code, and click Verify. The page is closed automatically.

Step 6 In the displayed Delete DB Instance dialog box, click OK. Refresh the InstanceManagement page later to verify that the DB instance or read replica has been deleted.

----End

1.2.12 Buying a Same DB Instance

ScenariosThis section describes how to buy a DB instance with the same specifications as the selectedone.

NOTE

l You can buy DB instances with the same specifications an unlimited number of times.l This function is unavailable for DB instances and read replicas in the Frozen state.

Procedure

Step 1 Log in to the management console.

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

You can select a DCC to create a DB instance.

Step 3 Under Database, click Relational Database Service to go to the RDS console.

Step 4 On the Instance Management page, locate the target DB instance and choose More > BuySame DB Instance in the Operation column.

Step 5 On the displayed page, the specifications are the same as those of the selected DB instance.You can change them as required. Then, click Next.

For details about how to buy a MySQL DB instance, see Buying an RDS MySQL DBInstance.

For details about how to buy a PostgreSQL DB instance, see Buying an RDS PostgreSQLDB Instance.

For details about how to buy a Microsoft SQL Server DB instance, see Buying an RDSMicrosoft SQL Server DB Instance.

Step 6 Confirm the order.l For pay-per-use DB instances, click Submit.l For yearly/month DB instances, click Pay Now. If you are not sure about the settings,

you can click Submit & Pay Later. The system will reserve your order. You can chooseFees > My Orders in the upper right corner and pay or cancel the order.

Step 7 Refresh the DB instance list and view the status of the DB instance. If the status is Available,it has been created successfully.

You can manage the DB instance on the Instance Management page.

----End

Relational Database ServiceUser Guide 1 Managing DB Instances

Issue 16 (2018-08-03) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

11

Page 18: User Guide · Relational Database Service User Guide Issue 16 Date 2018-08-03 HUAWEI TECHNOLOGIES CO., LTD

1.3 Backup and RestoreRDS supports DB instance backup and restore to ensure data reliability.

Functions

Although RDS supports high availability, if a database or table is maliciously or mistakenlydeleted, data on the standby DB instance is also deleted and cannot be restored. In this case,backups can be used to restore DB instances after data is deleted.

Automated Backups

Backups are automatically created during the backup period of your DB instances. RDS savesautomated backups based on the retention period you specified. If necessary, you can restoreto any point in time during your backup retention period.

Manual Backups

You can also create manual backups. RDS saves manual backups of the DB instance based onthe backup retention period you specified. If necessary, you can restore to any point in timeduring your backup retention period.

1.3.1 Managing an Automated Backup Policy

Scenarios

The automated backup policy is enabled by default. After a DB instance is created, you canmodify the automated backup policy as needed. RDS backs up data based on the automatedbackup policy you have set.

RDS automatically backs up data at the DB instance level. If a database is faulty or data isdamaged, you can restore it from backups to ensure data reliability. Backups are saved aspackages in OBS buckets to ensure data confidentiality and durability. Since backing up dataaffects the database read and write performance, you are advised to enable automated backupsduring off-peak hours.

The default automated backup policy is as follows:l Retention period: 7 daysl Time window: An hour within 24 hours, such as 01:00-02:00 or 12:00-13:00l Backup cycle: Each day of the week

Enabling or Modifying an Automated Backup Policy

Step 1 Log in to the management console.

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

You can select a DCC to create a DB instance.

Step 3 Under Database, click Relational Database Service to go to the RDS console.

Relational Database ServiceUser Guide 1 Managing DB Instances

Issue 16 (2018-08-03) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

12

Page 19: User Guide · Relational Database Service User Guide Issue 16 Date 2018-08-03 HUAWEI TECHNOLOGIES CO., LTD

Step 4 On the Instance Management page, click the target DB instance name.

Step 5 On the Backup & Restore page, click Modify Backup Policy. If you want to enable the

automated backup policy, click . Modify the automated backup policy, as shown inFigure 1-3.

Figure 1-3 Enabling the automated backup policy

Retention Period refers to the number of days that your automated backups can be retained.Lengthening the retention period will improve data reliability.

If you shorten the retention period, the new backup policy takes effect for all backup files.The backup files that have expired will be deleted.

The backup retention period can range from 1 day to 732 days, and the time window is onehour. By default, each day of the week is selected for Backup Cycle. You can change thebackup cycle. A minimum of one day must be selected.

If the automated backup policy is enabled, a full automated backup is triggered instantly.

Step 6 Click OK.

----End

Relational Database ServiceUser Guide 1 Managing DB Instances

Issue 16 (2018-08-03) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

13

Page 20: User Guide · Relational Database Service User Guide Issue 16 Date 2018-08-03 HUAWEI TECHNOLOGIES CO., LTD

Disabling the Automated Backup Policy

NOTICEl If the automated backup policy is disabled, automated backups will not be created and

point-in-time recovery will not be available. After the automated backup is enabled, thetime point will be set to the moment when you enabled the automated backup.

l Deleting automated backups created during a specific time period may cause ongoing datarestoration to fail. Deleted backups cannot be recovered. Exercise caution when deletingautomated backups.

Step 1 On the Instance Management page, click the target DB instance name.

Step 2 On the Backup & Restore page, click Modify Backup Policy. On the displayed page, click

to disable the automated backup policy. Disable the automated backup policy, asshown in Figure 1-4.

Figure 1-4 Disabling the automated backup policy

For primary/standby Microsoft SQL Server DB instances, the automated backup policycannot be disabled.

You can determine whether to delete automated backups created in a specific period.l If you do not select Delete automated backups created in the following period, all

backups within the retention period will be retained.l If you select Delete automated backups created in the following period, all backup

files within the retention period will be deleted.

Relational Database ServiceUser Guide 1 Managing DB Instances

Issue 16 (2018-08-03) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

14

Page 21: User Guide · Relational Database Service User Guide Issue 16 Date 2018-08-03 HUAWEI TECHNOLOGIES CO., LTD

Step 3 Click OK.

----End

1.3.2 Creating a Manual Backup

ScenariosRDS allows you to create manual backups of a running primary DB instance. You can usethese backups to restore data.

NOTE

When you delete a DB instance, its automated backups are also deleted but its manual backups areretained.You can create manual backups only when your account balance is more than ¥0.

Method 1

Step 1 Log in to the management console.

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

You can select a DCC to create a DB instance.

Step 3 Under Database, click Relational Database Service to go to the RDS console.

Step 4 On the Instance Management page, locate the target DB instance and choose More >Create Backup in the Operation column.

Step 5 In the displayed dialog box, enter a backup name and description. For Microsoft SQL Server,select a target database for which to create a backup. Then, click OK.l The backup name must consist of 4 to 64 characters and start with a letter. It is case-

insensitive and can contain only letters, digits, hyphens (-), and underscores (_).l The description must consist of a maximum of 256 characters and cannot contain the

carriage return character or the following special characters: >!<"&'=l The time required for creating manual backups depends on the data volume.

To check whether the backup has been created, you can click in the upper right corner ofthe page to check the DB instance status. If the DB instance status is Available, the backuphas been created. You can manage the backup following the instructions in Step 6.

Step 6 After a manual backup has been created, you can view and manage it on the InstanceManagement page.

You can also click the target DB instance and manage its backup on the Backup & Restorepage.

----End

Method 2

Step 1 Log in to the management console.

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

Relational Database ServiceUser Guide 1 Managing DB Instances

Issue 16 (2018-08-03) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

15

Page 22: User Guide · Relational Database Service User Guide Issue 16 Date 2018-08-03 HUAWEI TECHNOLOGIES CO., LTD

You can select a DCC to create a DB instance.

Step 3 Under Database, click Relational Database Service to go to the RDS console.

Step 4 On the Instance Management page, click the target DB instance name.

Step 5 On the Backup & Restore page, click Create Backup. In the displayed dialog box, select thedatabase to be backed up for Microsoft SQL Server, specify Backup Name and Description,and click OK.

l The backup name must consist of 4 to 64 characters and start with a letter. It is case-insensitive and can contain only letters, digits, hyphens (-), and underscores (_).

l The description must consist of a maximum of 256 characters and cannot contain thecarriage return character or the following special characters: >!<"&'=

l The time required for creating manual backups depends on the data volume.

Step 6 After a manual backup has been created, you can view and manage it on the InstanceManagement page.

You can also click the target DB instance and manage its backup on the Backup & Restorepage.

----End

Method 3

Step 1 Log in to the management console.

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

You can select a DCC to create a DB instance.

Step 3 Under Database, click Relational Database Service to go to the RDS console.

Step 4 On the Backup Management page, click Create Backup.

Step 5 In the displayed dialog box, select a primary DB instance, select the database to be backed upfor Microsoft SQL Server, specify Backup Name and Description, and click OK.

l A backup can only be created for an available primary DB instance. You cannot create abackup for a DB instance that is being backed up or for which a backup is already beingcreated.

l The backup name must consist of 4 to 64 characters and start with a letter. It is case-insensitive and can contain only letters, digits, hyphens (-), and underscores (_).

l The description must consist of a maximum of 256 characters and cannot contain thecarriage return character or the following special characters: >!<"&'=

l The time required for creating manual backups depends on the data volume.

Step 6 After a manual backup has been created, you can view and manage it on the InstanceManagement page.

You can also click the target DB instance and manage its backup on the Backup & Restorepage.

----End

Relational Database ServiceUser Guide 1 Managing DB Instances

Issue 16 (2018-08-03) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

16

Page 23: User Guide · Relational Database Service User Guide Issue 16 Date 2018-08-03 HUAWEI TECHNOLOGIES CO., LTD

1.3.3 Restoring a DB Instance to a Point in TimeRDS can use backup data to create a new DB instance or restore to the original DB instance.

If you restore backup data to a new DB instance:

l The DB engine, version, and port number of the database are the same as those of theoriginal DB instance and cannot be changed.

l You need to set a new administrator password.

For details on restoring a MySQL DB instance to a point in time, see section Restoring aMySQL DB Instance to a Point in Time.

For details on restoring a PostgreSQL DB instance to a point in time, see section Restoring aPostgreSQL DB Instance to a Point in Time.

For details on restoring a Microsoft SQL Server DB instance to a point in time, see sectionRestoring a Microsoft SQL Server DB Instance to a Point in Time.

1.3.4 Restoring a DB Instance from a BackupFor details on restoring a MySQL DB instance, see section Restoring a DB Instance from aBackup.

For details on restoring a PostgreSQL DB instance, see section Restoring a DB Instancefrom a Backup.

For details on restoring a Microsoft SQL Server DB instance, see section Restoring a DBInstance from a Backup.

1.3.5 Downloading a Backup File and Restoring Data from It

Scenarios

This section describes how to download a manual and an automated backup file to a localdevice and restore data from the backup file.

Downloading a Backup File

Step 1 Log in to the management console.

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

You can select a DCC to create a DB instance.

Step 3 Under Database, click Relational Database Service to go to the RDS console.

Step 4 On the Backup Management page, locate the manual backup to be downloaded and chooseMore > Download or locate an automated backup and click Download.

Step 5 Download OBS Browser and install it.

Step 6 Log in to OBS Browser.

Relational Database ServiceUser Guide 1 Managing DB Instances

Issue 16 (2018-08-03) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

17

Page 24: User Guide · Relational Database Service User Guide Issue 16 Date 2018-08-03 HUAWEI TECHNOLOGIES CO., LTD

For details about how to log in to OBS Browser, see section Logging In to OBS Browser inthe Object Storage Service User Guide.

Step 7 Add an external bucket.

In the Create Bucket dialog box of OBS Browser, select Add external bucket and enter thebucket name displayed on Download Backup File of the RDS console.

For details about how to add external buckets, see section Adding External Buckets in theClient Guide (OBS Browser).

Step 8 Download the backup file.

In the search box on the right of OBS Browser, enter the backup file name displayed onDownload Backup File of the RDS console. For SQL Server databases, you can downloadbackup files of a single database.

----End

Restoring Data from a Backup FileNOTE

The following uses MySQL as an example to describe how to restore data from a backup file on theECS.Before restoring data, make sure that:

l The ECS operating system is CentOS 7.4 64bit.

l MySQL 5.6 has been installed.

Step 1 Download the qpress program and upload it to the ECS for installation.

Download qpress-11-linux.x64.tar from the website and upload it to the ECS.

tar -xvf qpress-11-linux-x64.tar

mv qpress /usr/bin/

Step 2 Download the XtraBackup software and upload it to the ECS for installation.

Download percona-xtrabackup-24-2.4.9-1.el7.x86_64.rpm from the website and upload itto the ECS.

rpm -ivh percona-xtrabackup-24-2.4.9-1.el7.x86_64.rpm

Step 3 On the ECS, decompress the full backup file that has been downloaded.

1. Create a temporary directory backupdir.mkdir backupdir

2. Decompress the package.xbstream -x < ./full backup file.qp -C ./backupdir/innobackupex --decompress ./backupdirfind ./backupdir/ -name '*.qp' | xargs rm -f

Step 4 Apply the log.

innobackupex --ibbackup=xtrabackup_56 --apply-log ./backupdir

Step 5 Stop the MySQL database service and back up the original data directory. Create a new datadirectory and change the permissions.

Relational Database ServiceUser Guide 1 Managing DB Instances

Issue 16 (2018-08-03) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

18

Page 25: User Guide · Relational Database Service User Guide Issue 16 Date 2018-08-03 HUAWEI TECHNOLOGIES CO., LTD

service mysql stop

mv /var/lib/mysql/data /var/lib/mysql/data_bak

mkdir /var/lib/mysql/data

chown mysql:mysql /var/lib/mysql/data

/var/lib/mysql/data: indicates the user's MySQL database directory.

Step 6 Copy the full backup file and change the directory permissions.

innobackupex --defaults-file=/etc/my.cnf --copy-back ./backupdir

chown -R mysql:mysql /var/lib/mysql/data

Step 7 Start the database.

service mysql start

----End

1.3.6 Replicating a Backup

Scenarios

This section describes how to replicate a manual or an automated backup. The new backupmust have a different name from that of the original backup.

Restrictions:

You can replicate backups and use them only in the same region.

Backup retention period:

RDS will delete automated backups when they expire or the DB instance for which thebackups are created is deleted. If you want to retain the automated backups for a long time,you can replicate them to create manual backups, which will be always retained unless youdelete them. If storage space used for manual backups exceeds the default storage space,additional RDS storage costs may incur.

You can replicate backups only when your account balance is more than ¥0.

Procedure

Step 1 Log in to the management console.

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

You can select a DCC to create a DB instance.

Step 3 Under Database, click Relational Database Service to go to the RDS console.

Step 4 On the Backup Management page, locate the manual backup to be replicated and chooseMore > Replicate or locate an automated backup and click Replicate in the Operationcolumn.

Step 5 In the displayed dialog box, enter a new backup name and description and click OK.

Relational Database ServiceUser Guide 1 Managing DB Instances

Issue 16 (2018-08-03) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

19

Page 26: User Guide · Relational Database Service User Guide Issue 16 Date 2018-08-03 HUAWEI TECHNOLOGIES CO., LTD

l The backup name must consist of 4 to 64 characters and start with a letter. It is case-insensitive and can contain only letters, digits, hyphens (-), and underscores (_).

l The description must consist of a maximum of 256 characters and cannot contain thefollowing special characters: >!<"&'=

Step 6 After the new backup has been created, you can view and manage it on the BackupManagement page.

----End

1.3.7 Deleting a Manual Backup

Scenarios

This section describes how to delete manual backups to release storage space.

NOTICEDeleted manual backups cannot be recovered. Exercise caution when performing thisoperation.

Procedure

Step 1 Log in to the management console.

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

You can select a DCC to create a DB instance.

Step 3 Under Database, click Relational Database Service to go to the RDS console.

Step 4 On the Backup Management page, locate the manual backup to be deleted and click Deletein the Operation column.

The following backups cannot be deleted:

l Automated backups

l Backups that are being restored

l Backups that are being replicated

Step 5 Click OK.

----End

1.4 Parameter Groups

Relational Database ServiceUser Guide 1 Managing DB Instances

Issue 16 (2018-08-03) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

20

Page 27: User Guide · Relational Database Service User Guide Issue 16 Date 2018-08-03 HUAWEI TECHNOLOGIES CO., LTD

1.4.1 Creating a Parameter GroupYou can use database parameter groups to manage the configuration of a DB engine. Adatabase parameter group acts as a container for engine configuration values that can beapplied to one or more DB instances.

If you create a DB instance without specifying a user-created DB parameter group, a defaultparameter group is used. This default group contains DB engine defaults and RDS systemdefaults based on the engine, compute class, and allocated storage of the instance. You cannotmodify the parameter settings of a default parameter group. You must create your ownparameter group to change parameter settings from their default value.

NOTICENote that not all DB engine parameters can be changed in a user-created parameter group.

If you want to use your own parameter group, you simply create a new parameter group andselect it when you create a DB instance or associated it with an existing DB instancefollowing the instructions provided in section Associating a Parameter Group with DBInstances.

When you have already created a parameter group and want to include most of the customparameters and values from that group in a new parameter group, you can replicate thatparameter group following the instructions provided in section Replicating a ParameterGroup.

The following are the key points you should know when using parameters in a parametergroup:

l When you change parameter values in a parameter group and save the changes, thechanges apply only to the associated DB instances and do not affect the other DBinstances. When you change a dynamic parameter and save the changes, the changesapply immediately regardless of the Effective Upon Reboot setting. When you change astatic parameter and save the change, the change will take effect only after you manuallyreboot the associated DB instances.

l When you change parameter values in parameter groups in batches and save the changes,the changes will take effect only after you associate the parameter groups with DBinstances. When you change a static parameter and save the change, the change will takeeffect only after you associate the parameter group with DB instances and manuallyreboot the associated DB instances.

l Improperly setting parameters in a parameter group may have unintended adverseeffects, including degraded performance and system instability. Exercise caution whenmodifying database parameters and back up data before modifying a parameter group.Before applying parameter group changes to a production DB instance, you should tryout these changes on a test DB instance.

Scenarios

DB parameter groups act as a container for engine configuration values that are applied to oneor more DB instances. You can create parameter groups on the RDS console.

Relational Database ServiceUser Guide 1 Managing DB Instances

Issue 16 (2018-08-03) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

21

Page 28: User Guide · Relational Database Service User Guide Issue 16 Date 2018-08-03 HUAWEI TECHNOLOGIES CO., LTD

NOTE

By default, each user can create a maximum of 100 parameter groups. All DB engines share thisparameter group quota.

Procedure

Step 1 Log in to the management console.

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

You can select a DCC to create a DB instance.

Step 3 Under Database, click Relational Database Service to go to the RDS console.

Step 4 On the Parameter Group Management page, click Create Parameter Group.

Step 5 Specify DB engine version, Parameter Group Name, and Description. Then, click OK.l The DB engine version indicates the engine version of the DB instance with which this

parameter group is to be associated. For example, if you want to associate this parametergroup with a MySQL 5.6 DB instance, select MySQL 5.6.

l The group name must consist of 1 to 64 characters. It can contain only uppercase letters,lowercase letters, digits, hyphens (-), underscores (_), and periods (.).

l The description must consist of a maximum of 256 characters and cannot contain thecarriage return character or the following special characters: >!<"&'=

----End

1.4.2 Modifying Parameters in a Parameter GroupYou can modify parameters in parameter groups you have created.

You can change parameter values in customer-created parameter groups only and cannotchange parameter values in default parameter groups.

The following are the key points you should know when using parameters in a parametergroup:

l When you change a dynamic parameter on the Parameters page and save the changes,the changes apply immediately regardless of the Effective Upon Reboot setting. Whenyou change a static parameter and save the change, the change will take effect only afteryou manually reboot the associated DB instances.

l When you change parameter values in parameter groups in batches on the ParameterGroup Management page and save the changes, the changes will take effect only afteryou associate the parameter groups with DB instances. When you change a staticparameter and save the change, the change will take effect only after you associate theparameter group with DB instances and manually reboot the associated DB instances.For details, see section Associating a Parameter Group with DB Instances.

If you change a parameter value, when the change applies is determined by the type ofparameter.

The RDS console displays the status of the parameter group associated with DB instances.For example, if the DB instance does not use the latest changes made to the parameter groupassociated with it, the RDS console displays the parameter group with a status of Pending

Relational Database ServiceUser Guide 1 Managing DB Instances

Issue 16 (2018-08-03) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

22

Page 29: User Guide · Relational Database Service User Guide Issue 16 Date 2018-08-03 HUAWEI TECHNOLOGIES CO., LTD

reboot. You need to manually reboot the DB instance for the latest parameter changes to takeeffect for that DB instance.

NOTE

RDS has default parameter groups whose parameter values cannot be changed. You can view theseparameter values by clicking the default parameter group names. If a user-created parameter group is setincorrectly and causes a database reboot to fail, you can use a default parameter group to reset thedatabase.

For details on modifying parameters in a MySQL parameter group, see section ModifyingParameters in a Parameter Group.

For details on modifying parameters in a PostgreSQL parameter group, see sectionModifying Parameters in a Parameter Group.

For details on modifying parameters in a Microsoft SQL Server parameter group, see sectionModifying Parameters in a Parameter Group.

1.4.3 Comparing Parameter Groups

Scenarios

You can compare two parameter groups that use the same DB engine.

Procedure

Step 1 Log in to the management console.

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

You can select a DCC to create a DB instance.

Step 3 Under Database, click Relational Database Service to go to the RDS console.

Step 4 Choose Parameter Group Management in the navigation pane on the left. On the User-Created page, locate a parameter group and click Compare in the Operation column.Alternatively, you can click the target DB instance name in the DB instance list on theInstance Management page. On the Parameters page, click Compare.

Step 5 In the displayed dialog box, select a parameter group that uses the same DB engine as the firstparameter group and click OK.

If the parameter groups have different settings, the names and values of both groups'parameters are displayed. If their settings are the same, no data is displayed.

----End

1.4.4 Replicating a Parameter Group

Scenarios

You can replicate a parameter group you have created. When you have already created aparameter group and want to include most of the custom parameters and values from thatgroup in a new parameter group, you can replicate that parameter group. You can also exportthe parameter group to generate a parameter group for future use.

Relational Database ServiceUser Guide 1 Managing DB Instances

Issue 16 (2018-08-03) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

23

Page 30: User Guide · Relational Database Service User Guide Issue 16 Date 2018-08-03 HUAWEI TECHNOLOGIES CO., LTD

After replicating a parameter group, you should wait at least 5 minutes before creating yourfirst DB instance that uses the parameter group as the default parameter group.

You cannot replicate default parameter groups but you can create new parameter groups basedon the default parameter groups.

Procedure

Step 1 Log in to the management console.

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

You can select a DCC to create a DB instance.

Step 3 Under Database, click Relational Database Service to go to the RDS console.

Step 4 Choose Parameter Group Management in the navigation pane on the left. On the User-Created page, locate the parameter group to be replicated and click Replicate in theOperation column. You can also click the target DB instance name in the DB instance list.On the Parameters page, click Export to generate a new parameter group for future use.

Step 5 In the displayed dialog box, specify New Parameter Group and Description, and click OK.

l The group name must consist of 1 to 64 characters. It can contain only uppercase letters,lowercase letters, digits, hyphens (-), underscores (_), and periods (.).

l The description must consist of a maximum of 256 characters and cannot contain thecarriage return character or the following special characters: >!<"&'=

After the new parameter group is created, you can manage it in the parameter group list.

----End

1.4.5 Resetting a Parameter Group

Scenarios

You can reset all of the parameters in a user-created parameter group to their default settings.

Procedure

Step 1 Log in to the management console.

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

You can select a DCC to create a DB instance.

Step 3 Under Database, click Relational Database Service to go to the RDS console.

Step 4 Choose Parameter Group Management in the navigation pane on the left. On the User-Created page, locate the parameter group to be reset and choose More > Reset in theOperation column.

Step 5 Click OK.

Relational Database ServiceUser Guide 1 Managing DB Instances

Issue 16 (2018-08-03) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

24

Page 31: User Guide · Relational Database Service User Guide Issue 16 Date 2018-08-03 HUAWEI TECHNOLOGIES CO., LTD

NOTE

For details about the parameter group statuses, see Statuses.

After you reset the parameter group, view the status of the associated DB instance in the DB instancelist. If the status is Pending reboot, you must reboot the DB instance for the reset to take effect.

Rebooting is always required after resetting parameter groups under the following circumstances:

l The DB instance type is primary/standby. In this case, the standby DB instance will also be changedaccordingly after the reboot.

l The reset parameter group is associated with a read replica.

----End

1.4.6 Associating a Parameter Group with DB Instances

Scenarios

Changes to parameters in a user-created parameter group will not apply to DB instances untilyou associate this parameter group with target DB instances.

Procedure

Step 1 Log in to the management console.

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

You can select a DCC to create a DB instance.

Step 3 Under Database, click Relational Database Service to go to the RDS console.

Step 4 On the Parameter Group Management page, if you want to associate default parametergroups with DB instances, click Default, locate the target parameter group, and choose More> Associate in the Operation column. If you want to associate user-created parameter groupswith DB instances, click User-Created, locate the target parameter group, and choose More >Associate in the Operation column.

A parameter group can be associated with one or more DB instances.

Step 5 In the displayed dialog box, select or enter one or more DB instances with which theparameter group will be associated and click OK

NOTE

For details about the parameter group statuses, see Statuses.

After you reset the parameter group, you need to view the status of the associated DB instance in the DBinstance list. If the status is Pending reboot, you must reboot the DB instance for the reset to take effect.

l If you have modified certain parameters of primary/standby DB instances, these modifications willbe synchronized to the standby DB instance. You must reboot the primary/standby DB instance forthe modifications to take effect.

l If you have modified certain parameters of a read replica, you must reboot the read replica for themodifications to take effect.

----End

Relational Database ServiceUser Guide 1 Managing DB Instances

Issue 16 (2018-08-03) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

25

Page 32: User Guide · Relational Database Service User Guide Issue 16 Date 2018-08-03 HUAWEI TECHNOLOGIES CO., LTD

1.4.7 Changing a Parameter Group Description

Scenarios

You can change the description of a parameter group you have created.

NOTE

You cannot change the description of a default parameter group.

Procedure

Step 1 Log in to the management console.

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

You can select a DCC to create a DB instance.

Step 3 Under Database, click Relational Database Service to go to the RDS console.

Step 4 Choose Parameter Group Management in the navigation pane on the left. On the User-

Created page, locate the target parameter group and click in the Description column.

Step 5 Enter a new description. You can click to submit or to cancel the modification.l After you submit the modification, you can view the new description in the Description

column on the Parameter Group Management page.l The description must consist of a maximum of 256 characters and cannot contain the

following special characters: >!<"&'=

----End

1.4.8 Deleting a Parameter Group

Scenarios

You can delete a user-created parameter group that is no longer in use.

NOTICEDeleted parameter groups cannot be recovered. Exercise caution when performing thisoperation.

Procedure

Step 1 Log in to the management console.

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

You can select a DCC to create a DB instance.

Relational Database ServiceUser Guide 1 Managing DB Instances

Issue 16 (2018-08-03) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

26

Page 33: User Guide · Relational Database Service User Guide Issue 16 Date 2018-08-03 HUAWEI TECHNOLOGIES CO., LTD

Step 3 Under Database, click Relational Database Service to go to the RDS console.

Step 4 Choose Parameter Group Management in the navigation pane on the left. On the User-Created page, locate the target parameter group to be deleted and choose More > Delete inthe Operation column.

The following parameter groups cannot be deleted:

l Default parameter groupsl Parameter groups associated with DB instances

Step 5 Click OK.

----End

1.5 Storage Space

1.5.1 Scaling Up Storage Space

ScenariosThis section describes how to scale up storage space if it is no longer sufficient for yourrequirements.

RDS allows you to scale up storage space of DB instances but you cannot change the storagetype. Services are not interrupted during scaling.

NOTE

l DB instances can be scaled up an unlimited number of times.l For primary/standby DB instances, scaling up the primary DB instance will cause the standby DB

instance to also be scaled up accordingly.l You cannot reboot or delete a DB instance that is being scaled up.l Storage space can only be scaled up, not down.l If you scale up a DB instance with disks encrypted, the expanded storage space will be encrypted

using the original encryption key.l You can change the CPU and memory of a DB instance only when your account balance is greater

than or equal to ¥0.

Scaling Up a Primary DB Instance

Step 1 Log in to the management console.

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

You can select a DCC to create a DB instance.

Step 3 Under Database, click Relational Database Service to go to the RDS console.

Step 4 On the Instance Management page, locate the target DB instance and click Scale in theOperation column. You can also click the target DB instance name to go to the BasicInformation page. In the Storage Information area, click Scale Up in the Disk Usage field.

Step 5 On the displayed page, click Storage Space, specify the desired storage space, and clickNext.

Relational Database ServiceUser Guide 1 Managing DB Instances

Issue 16 (2018-08-03) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

27

Page 34: User Guide · Relational Database Service User Guide Issue 16 Date 2018-08-03 HUAWEI TECHNOLOGIES CO., LTD

The minimum start value of each scaling is 10 GB. A DB instance can be scaled up only by amultiple of 10 GB. The maximum storage space is 4,000 GB.

The maximum storage space for some SQL Server DB instances is 2,000 GB because ofrestrictions of the windows disk size. The actual upper limit depends on the informationdisplayed on the console.

Step 6 Confirm your specifications.l If you need to modify your settings, click Previous.l If you select the Pay-per-use billing mode and do not need to modify your settings, click

Submit. If you select the Yearly/Monthly billing mode and do not need to modify yoursettings, click Pay Now.

Step 7 View the scale-up result.

Scaling up storage space takes 3-5 minutes. During this time, the status of the DB instance onthe Instance Management page will be Scaling up. Click the DB instance and view theutilization on the displayed Basic Information page to verify that the scale-up is successful.

If the DB instance is running the MySQL DB engine, you can view the detailed progress andresult on the Task Center page. For details, see section Viewing Task Execution Progressesand Results.

----End

Scaling Up a Read ReplicaNOTE

l Scaling up a read replica and primary DB instance do not affect each other.

l Microsoft SQL Server does not support read replicas.

Step 1 Log in to the management console.

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

You can select a DCC to create a DB instance.

Step 3 Under Database, click Relational Database Service to go to the RDS console.

Step 4 On the Instance Management page, locate the target DB instance and click next to it.Locate a read replica to be scaled and click Scale in the Operation column. You can alsoclick the target DB instance name to go to the Basic Information page. In the StorageInformation area, click Scale Up in the Disk Usage field.

Step 5 On the displayed page, click Storage Space, specify the desired storage space, and clickNext.

The minimum start value of each scaling is 10 GB. A DB instance can be scaled up only by amultiple of 10 GB. The maximum storage space is 4,000 GB.

Step 6 Confirm your specifications.l If you need to modify your settings, click Previous.l If you select the Pay-per-use billing mode and do not need to modify your settings, click

Submit. If you select the Yearly/Monthly billing mode and do not need to modify yoursettings, click Pay Now.

Relational Database ServiceUser Guide 1 Managing DB Instances

Issue 16 (2018-08-03) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

28

Page 35: User Guide · Relational Database Service User Guide Issue 16 Date 2018-08-03 HUAWEI TECHNOLOGIES CO., LTD

Step 7 View the scale-up result.

Scaling up storage space takes 3-5 minutes. During this time, the status of the DB instance onthe Instance Management page will be Scaling up. Click the DB instance and view theutilization on the displayed Basic Information page to verify that the scale-up is successful.

If the DB instance is running the MySQL DB engine, you can view the detailed progress andresult on the Task Center page. For details, see section Viewing Task Execution Progressesand Results.

----End

1.6 Network

1.6.1 Configuring and Changing a Private IP Address

ScenariosYou can plan and change private IP addresses after migrating on-premises or external clouddatabases to HUAWEI CLOUD.

NOTE

Currently, this function only supports the MySQL DB engine.

Configuring a Private IP AddressYou can use a self-configured or a system-allocated private IP address when creating a DBinstance.

Changing a Private IP AddressTo change the private IP address of a created DB instance, perform the following steps:

Step 1 Log in to the management console.

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

You can select a DCC to create a DB instance.

Step 3 Under Database, click Relational Database Service to go to the RDS console.

Step 4 On the Instance Management page, click the target DB instance name.

Step 5 On the Basic Information page, click Modify in the Private IP Address field. In thedisplayed dialog box, enter a new IP address and click OK.

Relational Database ServiceUser Guide 1 Managing DB Instances

Issue 16 (2018-08-03) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

29

Page 36: User Guide · Relational Database Service User Guide Issue 16 Date 2018-08-03 HUAWEI TECHNOLOGIES CO., LTD

Figure 1-5 Changing a private IP Address

----End

1.6.2 Binding and Unbinding an EIP

Scenarios

By default, a DB instance is not publicly accessible after being created. You can bind an EIPto it to allow resources on the public network to access it. You can also unbind the EIP fromthe DB instance.

NOTICETo ensure that the database can be accessed, the security group used by the database musthave the permission to access the database port. For example, if the database port is 8635,ensure that the security group has the permission to access port 8635.

Prerequisitesl You can bind an EIP to a primary DB instance or read replica only.l If a DB instance has already been bound with an EIP, you must first unbind the EIP from

the instance before binding a new EIP to it.

NOTE

This function is currently unavailable for some existing DB instances because the connection IPaddresses were created in a way that does not support binding EIPs.

Binding an EIP

Step 1 Log in to the management console.

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

You can select a DCC to create a DB instance.

Relational Database ServiceUser Guide 1 Managing DB Instances

Issue 16 (2018-08-03) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

30

Page 37: User Guide · Relational Database Service User Guide Issue 16 Date 2018-08-03 HUAWEI TECHNOLOGIES CO., LTD

Step 3 Under Database, click Relational Database Service to go to the RDS console.

Step 4 On the Instance Management page, click the target DB instance name.

Step 5 If the target DB instance is running the MySQL DB engine, click in the PubliclyAccessible field on the Basic Information page. If the target DB instance is running thePostgreSQL or SQL Server DB engine, click Bind in the EIP field on the Basic Informationpage.

l When you enable public accessibility for a MySQL DB instance for the first time, RDSwill automatically create an EIP (with the default bandwidth of 1 Mbit/s).

You can access DB instances through specific IP addresses only after adding them to thewhitelist. For details, see section Configuring a Whitelist.

l If the target DB instance is a PostgreSQL or Microsoft SQL Server DB instance, allunbound EIPs are listed in the displayed dialog box. Select the EIP to be bound and clickOK. If no available EIP addresses are displayed, click View EIP Details and assign EIPaddresses on the VPC console.

After you bind an EIP to a Microsoft SQL Server DB instance, you must reboot theinstance to make the SSL connection work.

Step 6 On the Basic Information page, you can view the EIP that has been bound to the DBinstance.

To unbind the EIP from the DB instance, see Unbinding an EIP.

----End

Unbinding an EIP

Step 1 Log in to the management console.

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

You can select a DCC to create a DB instance.

Step 3 Under Database, click Relational Database Service to go to the RDS console.

Step 4 On the Instance Management page, click the DB instance that has been bound with an EIP.

Step 5 If the target DB instance is running the MySQL DB engine, click in the PubliclyAccessible field on the Basic Information page. If the target DB instance is running thePostgreSQL or SQL Server DB engine, click Unbind in the EIP field on the BasicInformation page.

After you unbind an EIP from a Microsoft SQL Server DB instance, you must reboot theinstance to make the SSL connection work.

Step 6 Click OK.

To bind an EIP to the DB instance again, see Binding an EIP.

----End

Relational Database ServiceUser Guide 1 Managing DB Instances

Issue 16 (2018-08-03) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

31

Page 38: User Guide · Relational Database Service User Guide Issue 16 Date 2018-08-03 HUAWEI TECHNOLOGIES CO., LTD

1.6.3 Changing the Database Port

Scenarios

This section describes how to change the database port of a primary DB instance or a readreplica. For primary/standby DB instances, changing the database port of the primary DBinstance will cause the database port of the standby DB instance to also be changedaccordingly.

Restrictions

You cannot perform the following operations when the database port of a DB instance isbeing changed:

l Binding an EIPl Delete the DB instance.l Create a backup for the DB instance.l Restore the DB instance from a backup to the original DB instance point in time.l Edit, change, reset, and delete a parameter group associated with the DB instance.

Procedure

Step 1 Log in to the management console.

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

You can select a DCC to create a DB instance.

Step 3 Under Database, click Relational Database Service to go to the RDS console.

Step 4 On the Instance Management page, click the target DB instance or click and then thetarget read replica.

Step 5 On the displayed Basic Information page, click in the Database Port.

Database ports can range from 2100 to 9500. SQL Server database ports can be 1433 or rangefrom 2100 to 9500, excluding 5355 and 5985.

l To submit the change, click .– In the dialog box, click OK.

i. For primary/standby DB instances: If you change the database port of theprimary DB instance, the database port of the standby DB instance will also bechanged accordingly.

ii. For a read replica: Changes to the associated database port will not affect otherDB instances. Only the read replica will reboot.

NOTE

Currently, RDS for SQL Server does not support read replicas.

iii. This process takes 1-5 minutes.– In the dialog box, click Cancel to cancel the modification.

Relational Database ServiceUser Guide 1 Managing DB Instances

Issue 16 (2018-08-03) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

32

Page 39: User Guide · Relational Database Service User Guide Issue 16 Date 2018-08-03 HUAWEI TECHNOLOGIES CO., LTD

l To cancel the change, click .

Step 6 View the result of the change on the Basic Information page.

----End

1.7 Security

1.7.1 Resetting the Administrator Password

Scenarios

You can reset the administrator password only through the primary DB instance.

You cannot reset the administrator password under the following circumstances:

l Your account is frozen.

l The database port is being changed.

l The status of the primary DB instance is Creating, Restoring, Rebooting, Changingport, or Abnormal.

NOTE

l If you reset the administrator password of the primary DB instance, the passwords of otherassociated DB instances are also automatically changed to the same value.

l The length of time it takes for the new password to take effect depends on the amount of service datacurrently being processed by the primary DB instance.

l To prevent brute force cracking and ensure system security, change your password periodically, suchas every three or six months.

l When you reset the administrator password of an RDS SQL Server DB instance, the permissions ofthe administrator will be supplemented.

Background

If you enable the operation protection function, second authentication is required when youperform sensitive operations to improve the security of your account and cloud product. Fordetails about how to enable operation protection, see the Identity and Access ManagementUser Guide.

Method 1

Step 1 Log in to the management console.

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

You can select a DCC to create a DB instance.

Step 3 Under Database, click Relational Database Service to go to the RDS console.

Step 4 On the Instance Management page, locate the target DB instance and choose More > ResetPassword in the Operation column.

Relational Database ServiceUser Guide 1 Managing DB Instances

Issue 16 (2018-08-03) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

33

Page 40: User Guide · Relational Database Service User Guide Issue 16 Date 2018-08-03 HUAWEI TECHNOLOGIES CO., LTD

Step 5 If you have enabled operation security, click Start verification in the Reset Password dialogbox. On the displayed page, click Send Code, enter the obtained verification code, and clickVerify. The page is closed automatically.

Step 6 Enter a new password and confirm the password.

NOTICEKeep this password secure. The system cannot retrieve it.

The new password must consist of 8 to 32 characters and must be a combination of uppercaseletters, lowercase letters, digits, and at least one of the following special characters: ~!@#%^*-_=+? Enter a strong password and periodically change it to improve security, preventingsecurity risks such as brute force cracking.

l To submit the new password, click OK.

l To cancel the reset, click Cancel.

----End

Method 2

Step 1 Log in to the management console.

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

You can select a DCC to create a DB instance.

Step 3 Under Database, click Relational Database Service to go to the RDS console.

Step 4 On the Instance Management page, click the target DB instance name.

Step 5 On the displayed Basic Information page, click Reset Password in the Administrator field.In the displayed dialog box, enter a new password and confirm the password.

NOTICEKeep this password secure. The system cannot retrieve it.

The new password must consist of 8 to 32 characters and must be a combination of uppercaseletters, lowercase letters, digits, and at least one of the following special characters: ~!@#%^*-_=+? Enter a strong password and periodically change it to improve security, preventingsecurity risks such as brute force cracking.

l To submit the new password, click OK.

l To cancel the reset, click Cancel.

----End

Relational Database ServiceUser Guide 1 Managing DB Instances

Issue 16 (2018-08-03) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

34

Page 41: User Guide · Relational Database Service User Guide Issue 16 Date 2018-08-03 HUAWEI TECHNOLOGIES CO., LTD

1.7.2 Changing a Security Group

ScenariosThis section describes how to change the security group of a primary DB instance or readreplica. For primary/standby DB instances, changing the security group of the primary DBinstance will cause the security group of the standby DB instance to also be changedaccordingly.

Procedure

Step 1 Log in to the management console.

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

You can select a DCC to create a DB instance.

Step 3 Under Database, click Relational Database Service to go to the RDS console.

Step 4 On the Instance Management page, click the target DB instance or read replica.

Step 5 In the Network area on the displayed Basic Information page, click in the SecurityGroup field.

l To submit the change, click .

l To cancel the change, click .

Step 6 Changing the security group takes 1 to 3 minutes. Click in the upper right corner on theBasic Information page to view the result of the change.

----End

1.7.3 Configuring a Whitelist

ScenariosBefore accessing RDS DB instances through EIPs, you need to configure a whitelist. Bydefault, the RDS DB instance whitelist only contains the default IP address 127.0.0.1 anddoes not contain security groups, indicating that no server can access RDS DB instances.

After you configure a whitelist, only servers to which IP addresses in the whitelist belong onthe public network can access RDS DB instances. You are advised to periodically maintain awhitelist to ensure the security of accessing DB instances. Configuring a whitelist only affectsaccess to DB instances and does not affect proper running of DB instances. The followingdescribes how to configure a whitelist.

Relational Database ServiceUser Guide 1 Managing DB Instances

Issue 16 (2018-08-03) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

35

Page 42: User Guide · Relational Database Service User Guide Issue 16 Date 2018-08-03 HUAWEI TECHNOLOGIES CO., LTD

WARNINGl If you enter % or 0.0.0.0/0 in the whitelist, all IP addresses are allowed to access DB

instances. This configuration greatly reduces the security of the databases. Do not makethis configuration unless necessary.

l If an application still cannot be connected to a DB instance after the application's IPaddress is added to the whitelist, see How Can I Obtain IP Addresses of Applications?

Procedure

Step 1 Log in to the management console.

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

You can select a DCC to create a DB instance.

Step 3 Under Database, click Relational Database Service to go to the RDS console.

Step 4 On the Instance Management page, click the target DB instance name.

Step 5 On the displayed Basic Information page, click Configure in the Whitelist field. In thedisplayed dialog box, enter IP addresses of applications that can access RDS DB instancesthrough EIPs and click OK.l You can access DB instances through specific IP addresses only after adding them to the

whitelist.l If you enter the IP address 0.0.0.0/0, all IP addresses are allowed to access DB instances.l If you enter an IP address such as 10.10.10.0/24, all IP addresses in the "10.10.10.X"

format can access DB instances.l If you need to add multiple IP addresses, separate them with commas (,), for example,

192.168.0.1,172.16.213.9 (no spaces before and after the comma).l When public accessibility is re-enabled, the whitelist reverts to its most recently used

configuration.

Step 6 On the Basic Information page, you can view the whitelist you have configured.

----End

1.7.4 Performing a Server-Side Encryption

IntroductionThe RDS console supports server-side encryption with Data Encryption Workshop (DEW)-managed keys.

DEW uses a third-party hardware security module (HSM) to protect keys, enabling you tocreate and control encryption keys easily. Keys are not displayed in plaintext outside HSMs,which prevents key disclosure. With DEW, all operations on keys are controlled and logged,and usage records of all keys can be provided to meet regulatory compliance requirements.

After server-side encryption is enabled, disk data will be encrypted and stored on the serverwhen you create a DB instance or expand disk capacity. When downloading the encryptedobjects, the encrypted data will be decrypted on the server and displayed in plaintext to you.

Relational Database ServiceUser Guide 1 Managing DB Instances

Issue 16 (2018-08-03) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

36

Page 43: User Guide · Relational Database Service User Guide Issue 16 Date 2018-08-03 HUAWEI TECHNOLOGIES CO., LTD

Encrypting Disks Using Server-Side Encryption

Only professional edition keys can be used to encrypt DB instances.

You need to create a key using DEW or use the default key provided by DEW. Then, enablethe disk encryption and use the DEW key to perform server-side encryption when creating aDB instance or expanding disk capacity. The key is the tenant key. For details, see thedescriptions of buying DB instances in the Relational Database Service Quick Start.

l The KMS Administrator permission has been added in the region of RDS usingIdentity and Access Management (IAM). For details about how to add permissions, seethe "Creating and Authorizing a User Group" section in the Identity and AccessManagement User Guide.

l If you want to use a user-defined key to encrypt objects to be uploaded, create a keyusing DEW. For details about how to create a key using DEW, see the "Creating a CMK"section in the Data Encryption Workshop User Guide.

l Once the disk encryption function is enabled, you cannot disable it or change the keyafter a DB instance is created. Backup data will not be encrypted in OBS.

l After a DB instance is created, do not disable or delete the key that is being used.Otherwise, RDS will be unavailable and data cannot be restored.

l If you scale up a DB instance with disks encrypted, the expanded storage space will beencrypted using the original encryption key.

1.8 Viewing Task Execution Progresses and Results

Scenarios

This section describes how to view the progresses and results of asynchronous tasks on theTask Center page.

NOTE

Currently, you can view the execution progresses and results of the following tasks:

l Creating RDS MySQL DB instances

l Creating MySQL read replicas

l Scaling up storage space of MySQL DB instances

l Enabling public accessibility for MySQL DB instances

l Disabling public accessibility for MySQL DB instances

l Changing a DB instance type from single to primary/standby

Procedure

Step 1 Log in to the management console.

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

You can select a DCC to create a DB instance.

Step 3 Under Database, click Relational Database Service to go to the RDS console.

Step 4 On the Task Center page, locate the target task name and click to expand its details.

Relational Database ServiceUser Guide 1 Managing DB Instances

Issue 16 (2018-08-03) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

37

Page 44: User Guide · Relational Database Service User Guide Issue 16 Date 2018-08-03 HUAWEI TECHNOLOGIES CO., LTD

To identify the target task, you can use the task name and DB instance name/ID or enter thetarget task name in the search box in the upper right corner.

Step 5 View the execution progress and result of the task.

----End

1.9 Cloud DBANOTE

Currently, the cloud DBA function only supports the MySQL DB engine.

With cloud DBA, you can comprehensively analyze DB instances to understand theirperformance and operating statuses. Cloud DBA helps you diagnose DB instances to detectpotential database health problems and provides suggestions according to diagnostic results.

Cloud DBA diagnoses DB instances from system resources, storage space, slow SQLanalysis, transaction management, lock management, and intelligent diagnosis.

1.9.1 System Resources

Scenarios

The system resource diagnosis covers the database connections, CPU usage, memory usage,IOPS, and real-time database session data.

l You can evaluate the database connection pressure based on the database connections.

l You can learn the CPU usage and memory usage and determine whether to change themaccordingly.

l You can determine whether the random access performance of DB instances meets therequirements according to the IOPS.

Procedure

Step 1 Log in to the management console.

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

You can select a DCC to create a DB instance.

Step 3 Under Database, click Relational Database Service to go to the RDS console.

Step 4 On the Instance Management page, click the target DB instance name.

Step 5 On the Cloud DBA page, click System Resources to view the system resource usage.

You can click System Diagnosis to diagnose the database connections, CPU usage, andmemory usage to determine whether metrics of the DB instance within an hour are normal.

Relational Database ServiceUser Guide 1 Managing DB Instances

Issue 16 (2018-08-03) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

38

Page 45: User Guide · Relational Database Service User Guide Issue 16 Date 2018-08-03 HUAWEI TECHNOLOGIES CO., LTD

Figure 1-6 System resources

The diagnostic results are displayed on the Intelligent Diagnosis page.l During the diagnosis, the result is Diagnosing.

For DB instances being diagnosed, you can click on the left of Diagnostic Progress toview detailed diagnosis information.

Figure 1-7 System resources diagnostic progress

l After the diagnosis is complete, if the result is Available, all metrics are normal.l After the diagnosis is complete, if the result is Error occurred, one or more metrics are

abnormal.You can solve the error following the instructions provided in Viewing Error Details (IfAny) or export the diagnostic report following the instructions provided in Exporting aDiagnostic Report.

l After the diagnosis is complete, if the result is Diagnosis failed, the failure is caused byan exception in the diagnosis process.

----End

1.9.2 Storage Space

Scenarios

The storage space diagnosis covers the disk usage, average daily growth over the last week,and available days calculated based on the disk usage. In addition, the allocation of databasedisks is provided, helping you learn the disk usage.

Relational Database ServiceUser Guide 1 Managing DB Instances

Issue 16 (2018-08-03) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

39

Page 46: User Guide · Relational Database Service User Guide Issue 16 Date 2018-08-03 HUAWEI TECHNOLOGIES CO., LTD

Procedure

Step 1 Log in to the management console.

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

You can select a DCC to create a DB instance.

Step 3 Under Database, click Relational Database Service to go to the RDS console.

Step 4 On the Instance Management page, click the target DB instance name.

Step 5 On the Cloud DBA page, click Storage Space to view detailed information about storagespace.

You can click Space Diagnosis to diagnose health of the disk usage and table space usage.

Figure 1-8 Storage space

The diagnostic results are displayed on the Intelligent Diagnosis page.l During the diagnosis, the result is Diagnosing.

For DB instances being diagnosed, you can click on the left of Diagnostic Progress toview detailed diagnosis information.

Figure 1-9 Storage space diagnostic progress

l After the diagnosis is complete, if the result is Available, all metrics are normal.l After the diagnosis is complete, if the result is Error occurred, one or more metrics are

abnormal.

Relational Database ServiceUser Guide 1 Managing DB Instances

Issue 16 (2018-08-03) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

40

Page 47: User Guide · Relational Database Service User Guide Issue 16 Date 2018-08-03 HUAWEI TECHNOLOGIES CO., LTD

You can solve the error following the instructions provided in Viewing Error Details (IfAny) or export the diagnostic report following the instructions provided in Exporting aDiagnostic Report.

l After the diagnosis is complete, if the result is Diagnosis failed, the failure is caused byan exception in the diagnosis process.

----End

1.9.3 Slow SQL Analysis

Scenarios

The slow SQL analysis diagnosis covers the time point, quantity, and execution time of slowSQL statements, helping you analyze slow SQL statements and optimize databaseperformance.

Procedure

Step 1 Log in to the management console.

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

You can select a DCC to create a DB instance.

Step 3 Under Database, click Relational Database Service to go to the RDS console.

Step 4 On the Instance Management page, click the target DB instance name.

Step 5 On the Cloud DBA page, click Slow SQL Analysis to view detailed information about slowSQL statements.

You can click SQL Diagnosis to analyze slow SQL statements and the CPU usage.

Figure 1-10 Slow SQL analysis

The diagnostic results are displayed on the Intelligent Diagnosis page.l During the diagnosis, the result is Diagnosing.

For DB instances being diagnosed, you can click on the left of Diagnostic Progress toview detailed diagnosis information.

Relational Database ServiceUser Guide 1 Managing DB Instances

Issue 16 (2018-08-03) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

41

Page 48: User Guide · Relational Database Service User Guide Issue 16 Date 2018-08-03 HUAWEI TECHNOLOGIES CO., LTD

Figure 1-11 SQL diagnostic progress

l After the diagnosis is complete, if the result is Available, all metrics are normal.

l After the diagnosis is complete, if the result is Error occurred, one or more metrics areabnormal.

You can solve the error following the instructions provided in Viewing Error Details (IfAny) or export the diagnostic report following the instructions provided in Exporting aDiagnostic Report.

l After the diagnosis is complete, if the result is Diagnosis failed, the failure is caused byan exception in the diagnosis process.

----End

1.9.4 Transaction Management

Scenarios

The transaction management diagnosis covers transactions that are not closed on DBinstances.

Procedure

Step 1 Log in to the management console.

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

You can select a DCC to create a DB instance.

Step 3 Under Database, click Relational Database Service to go to the RDS console.

Step 4 On the Instance Management page, click the target DB instance name.

Step 5 On the Cloud DBA page, click Transaction Management to view detailed information abouttransactions.

You can click Transaction Diagnosis to determine whether transactions are efficient.

The diagnostic results are displayed on the Intelligent Diagnosis page.

l During the diagnosis, the result is Diagnosing.

For DB instances being diagnosed, you can click on the left of Diagnostic Progress toview detailed diagnosis information.

Relational Database ServiceUser Guide 1 Managing DB Instances

Issue 16 (2018-08-03) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

42

Page 49: User Guide · Relational Database Service User Guide Issue 16 Date 2018-08-03 HUAWEI TECHNOLOGIES CO., LTD

Figure 1-12 Transaction diagnostic progress

l After the diagnosis is complete, if the result is Available, all metrics are normal.l After the diagnosis is complete, if the result is Error occurred, one or more metrics are

abnormal.You can solve the error following the instructions provided in Viewing Error Details (IfAny) or export the diagnostic report following the instructions provided in Exporting aDiagnostic Report.

l After the diagnosis is complete, if the result is Diagnosis failed, the failure is caused byan exception in the diagnosis process.

----End

1.9.5 Lock Management

Scenarios

The lock management diagnosis covers the IDs and SQL statements of the following itemsthat are waiting or blocked:

l Transactionsl Locksl Threads

Procedure

Step 1 Log in to the management console.

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

You can select a DCC to create a DB instance.

Step 3 Under Database, click Relational Database Service to go to the RDS console.

Step 4 On the Instance Management page, click the target DB instance name.

Step 5 On the Cloud DBA page, click Lock Management to view detailed information about locks.

You can click Lock Diagnosis to check whether a deadlock occurs on the database.

The diagnostic results are displayed on the Intelligent Diagnosis page.l During the diagnosis, the result is Diagnosing.

For DB instances being diagnosed, you can click on the left of Diagnostic Progress toview detailed diagnosis information.

Relational Database ServiceUser Guide 1 Managing DB Instances

Issue 16 (2018-08-03) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

43

Page 50: User Guide · Relational Database Service User Guide Issue 16 Date 2018-08-03 HUAWEI TECHNOLOGIES CO., LTD

Figure 1-13 Lock diagnostic progress

l After the diagnosis is complete, if the result is Available, all metrics are normal.l After the diagnosis is complete, if the result is Error occurred, one or more metrics are

abnormal.You can solve the error following the instructions provided in Viewing Error Details (IfAny) or export the diagnostic report following the instructions provided in Exporting aDiagnostic Report.

l After the diagnosis is complete, if the result is Diagnosis failed, the failure is caused byan exception in the diagnosis process.

----End

1.9.6 Intelligent Diagnosis

ScenariosIntelligent diagnosis integrates the diagnoses of system resources, storage space, slow SQLstatements, transactions, and locks, and tracks the progress of each diagnosis.

Comprehensive Diagnosis

Step 1 Log in to the management console.

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

You can select a DCC to create a DB instance.

Step 3 Under Database, click Relational Database Service to go to the RDS console.

Step 4 On the Instance Management page, click the target DB instance name.

Step 5 On the Cloud DBA page, click Intelligent Diagnosis to view detailed information about alldiagnoses.

You can select a diagnosis type in the upper right corner of the page.

Relational Database ServiceUser Guide 1 Managing DB Instances

Issue 16 (2018-08-03) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

44

Page 51: User Guide · Relational Database Service User Guide Issue 16 Date 2018-08-03 HUAWEI TECHNOLOGIES CO., LTD

Figure 1-14 Selecting a diagnosis type

You can click Comprehensive Diagnosis to comprehensively analyze the DB instance.l During the diagnosis, the result is Diagnosing.

For DB instances being diagnosed, you can click on the left of Diagnostic Progress toview detailed diagnosis information.

Figure 1-15 Comprehensive diagnostic progress

l After the diagnosis is complete, if the result is Available, all metrics are normal.l After the diagnosis is complete, if the result is Error occurred, one or more metrics are

abnormal.You can solve the error following the instructions provided in Viewing Error Details (IfAny) or export the diagnostic report following the instructions provided in Exporting aDiagnostic Report.

l After the diagnosis is complete, if the result is Diagnosis failed, the failure is caused byan exception in the diagnosis process.

----End

Viewing Error Details (If Any)

Step 1 Log in to the management console.

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

You can select a DCC to create a DB instance.

Relational Database ServiceUser Guide 1 Managing DB Instances

Issue 16 (2018-08-03) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

45

Page 52: User Guide · Relational Database Service User Guide Issue 16 Date 2018-08-03 HUAWEI TECHNOLOGIES CO., LTD

Step 3 Under Database, click Relational Database Service to go to the RDS console.

Step 4 On the Instance Management page, click the target DB instance name.

Step 5 On the Cloud DBA page, click Intelligent Diagnosis. On the displayed page, clickComprehensive Diagnosis to comprehensively analyze the DB instance.

Step 6 If an error occurred on a diagnosis, the result is Error occurred. Click Error occurred toview error details, including the error type, severity, time, error description, and handlingsuggestions.

To enable cloud DBA to better serve you and provide better intelligent analysis andsuggestions, you are advised to submit your feedback, as shown in the following figure.

l If you think the suggestion is useful, click Upvotel If you think the suggestion does not help you a lot, click Downvote.

Figure 1-16 Error details

----End

Exporting a Diagnostic Report

Step 1 Log in to the management console.

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

You can select a DCC to create a DB instance.

Step 3 Under Database, click Relational Database Service to go to the RDS console.

Step 4 On the Instance Management page, click the target DB instance name.

Step 5 On the Cloud DBA page, click Intelligent Diagnosis. On the displayed page, clickComprehensive Diagnosis to comprehensively analyze the DB instance.

Step 6 If an error occurred on a diagnosis, the result is Error occurred. Locate the diagnosis andclick Export Report in the Operation column.

----End

Relational Database ServiceUser Guide 1 Managing DB Instances

Issue 16 (2018-08-03) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

46

Page 53: User Guide · Relational Database Service User Guide Issue 16 Date 2018-08-03 HUAWEI TECHNOLOGIES CO., LTD

Deleting a Diagnosis

Step 1 Log in to the management console.

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

You can select a DCC to create a DB instance.

Step 3 Under Database, click Relational Database Service to go to the RDS console.

Step 4 On the Instance Management page, click the target DB instance name.

Step 5 On the Cloud DBA page, click Intelligent Diagnosis. On the displayed page, clickComprehensive Diagnosis to comprehensively analyze the DB instance.

Step 6 If a completed diagnosis is no longed required, you can locate it and click Delete in theOperation column.

Figure 1-17 Deleting a diagnosis

----End

1.10 Tags

Scenarios

Tag Management Service (TMS) enables you to use tags on the management console tomanage resources. TMS works with other cloud services to manage tags. TMS manages tagsglobally, and other cloud services manage their own tags.

l You are advised to set predefined tags on the TMS console.

l A tag consists of a key and value. You can add only one value for each key.

l A maximum of 10 tags can be added for each DB instance.

Relational Database ServiceUser Guide 1 Managing DB Instances

Issue 16 (2018-08-03) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

47

Page 54: User Guide · Relational Database Service User Guide Issue 16 Date 2018-08-03 HUAWEI TECHNOLOGIES CO., LTD

Adding a Tag

Step 1 Log in to the management console.

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

You can select a DCC to create a DB instance.

Step 3 Under Database, click Relational Database Service to go to the RDS console.

Step 4 On the Instance Management page, click the target DB instance name.

Step 5 On the Tags page, click Add. In the displayed dialog box, enter a tag key and value, and clickOK.

Figure 1-18 Adding a tag

l When you enter a tag key and value, the system automatically displays all tags(including predefined tags and resource tags) associated with all DB instances except thecurrent one.

l The tag key cannot be empty and must be unique. It must consist of 1 to 36 characters,cannot start or end with a space, and cannot contain the following special characters:=*<>\,|/

l The tag value can be empty or consist of 1 to 43 characters, cannot start or end with aspace, and cannot contain the following special characters: =*<>\,|/

Step 6 After a tag has been added, you can view and manage it on the Tags page.

----End

Relational Database ServiceUser Guide 1 Managing DB Instances

Issue 16 (2018-08-03) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

48

Page 55: User Guide · Relational Database Service User Guide Issue 16 Date 2018-08-03 HUAWEI TECHNOLOGIES CO., LTD

Editing a Tag

Step 1 Log in to the management console.

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

You can select a DCC to create a DB instance.

Step 3 Under Database, click Relational Database Service to go to the RDS console.

Step 4 On the Instance Management page, click the target DB instance name.

Step 5 On the Tags page, locate the tag to be edited and click Edit in the Operation column. In thedisplayed dialog box, change the tag value and click OK.l You can only edit the tag value.l The tag value can be empty or consist of 1 to 43 characters. Only letters, digits, hyphens

(-), and underscores (_) are allowed.l The tag value can be empty or consist of 1 to 43 characters, cannot start or end with a

space, and cannot contain the following special characters: =*<>\,|/

Step 6 After a tag has been edited, you can view and manage it on the Tags page.

----End

Deleting a Tag

Step 1 On the Instance Management page, click the target DB instance name.

Step 2 On the Tags page, locate the tag to be deleted and click Delete. In the displayed dialog box,click OK.

Step 3 After a tag has been deleted, it will no longer be displayed on the Tags page.

----End

1.11 Account Management (Non-Administrator)NOTE

Currently, the account management function only supports the MySQL DB engine.

1.11.1 Creating an Account

Scenarios

When you create an RDS DB instance, user root is created synchronously by default. You canadd other users as required.

Procedure

Step 1 Log in to the management console.

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

Relational Database ServiceUser Guide 1 Managing DB Instances

Issue 16 (2018-08-03) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

49

Page 56: User Guide · Relational Database Service User Guide Issue 16 Date 2018-08-03 HUAWEI TECHNOLOGIES CO., LTD

You can select a DCC to create a DB instance.

Step 3 Under Database, click Relational Database Service to go to the RDS console.

Step 4 On the Instance Management page, click the target DB instance name.

Step 5 On the Accounts page, click Create Account. In the displayed dialog box, enter a username,authorize permissions for databases, enter a password, and confirm the password. Then, clickOK.l The username must consist of 4 to 16 characters, start with a lowercase letter, and end

with a lowercase letter or digit. Only lowercase letters, digits, and underscores (_) areallowed.

l Select unauthorized databases and click to authorize permissions for databases or

select authorized databases and click to revoke permissions. If there are nounauthorized databases, you can create one by referring to section Creating a Database.You can also modify the permissions after the database creation by referring to sectionChanging Permissions.

l The password can be 8 to 32 characters long and must be a combination of uppercaseletters, lowercase letters, digits, and at least one of the following special characters: ~!@#%^*-_=+?

Step 6 After the account is created, you can manage it on the Accounts page of the selected DBinstance.

----End

1.11.2 Resetting a Password

Scenarios

You can reset passwords of user-created accounts. To prevent brute force cracking and ensuresystem security, change your password periodically, such as every three or six months.

Procedure

Step 1 Log in to the management console.

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

You can select a DCC to create a DB instance.

Step 3 Under Database, click Relational Database Service to go to the RDS console.

Step 4 On the Instance Management page, click the target DB instance name.

Step 5 On the Accounts page, locate the target username and click Reset Password in theOperation column. In the displayed dialog box, enter a new password and confirm thepassword. Then, click OK.l The password can be 8 to 32 characters long and must be a combination of uppercase

letters, lowercase letters, digits, and at least one of the following special characters: ~!@#%^*-_=+?

Relational Database ServiceUser Guide 1 Managing DB Instances

Issue 16 (2018-08-03) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

50

Page 57: User Guide · Relational Database Service User Guide Issue 16 Date 2018-08-03 HUAWEI TECHNOLOGIES CO., LTD

l The password you entered in the Confirm Password text box must be the same as thatyou entered in the New Password text box.

----End

1.11.3 Changing Permissions

ScenariosYou can authorize user-created database accounts for specified databases and revokepermissions for authorized databases.

Procedure

Step 1 Log in to the management console.

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

You can select a DCC to create a DB instance.

Step 3 Under Database, click Relational Database Service to go to the RDS console.

Step 4 On the Instance Management page, click the target DB instance name.

Step 5 On the Accounts page, locate the target username and click Change Permission in theOperation column. In the displayed dialog box, select unauthorized databases and click

to authorize permissions or select authorized databases and click to revokepermissions. Then, click OK.

If there are no unauthorized databases, you can create one by referring to section Creating aDatabase.

----End

1.11.4 Deleting an Account

ScenariosYou can delete user-created database accounts.

NOTICEOnce a database account is deleted, it cannot be restored. Exercise caution when deleting anaccount.

Procedure

Step 1 Log in to the management console.

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

Relational Database ServiceUser Guide 1 Managing DB Instances

Issue 16 (2018-08-03) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

51

Page 58: User Guide · Relational Database Service User Guide Issue 16 Date 2018-08-03 HUAWEI TECHNOLOGIES CO., LTD

You can select a DCC to create a DB instance.

Step 3 Under Database, click Relational Database Service to go to the RDS console.

Step 4 On the Instance Management page, click the target DB instance name.

Step 5 On the Accounts page, locate the target username and click Delete in the Operation column.In the displayed dialog box, click OK.

----End

1.12 Database ManagementNOTE

Currently, the database management function only supports the MySQL DB engine.

1.12.1 Creating a Database

Scenarios

This section describes how to create databases for a DB instance that has been created.

Procedure

Step 1 Log in to the management console.

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

You can select a DCC to create a DB instance.

Step 3 Under Database, click Relational Database Service to go to the RDS console.

Step 4 On the Instance Management page, click the target DB instance name.

Step 5 On the Databases page, click Create Database. In the displayed dialog box, enter a databasename, select a charset, and authorize permissions for users. Then, click OK.

l The database name must consist of 4 to 16 characters, start with a lowercase letter, andend with a lowercase letter or digit. Only lowercase letters, digits, and underscores (_)are allowed.

l The default charset is gbk. You can click Show and select another one.

l Select unauthorized users and click to authorize permissions (mandatory) or select

authorized databases and click to revoke permissions. If there are no unauthorizedaccounts, you can create one by referring to section Creating an Account.

Step 6 After the database is created, you can manage it on the Databases page of the selected DBinstance.

----End

Relational Database ServiceUser Guide 1 Managing DB Instances

Issue 16 (2018-08-03) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

52

Page 59: User Guide · Relational Database Service User Guide Issue 16 Date 2018-08-03 HUAWEI TECHNOLOGIES CO., LTD

1.12.2 Authorizing Permissions for Users

ScenariosYou can authorize user-created database accounts for specified databases and revokepermissions for authorized users.

Procedure

Step 1 Log in to the management console.

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

You can select a DCC to create a DB instance.

Step 3 Under Database, click Relational Database Service to go to the RDS console.

Step 4 On the Instance Management page, click the target DB instance name.

Step 5 On the Databases page, locate the target database and click Authorize in the Operation

column. In the displayed dialog box, select unauthorized users and click to authorize

permissions or select authorized users and click to revoke permissions. Then, click OK.

If there are no unauthorized accounts, you can create one by referring to section Creating anAccount.

----End

1.12.3 Deleting a Database

ScenariosYou can delete user-created databases.

NOTICEOnce a database is deleted, data will be lost. Exercise caution when performing this operation.

Procedure

Step 1 Log in to the management console.

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

You can select a DCC to create a DB instance.

Step 3 Under Database, click Relational Database Service to go to the RDS console.

Step 4 On the Instance Management page, click the target DB instance name.

Relational Database ServiceUser Guide 1 Managing DB Instances

Issue 16 (2018-08-03) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

53

Page 60: User Guide · Relational Database Service User Guide Issue 16 Date 2018-08-03 HUAWEI TECHNOLOGIES CO., LTD

Step 5 On the Databases page, locate the target database and click Delete in the Operation column.In the displayed dialog box, click OK.

----End

Relational Database ServiceUser Guide 1 Managing DB Instances

Issue 16 (2018-08-03) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

54

Page 61: User Guide · Relational Database Service User Guide Issue 16 Date 2018-08-03 HUAWEI TECHNOLOGIES CO., LTD

2 Monitoring DB Instances

2.1 Monitoring DB Instances Using Cloud Eye

2.1.1 Supported Metrics

Scenarios

This section describes how to use Cloud Eye to monitor the operating status of the system.

By monitoring system resource usage when the database is running, you can identify periodsof high resource usage. To optimize database performance, you can analyze which SQLstatements may have had performance issues by checking the following logs:

l MySQL database slow query logsl PostgreSQL database error logsl Microsoft SQL Server database logs

NOTE

You can configure resource alarm rules on the Cloud Eye console. For details, see the "Alarm RuleManagement" section in the Cloud Eye User Guide.

Procedure

Step 1 On the Instance Management page, locate the target DB instance or read replica, and chooseMore > View Metric in the Operation column.

Step 2 On the Cloud Eye console, view monitoring information of the DB instance. On the CloudEye console, click the target RDS DB instance name and click Configure Metric in the upperright corner. In the displayed dialog box, you can select the metrics to be displayed and sortthem by dragging them at desired locations.

Cloud Eye can monitor performance metrics from the last 1 hour, last 3 hours, last 12 hours,last 24 hours, last 7 days, and last 30 days.

DB instance monitoring includes ECS and database performance metrics.

l Table 2-1 lists details about ECS monitoring metrics.

Relational Database ServiceUser Guide 2 Monitoring DB Instances

Issue 16 (2018-08-03) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

55

Page 62: User Guide · Relational Database Service User Guide Issue 16 Date 2018-08-03 HUAWEI TECHNOLOGIES CO., LTD

Table 2-1 ECS monitoring metrics

Metric Description Value Range

CPU Usage Measures the CPU usage (%) ofthe monitored object.

0% to 100%

IOPS Measures the average rate atwhich I/O requests areprocessed during a specifiedperiod.

≥ 0 counts/s

Disk Usage Measures the disk usage (%) ofthe monitored object.

0% to 100%

Memory Usage Measures the memory usage(%) of the monitored object.

0% to 100%

Network InputThroughput

Measures the rate at which allincoming traffic passes throughthe network adapter.

≥ 0 bytes/s

Network OutputThroughput

Measures the rate at which alloutgoing traffic passes throughthe network adapter.

≥ 0 bytes/s

Disk ReadThroughput

Measures the rate at which datais read from a disk.

≥ 0 bytes/s

Disk WriteThroughput

Measures the rate at which datais written to a disk.

≥ 0 bytes/s

Average Time perDisk Read

Measures the time required forreading 1 KB disk data.

> 0s

Average Time perDisk Write

Measures the time required forwriting 1 KB data to a disk.

> 0s

Total Disk Size Measures the total disk size ofthe monitored object.

40 GB to 4,000 GB

Disk Used Measures the amount of useddisk usage of the monitoredobject.

0 GB to 4,000 GB

Average DiskQueue Length

Measures the number of threadswaiting to be written to themonitored object.NOTE

RDS for MySQL does not havethis metric.

≥ 0

l Database metrics:

For details on MySQL metrics, see section Viewing Monitoring Metrics.For details on PostgreSQL metrics, see section Viewing Monitoring Metrics.

Relational Database ServiceUser Guide 2 Monitoring DB Instances

Issue 16 (2018-08-03) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

56

Page 63: User Guide · Relational Database Service User Guide Issue 16 Date 2018-08-03 HUAWEI TECHNOLOGIES CO., LTD

For details on Microsoft SQL Server metrics, see section Viewing Monitoring Metrics.

----End

2.1.2 Setting Alarm Rules

Scenarios

You can set RDS alarm rules to customize the monitored objects and notification policies andto stay aware of the RDS operating status.

The RDS alarm rules include alarm rule names, services, dimensions, monitored objects,metrics, alarm thresholds, monitoring period, and whether to send notifications.

Procedure

Step 1 Log in to the management console.

Step 2 Under Management & Deployment, click Cloud Eye.

Step 3 In the navigation pane on the left, choose Alarm Management > Alarm Rules.

Step 4 On the displayed Alarm Rules page, click Create Alarm Rule.

For details about how to create alarm rules, see the Cloud Eye User Guide.

----End

2.1.3 Viewing Monitoring Metrics

Scenarios

Cloud Eye provided by the public cloud monitors RDS operating status. You can view theRDS monitoring metrics on the management console.

Monitored data takes some time for transmission and display. The RDS status displayed onthe Cloud Eye console is the status of the last 5 to 10 minutes. If your RDS is newly created,wait for 5 to 10 minutes and then view the monitoring data.

Prerequisitesl RDS is running properly.

RDS DB instances that are faulty or have been deleted cannot be displayed on the CloudEye console. After they are rebooted or restored, you can view their status.

NOTE

If an RDS DB instance has been faulty for 24 hours, Cloud Eye considers that it does not exist anddeletes it from the monitoring object list. You need to clear the alarm rule for the DB instance.

l The relational database has been running properly for about 10 minutes.

For a newly created DB instance, you need to wait for a while before viewing themonitoring metrics.

Relational Database ServiceUser Guide 2 Monitoring DB Instances

Issue 16 (2018-08-03) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

57

Page 64: User Guide · Relational Database Service User Guide Issue 16 Date 2018-08-03 HUAWEI TECHNOLOGIES CO., LTD

Procedure

Step 1 Log in to the management console.

Step 2 Under Management & Deployment, click Cloud Eye.

Step 3 In the navigation pane on the left, choose Cloud Service Monitoring > Relational DatabaseService.

Step 4 On the displayed page, locate the target DB instance and click View Metric in the Operationcolumn.

Step 5 In the RDS monitoring area, you can select a duration to view the monitoring data.

You can view the RDS monitoring data of the last 1 hour, 3 hours, or 12 hours. To view themonitoring data of a longer time range, click to enlarge the graph.

----End

2.2 Interconnecting with CTS

2.2.1 Key Operations Supported by CTSCTS records operations related to RDS for further querying, auditing, and backtracking.

Table 2-2 RDS operations that can be recorded by CTS

Operation Resource Type Trace Name

Creating a DB instance or usingbackup data to create a new DBinstance (using the console, TroveAPIs, or open APIs)

DB instance createInstance

Creating a read replica (using theconsole, Trove APIs, or open APIs)

DB instance createReadReplicate

Restarting a DB instance, scaling upa DB instance, changing the DBinstance class, and restoring data tothe original DB instance (using theconsole, Trove APIs, or open APIs)

DB instance instanceAction

Resetting the password (using theconsole)

DB instance resetPassword

Setting the database versionparameters (using open APIs)

DB instance setDBParameters

Resetting the database versionparameters (using open APIs)

DB instance resetDBParameters

Enabling, modifying, or disabling thebackup policy (using the console oropen APIs)

DB instance setBackupPolicy

Relational Database ServiceUser Guide 2 Monitoring DB Instances

Issue 16 (2018-08-03) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

58

Page 65: User Guide · Relational Database Service User Guide Issue 16 Date 2018-08-03 HUAWEI TECHNOLOGIES CO., LTD

Operation Resource Type Trace Name

Changing the database port number(using the console)

DB instance changeInstancePort

Binding and unbinding an EIP (usingthe console)

DB instance setOrResetPublicIP

Modifying the security group (usingthe console)

DB instance modifySecurityGroup

Adding a tag (using the console oropen APIs)

DB instance createTag

Deleting a tag (using the console oropen APIs)

DB instance deleteTag

Modifying a tag (using the console oropen APIs)

DB instance modifyTag

Deleting a DB instance (using theconsole, Trove APIs, or open APIs)

DB instance deleteInstance

Creating a backup (using the consoleor open APIs)

Backup createManualSnapshot

Replicating a backup (using theconsole)

Backup copySnapshot

Deleting a backup (using the consoleor open APIs)

Backup deleteManualSnapshot

Creating a parameter group (usingthe console or Trove APIs)

Config createParameterGroup

Modifying a parameter group (usingthe console or Trove APIs)

Config updateParameterGroup

Deleting a parameter group (usingthe console or Trove APIs)

Config deleteParameterGroup

Replicating a parameter group (usingthe console)

Config copyParameterGroup

Resetting a parameter group (usingthe console)

Config resetParameterGroup

Comparing parameter groups (usingthe console)

Config compareParameterGroup

Applying a parameter group (usingthe console)

Config applyParameterGroup

Relational Database ServiceUser Guide 2 Monitoring DB Instances

Issue 16 (2018-08-03) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

59

Page 66: User Guide · Relational Database Service User Guide Issue 16 Date 2018-08-03 HUAWEI TECHNOLOGIES CO., LTD

2.2.2 Viewing Tracing Records

Scenarios

After CTS is enabled, it starts recording operations on cloud resources. The CTS managementconsole stores the last seven days of operation records.

This section describes how to query the operation records of last 7 days on the CTS console.

Procedure

Step 1 Log in to the management console.

Step 2 In the upper left corner of the page, click and select the desired region and project.

Step 3 Click Service List. Under Management & Deployment, click Cloud Trace Service.

Step 4 Choose Trace List in the navigation pane on the left.

Step 5 Specify the filters used for querying traces. The following four filters are available:l Trace Source, Resource Type, Search By, and Operator

Select the filter from the drop-down list.When you select Trace name for Search By, you also need to select a specific tracename.When you select Resource ID for Search By, you also need to select or enter a specificresource ID.When you select Resource name for Search By, you also need to select or enter aspecific resource name.

l Operator: Select a specific operator (a user rather than tenant).l Trace Status: Available options include all trace status, normal, warning, and

incident. You can only select one of them.l Start time and end time: You can specify the time period for query traces.

Step 6 Click on the left of the record to be queried to extend its details.

Step 7 Locate a trace and click View Trace in the Operation column.

----End

2.3 Viewing LogsYou can view database logs using the RDS console or APIs. This section describes how toview database logs on the RDS console. For details on how to view logs through APIs, see theRelational Database Service API Reference.

For details on viewing MySQL logs, see section Viewing Logs.

For details on viewing PostgreSQL logs, see section Viewing and Downloading Error Logs.

For details on viewing Microsoft SQL Server logs, see section Viewing and DownloadingSystem Logs.

Relational Database ServiceUser Guide 2 Monitoring DB Instances

Issue 16 (2018-08-03) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

60

Page 67: User Guide · Relational Database Service User Guide Issue 16 Date 2018-08-03 HUAWEI TECHNOLOGIES CO., LTD

3 Working with RDS for MySQL

3.1 Migrating MySQL Data Using DRSYou can use DRS to migrate on-premises databases to RDS for MySQL with no downtime.

For details, see Online Migration in the Data Replication Service User Guide.

3.2 Migrating MySQL Data Using mysqldump

3.2.1 Preparing for Data MigrationYou can access RDS through an EIP or ECS.

Preparations1. Prepare an ECS for accessing DB instances in the same VPC subnet or prepare a device

for accessing RDS through a public network.

– To connect to a DB instance through an ECS, you must first create an ECS.

For details about how to create and connect to an ECS, see How Can I Create andConnect to an ECS?

– To connect to a DB instance through an EIP, you must:

i. Bind the EIP to the DB instance. For details, see Binding an EIP.

ii. Ensure that the local device can access the EIP that has been bound to the DBinstance.

2. Install the MySQL client on the ECS or device that was prepared in 1.

For details, see How Can I Install the MySQL Client?

NOTE

The MySQL client version must be the same as the version of RDS for MySQL. The MySQLdatabase or client will provide mysqldump and mysql.

Relational Database ServiceUser Guide 3 Working with RDS for MySQL

Issue 16 (2018-08-03) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

61

Page 68: User Guide · Relational Database Service User Guide Issue 16 Date 2018-08-03 HUAWEI TECHNOLOGIES CO., LTD

3.2.2 Exporting DataBefore migrating an existing MySQL database to RDS, you need to export the MySQLdatabase.

NOTICEl The export tool must match the DB engine version.l Database migration is performed offline. Before the migration, you must stop any

applications using the source database.

Procedure

Step 1 Log in to the ECS or device that can access RDS prepared in 1 in section Preparing for DataMigration.

Step 2 Use the mysqldump tool to export metadata into an SQL file.

NOTICEThe MySQL database is required for RDS management. When exporting metadata, do notspecify --all-database. Otherwise, the MySQL database will be unavailable.

mysqldump --databases <DB_NAME> --single-transaction --order-by-primary --hex-blob--no-data --routines --events --set-gtid-purged=OFF -u <DB_USER> -p -h<DB_ADDRESS> -P <DB_PORT> |sed -e 's/DEFINER[ ]*=[ ]*[^*]*\*/\*/' -e 's/DEFINER[ ]*=.*FUNCTION/FUNCTION/' -e 's/DEFINER[ ]*=.*PROCEDURE/PROCEDURE/' -e 's/DEFINER[ ]*=.*TRIGGER/TRIGGER/' -e 's/DEFINER[ ]*=.*EVENT/EVENT/' > <BACKUP_FILE>

l DB_NAME indicates the name of the database to be migrated.l DB_USER indicates the database username.l DB_ADDRESS indicates the database address.l DB_PORT indicates the database port.l BACKUP_FILE indicates the name of the file to which the data will be exported.

Enter the database password as prompted.

Example:

mysqldump --databases rdsdb --single-transaction --order-by-primary --hex-blob --no-data --routines --events --set-gtid-purged=OFF -u root -p -h 192.168.151.18 -P 3306 |sed -e 's/DEFINER[ ]*=[ ]*[^*]*\*/\*/' -e 's/DEFINER[ ]*=.*FUNCTION/FUNCTION/' -e 's/DEFINER[ ]*=.*PROCEDURE/PROCEDURE/' -e 's/DEFINER[ ]*=.*TRIGGER/TRIGGER/' -e 's/DEFINER[ ]*=.*EVENT/EVENT/' > dump-defs.sql

Enter the database password as prompted.

Relational Database ServiceUser Guide 3 Working with RDS for MySQL

Issue 16 (2018-08-03) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

62

Page 69: User Guide · Relational Database Service User Guide Issue 16 Date 2018-08-03 HUAWEI TECHNOLOGIES CO., LTD

NOTE

If you use mysqldump with a version earlier than 5.6, remove --set-gtid-purged=OFF before runningthis command.

After this command is executed, a dump-defs.sql file will be generated as follows:

[rds@localhost ~]$ ll dump-defs.sql-rw-r-----. 1 rds rds 2714 Sep 21 08:23 dump-defs.sql

Step 3 Use the mysqldump tool to export data into an SQL file.

NOTICEThe MySQL database is required for RDS management. When exporting metadata, do notspecify --all-database. Otherwise, the MySQL database will be unavailable.

mysqldump --databases <DB_NAME> --single-transaction --hex-blob --set-gtid-purged=OFF --no-create-info --skip-triggers -u <DB_USER> -p -h <DB_ADDRESS> -P<DB_PORT> -r <BACKUP_FILE>

For details on the parameters in the preceding command, see Step 2.

Enter the database password as prompted.

Example:

mysqldump --databases rdsdb --single-transaction --hex-blob --set-gtid-purged=OFF --no-create-info --skip-triggers -u root -p -h 192.168.151.18 -P 3306 -r dump-data.sql

NOTE

If you use mysqldump with a version earlier than 5.6, remove --set-gtid-purged=OFF before runningthis command.

After this command is executed, a dump-data.sql file will be generated as follows:

[rds@localhost ~]$ ll dump-data.sql-rw-r-----. 1 rds rds 2714 Sep 21 08:23 dump-data.sql

----End

3.2.3 Importing DataThis section describes how to use an ECS or a device that can access RDS to connect to a DBinstance and import the exported SQL file into RDS.

NOTICEIf the source database contains triggers, storage processes, functions, or event invocation, youmust set log_bin_trust_function_creators to ON for the destination database beforeimporting data.

Relational Database ServiceUser Guide 3 Working with RDS for MySQL

Issue 16 (2018-08-03) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

63

Page 70: User Guide · Relational Database Service User Guide Issue 16 Date 2018-08-03 HUAWEI TECHNOLOGIES CO., LTD

Procedure

Step 1 Import metadata into RDS.

Use the mysql tool to connect to the RDS DB instance, enter the password, and run thefollowing command to import metadata:

# mysql -f -h <RDS_ADDRESS> -P <DB_PORT> -u root -p < <BACKUP_DIR>/dump-defs.sql

l RDS_ADDRESS indicates the IP address of the RDS DB instance.l DB_PORT indicates the RDS DB instance port.l BACKUP_DIR indicates the directory where dump-defs.sql is stored.

Example:

[root@ecs-zyc-0815-2 ~]# mysql -f -h 172.16.66.198 -P 3306 -u root -p < dump-defs.sql

Enter the database password as prompted.

Step 2 Import data into RDS.

# mysql -f -h <RDS_ADDRESS> -P <DB_PORT> -u root -p < <BACKUP_DIR>/dump-data.sql

l RDS_ADDRESS indicates the IP address of the RDS DB instance.l DB_PORT indicates the RDS DB instance port.l BACKUP_DIR indicates the directory where dump-data.sql is stored.

Example:

[root@ecs-zyc-0815-2 ~]# mysql -f -h 172.16.66.198 -P 3306 -u root -p < dump-data.sql

Enter the database password as prompted.

Step 3 View the import result.

mysql> show databases;

In this example, the database named my_db has been imported.

mysql> show databases;+--------------------+| Database |+--------------------+| information_schema || my_db || mysql || performance_schema |+--------------------+4 rows in set (0.00 sec)

----End

3.3 Configuring Database Security

Password Strength RequirementsFor strength requirements for the RDS console database password, see the databaseconfiguration table in Buying an RDS MySQL DB Instance.

Relational Database ServiceUser Guide 3 Working with RDS for MySQL

Issue 16 (2018-08-03) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

64

Page 71: User Guide · Relational Database Service User Guide Issue 16 Date 2018-08-03 HUAWEI TECHNOLOGIES CO., LTD

RDS has a password security policy for newly created database users. Passwords must:l Consist of at least eight characters.l Contain at least one uppercase letter, one lowercase letter, one digit, and one special

character.

When you create DB instances, your password strength is checked. You can modify thepassword strength as user root. For security reasons, you are advised to use a password that isat least as strong as the default one.

Account DescriptionTo provide management services for MySQL DB instances, users rdsAdmin, rdsRepl,rdsBackup, and rdsMetric are created when you create a MySQL DB instance. Attemptingto delete, rename, change passwords for, or change privileges for these accounts will result inan error.

3.4 Modifying Parameters in a Parameter GroupYou can modify parameters in user-created parameter groups.

NOTE

RDS has default parameter groups whose parameter values cannot be changed. You can view them byclicking their names. If a user-created parameter group is set incorrectly and causes a database reboot tofail, you can use a default parameter group to reset the database.

Modifying Parameters in Batches

Step 1 Log in to the management console.

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

You can select a DCC to create a DB instance.

Step 3 Under Database, click Relational Database Service to go to the RDS console.

Step 4 On the Parameter Group Management page, click the target parameter group.

Step 5 Modify the parameters as required.

Relevant parameters are as follows:

l For details on parameter descriptions, visit the MySQL official website. For details onwhich parameters you can modify, see Which Parameters Can I Modify on the RDSConsole (MySQL)?

l The values of the following parameters are determined by the DB instance specificationsand increasing their values may affect database performance: innodb_buffer_pool_size,innodb_log_file_size, innodb_spin_wait_delay, query_alloc_block_size, andthread_stack.

l If key_buffer_size is set to a value smaller than 4096, the parameter modification willfail.If max_seeks_for_key is set to a small value, database operations such as selecting orshowing global variables will be affected.If max_connections is set to a small value, database access will be affected.

Relational Database ServiceUser Guide 3 Working with RDS for MySQL

Issue 16 (2018-08-03) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

65

Page 72: User Guide · Relational Database Service User Guide Issue 16 Date 2018-08-03 HUAWEI TECHNOLOGIES CO., LTD

If max_join_size is set to a small value, the database will become unavailable.If sql_select_limit is set to a small value, database queries may become unavailable.

l The values of parameters prefixed with performance_schema vary according to theperformance_schema value (ON or OFF) and are determined by the MySQL engine.These parameters are left blank before being specified.Default values of the following parameters vary according to DB instance specifications:innodb_buffer_pool_size, innodb_log_buffer_size, innodb_log_files_in_group,max_connections, slave_parallel_workers, and back_log. Their values are defaultbefore being specified.

Available operations are as follows:

NOTICEThe modifications take effect only after you associate the parameter group with target DBinstances. For details, see section Associating a Parameter Group with DB Instances.

l To save the modifications, click Save.l To cancel the modifications, click Cancel.l To preview the modifications, click Preview.

----End

Modifying Parameters of a Specified DB Instance

Step 1 Log in to the management console.

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

You can select a DCC to create a DB instance.

Step 3 Under Database, click Relational Database Service to go to the RDS console.

Step 4 On the Instance Management page, click the target DB instance name.

Step 5 On the Parameters page, modify the parameters as required.

Relevant parameters are as follows:l For details on parameter descriptions, visit the MySQL official website. For details on

which parameters you can modify, see Which Parameters Can I Modify on the RDSConsole (MySQL)?

l The values of the following parameters are determined by the DB instance specificationsand increasing their values may affect database performance: innodb_buffer_pool_size,innodb_log_file_size, innodb_spin_wait_delay, query_alloc_block_size, andthread_stack.

l If key_buffer_size is set to a value smaller than 4096, the parameter modification willfail.If max_seeks_for_key is set to a small value, database operations such as selecting orshowing global variables will be affected.If max_connections is set to a small value, database access will be affected.

Relational Database ServiceUser Guide 3 Working with RDS for MySQL

Issue 16 (2018-08-03) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

66

Page 73: User Guide · Relational Database Service User Guide Issue 16 Date 2018-08-03 HUAWEI TECHNOLOGIES CO., LTD

If max_join_size is set to a small value, the database will become unavailable.If sql_select_limit is set to a small value, database queries may become unavailable.

l The values of parameters prefixed with performance_schema vary according to theperformance_schema value (ON or OFF) and are determined by the MySQL engine.These parameters are left blank before being specified.Default values of the following parameters vary according to DB instance specifications:innodb_buffer_pool_size, innodb_log_buffer_size, innodb_log_files_in_group,max_connections, slave_parallel_workers, and back_log. Their values are defaultbefore being specified.

Available operations are as follows:

NOTICEAfter you modify parameters in a parameter group, the modifications apply to the associatedDB instance immediately.

For details about the parameter group statuses, see Statuses.

After you modify parameters in a parameter group, you need to view the status of the DBinstance associated with the parameter group. If the status is Pending reboot, you mustreboot the DB instance for the modifications to take effect.Rebooting is always required after modifying parameters in a parameter group under thefollowing circumstances:l The modified parameter group is associated with primary/standby DB instances. In this

case, the standby DB instance will also be changed accordingly after the reboot.l The modified parameter group is associated with a read replica.

l To save the modifications, click Save.l To cancel the modifications, click Cancel.l To preview the modifications, click Preview.

----End

3.5 Restoring a MySQL DB Instance to a Point in Time

ScenariosRDS can use existing automated backups to restore DB instances to a point in time.

You can use backup data to create a new DB instance only when your account balance isgreater than or equal to ¥0.

Relational Database ServiceUser Guide 3 Working with RDS for MySQL

Issue 16 (2018-08-03) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

67

Page 74: User Guide · Relational Database Service User Guide Issue 16 Date 2018-08-03 HUAWEI TECHNOLOGIES CO., LTD

NOTICEDo not run the reset master command on MySQL DB instances within their lifecycle.Otherwise, an exception may occur when restoring a MySQL DB instance to a specified pointin time.

Background

If you enable the operation protection function, second authentication is required when youperform sensitive operations to improve the security of your account and cloud product. Fordetails about how to enable operation protection, see the Identity and Access ManagementUser Guide.

Procedure

Step 1 Log in to the management console.

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

You can select a DCC to create a DB instance.

Step 3 Under Database, click Relational Database Service to go to the RDS console.

Step 4 On the Instance Management page, click the target DB instance name.

Step 5 On the Backup & Restore page, click Restore to Point In Time.

Step 6 Select the time range, select or enter a point in time within the acceptable range, and selectone of the following restoration methods and click OK. If you select restoring to the originalDB instance and you have enabled operation security, click Start verification in the Restoreto Point in Time dialog box. On the displayed page, click Send Code, enter the obtainedverification code, and click Verify. The page is closed automatically.l Create New Instance

The Create New Instance page is displayed.– The DB engine, version, and port number of the database are the same as those of

the original DB instance and cannot be changed.– You need to set a new administrator password.– You can modify the other parameter values.

l Restore to Original

NOTICERestoring to the original DB instance will overwrite all existing data and the DB instancewill be temporarily unavailable.

Step 7 View the restoration result. The result depends on which restoration method was selected:l Create New Instance

Relational Database ServiceUser Guide 3 Working with RDS for MySQL

Issue 16 (2018-08-03) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

68

Page 75: User Guide · Relational Database Service User Guide Issue 16 Date 2018-08-03 HUAWEI TECHNOLOGIES CO., LTD

A new DB instance is created using the backup data. The status of the DB instancechanges from Creating to Available.The new DB instance is independent from the original one. If you need read replicas tooffload read pressure, create one or more for the new DB instance.

l Restore to OriginalThe status of the DB instance changes from Restoring to Available.A new restoration time range is available. There will be a difference between the newand original time ranges. This difference reflects the duration of the restoration.

After the restoration, the system will perform a full backup.

----End

3.6 Restoring a DB Instance from a Backup

ScenariosThis section describes how to use an automated or manual backup to restore a DB instance tothe status when the backup was created. You can restore the DB instance to a new or originalDB instance.

You can use backup data to create a new DB instance only when your account balance isgreater than or equal to ¥0.

Procedure

Step 1 Log in to the management console.

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

You can select a DCC to create a DB instance.

Step 3 Under Database, click Relational Database Service to go to the RDS console.

Step 4 On the Backup Management page, locate the target backup and click Restore in theOperation column.

Check whether the DB instance has any backups:

l If so, go to Step 5.l If not, go to Step 6.

Step 5 Select one of the following restoration methods and click OK.l Create New Instance

The Create New Instance page is displayed for you to create a DB instance using thebackup data. The new DB instance is independent from the original one. If you need readreplicas to offload read pressure, create one or more for the new DB instance.– The DB engine and version are identical to those of the original DB instance and

cannot be modified. The database port number is 3306 by default and cannot bemodified either.

– Other settings are the same as those of the original DB instance by default and canbe modified. For details, see Buying an RDS MySQL DB Instance.

Relational Database ServiceUser Guide 3 Working with RDS for MySQL

Issue 16 (2018-08-03) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

69

Page 76: User Guide · Relational Database Service User Guide Issue 16 Date 2018-08-03 HUAWEI TECHNOLOGIES CO., LTD

– After the restoration, the system will perform a full backup.l Restore to Original

NOTICERestoring to the original DB instance will overwrite all existing data and the DB instancewill be temporarily unavailable.

Check that the status of the DB instance on the Instance Management page isRestoring. No further operations are required.

If the automated backup policy is enabled, a full backup will be triggered after the restorationis complete.

Step 6 Create a new DB instance using the backup data.

The Create New Instance page is displayed for you to create a DB instance using the backupdata. The new DB instance is independent from the original one. If you need read replicas tooffload read pressure, create one or more for the new DB instance.

l The DB engine and version are identical to those of the original DB instance and cannotbe modified. The database port number is 3306 by default and cannot be modified either.

l Other settings are the same as those of the original DB instance by default and can bemodified. For details, see Buying an RDS MySQL DB Instance.

After the new instance is created, the system will perform a full backup.

----End

3.7 Viewing Monitoring Metricsl For details on ECS monitoring metrics, see Table 2-1.l For details on database monitoring metrics, see Table 3-1.

Table 3-1 Database performance monitoring metrics list

Metric Description Value Range

TotalConnections

Measures the total number of connectionattempts to the MySQL server.

≥ 0 counts

Current ActiveConnections

Measures the number of current activeconnections.

≥ 0 counts

QPS Measures the rate at which SQL statementqueries (including the stored procedure)are executed.

≥ 0 queries/s

TPS Measures the rate at which transactions(including those submitted and rolledback) are executed.

≥ 0 transactions/s

Relational Database ServiceUser Guide 3 Working with RDS for MySQL

Issue 16 (2018-08-03) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

70

Page 77: User Guide · Relational Database Service User Guide Issue 16 Date 2018-08-03 HUAWEI TECHNOLOGIES CO., LTD

Metric Description Value Range

Buffer PoolUsage

Measures the ratio of dirty data to all datain the InnoDB buffer.

0 to 1

Buffer Pool HitRate

Measures the ratio of read hits to readrequests in the InnoDB buffer.

0 to 1

Buffer Pool DirtyBlock Rate

Measures the ratio of used pages to totaldata in the InnoDB buffer.

0 to 1

InnoDB ReadThroughput

Measures the average rate at which data isread by the InnoDB buffer.

≥ 0 bytes/s

InnoDB WriteThroughput

Measures the average rate at which data iswritten by the InnoDB buffer.

≥ 0 bytes/s

InnoDB FileRead Frequency

Measures the average rate at which theInnoDB reads files.

≥ 0 counts/s

InnoDB FileWrite Frequency

Measures the average rate at whichInnoDB writes data.

≥ 0 counts/s

InnoDB LogWrite RequestFrequency

Measures the average rate at which logwrite requests are received.

≥ 0 counts/s

InnoDB LogPhysical WriteFrequency

Measures the average rate at whichphysical writes occur for log files.

≥ 0 counts/s

InnoDB Logfsync() WriteFrequency

Measures the average rate at which fsync()write requests on log files are received.

≥ 0 counts/s

Temporary TablesQty

Measures the number of temporary tablesautomatically created on hard disks whenMySQL statements are executed.

≥ 0 tables

Key BufferUsage

Measures the MyISAM key buffer usageratio.

0 to 1

Key Buffer WriteHit Rate

Measures MyISAM Key buffer write hitratio of the monitored object.

0 to 1

Key Buffer ReadHit Rate

Measures MyISAM Key buffer read hitratio of the monitored object.

0 to 1

MyISAM DiskWrite Frequency

Measures the rate at which indexes arewritten into disks.

≥ 0 counts/s

MyISAM DiskRead Frequency

Measures the rate at which indexes areread from disks.

≥ 0 counts/s

MyISAM BufferPool WriteFrequency

Measures the rate at which requests onwriting indexes into the MyISAM bufferpool are received.

≥ 0 counts/s

Relational Database ServiceUser Guide 3 Working with RDS for MySQL

Issue 16 (2018-08-03) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

71

Page 78: User Guide · Relational Database Service User Guide Issue 16 Date 2018-08-03 HUAWEI TECHNOLOGIES CO., LTD

Metric Description Value Range

MyISAM BufferPool ReadFrequency

Measures the rate at which requests onreading indexes from the MyISAM bufferpool are received.

≥ 0 counts/s

DeleteOperations perSecond

Measures the average rate at which Deletestatements are executed.

≥ 0 queries/s

Insert Operationsper Second

Measures the average rate at which Insertstatements are executed.

≥ 0 queries/s

Insert_SelectOperations perSecond

Measures the average rate at whichInsert_Select statements are executed.

≥ 0 queries/s

ReplaceOperations perSecond

Measures the average rate at whichReplace statements are executed.

≥ 0 queries/s

Replace_Selection Operations perSecond

Measures the average rate at whichReplace_Selection statements areexecuted.

≥ 0 queries/s

Select Operationsper Second

Measures the average rate at which Selectstatements are executed.

≥ 0 queries/s

UpdateOperations perSecond

Measures the average rate at whichUpdate statements are executed.

≥ 0 queries/s

Row DeleteSpeed

Measures the average rate at which rowsare deleted from the InnoDB table.

≥ 0 rows/s

Row Insert Speed Measures the average number of rows thatare inserted into the InnoDB table persecond.

≥ 0 rows/s

Row Read Speed Measures the average rate at which rowsare read from the InnoDB table.

≥ 0 rows/s

Row UpdateSpeed

Measures the average rate at which rowsare updated in the InnoDB table.

≥ 0 rows/s

3.8 Viewing LogsRDS log management allows you to view database-level logs, including error logs and slowSQL query logs.

3.8.1 Viewing and Downloading Error LogsError logs contain error-level logs generated during the database running. These can help youanalyze problems with the database. You can also download error logs for service analysis.

Relational Database ServiceUser Guide 3 Working with RDS for MySQL

Issue 16 (2018-08-03) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

72

Page 79: User Guide · Relational Database Service User Guide Issue 16 Date 2018-08-03 HUAWEI TECHNOLOGIES CO., LTD

Viewing Log Details

Step 1 Log in to the management console.

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

You can select a DCC to create a DB instance.

Step 3 Under Database, click Relational Database Service to go to the RDS console.

Step 4 On the Instance Management page, click the target DB instance name.

Step 5 On the Error Logs page, click Log Details.

Figure 3-1 Viewing error log details

l You can view error logs generated in different time periods.l If the description of a log is truncated, locate the log and move your pointer over the

description in the Description column to view details.

----End

Download a Log

Step 1 Log in to the management console.

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

You can select a DCC to create a DB instance.

Step 3 Under Database, click Relational Database Service to go to the RDS console.

Step 4 On the Instance Management page, click the target DB instance name.

Step 5 On the Error Logs page, click Download. Locate a log whose status is Preparationcompleted and click Download in the Operation column.

Figure 3-2 Download an error log

Relational Database ServiceUser Guide 3 Working with RDS for MySQL

Issue 16 (2018-08-03) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

73

Page 80: User Guide · Relational Database Service User Guide Issue 16 Date 2018-08-03 HUAWEI TECHNOLOGIES CO., LTD

l The system automatically loads the downloading preparation tasks. The loading durationis determined by the log file size and network environment.– During the downloading preparation, the log status is Preparing.– After the downloading preparation is complete, the log status is Preparation

completed.– If the downloading preparation fails, the log status is Abnormal.Logs in the Preparing or Abnormal status cannot be downloaded.

l If the size of a log to be downloaded is greater than 50 MB, you need to use OBSBrowser to download it.

l The download link is valid for 15 minutes. After the download link expires, a message isdisplayed indicating that the download link has expired. If you need to download the log,click OK.

----End

3.8.2 Viewing and Downloading Slow Query Logs

ScenariosSlow query logs record statements that exceed long_query_time (10 seconds by default). Youcan view log details and statistics to identify statements that are executing slowly andoptimize the statements. You can also download slow query logs for service analysis.

RDS supports the following statement types:l ALLl SELECTl INSERTl UPDATEl DELETEl CREATE

Viewing Log Details

Step 1 Log in to the management console.

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

You can select a DCC to create a DB instance.

Step 3 Under Database, click Relational Database Service to go to the RDS console.

Step 4 On the Instance Management page, click the target DB instance name.

Step 5 On the Slow Query Logs page, click Log Details.

Relational Database ServiceUser Guide 3 Working with RDS for MySQL

Issue 16 (2018-08-03) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

74

Page 81: User Guide · Relational Database Service User Guide Issue 16 Date 2018-08-03 HUAWEI TECHNOLOGIES CO., LTD

Figure 3-3 Viewing slow query log details

l You can view slow query logs generated in different time periods.

l If the description of a log is truncated, locate the log and move your pointer over thedescription in the Description column to view details.

----End

Viewing Statistics

Step 1 Log in to the management console.

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

You can select a DCC to create a DB instance.

Step 3 Under Database, click Relational Database Service to go to the RDS console.

Step 4 On the Instance Management page, click the target DB instance name.

Step 5 On the Slow Query Logs page, click Statistics.

Figure 3-4 Viewing statistics analysis

NOTE

For SQL statements of the same type, the Statistics page displays only one of the SQL statements as anexample. For example, if two select sleep(N) statements, select sleep(11) and select sleep(12), areexecuted in sequence, only select sleep(11) will be displayed.

----End

Relational Database ServiceUser Guide 3 Working with RDS for MySQL

Issue 16 (2018-08-03) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

75

Page 82: User Guide · Relational Database Service User Guide Issue 16 Date 2018-08-03 HUAWEI TECHNOLOGIES CO., LTD

Downloading a Log

Step 1 Log in to the management console.

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

You can select a DCC to create a DB instance.

Step 3 Under Database, click Relational Database Service to go to the RDS console.

Step 4 On the Instance Management page, click the target DB instance name.

Step 5 On the Slow Query Logs page, click Download. Locate a log whose status is Preparationcompleted and click Download in the Operation column.

Figure 3-5 Downloading a slow query log

l The system automatically loads the downloading preparation tasks. The loading durationis determined by the log file size and network environment.– During the downloading preparation, the log status is Preparing.– After the downloading preparation is complete, the log status is Preparation

completed.– If the downloading preparation fails, the log status is Abnormal.Logs in the Preparing or Abnormal status cannot be downloaded.

l If the size of a log to be downloaded is greater than 50 MB, you need to use OBSBrowser to download it.

l The download link is valid for 15 minutes. After the download link expires, a message isdisplayed indicating that the download link has expired. If you need to download the log,click OK.

----End

Relational Database ServiceUser Guide 3 Working with RDS for MySQL

Issue 16 (2018-08-03) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

76

Page 83: User Guide · Relational Database Service User Guide Issue 16 Date 2018-08-03 HUAWEI TECHNOLOGIES CO., LTD

4 Working with RDS for PostgreSQL

4.1 Migrating PostgreSQL Data Using psqlPostgreSQL supports logical backups. You can use the pg_dump logical backup function toexport backup files and then import them to RDS using psql.

4.1.1 Preparing for Data MigrationYou can access RDS through an EIP or ECS.

Preparations1. Prepare an ECS for accessing DB instances in the same VPC subnet or prepare a device

for accessing RDS through a public network.

– To connect to a DB instance through an ECS, you must first create an ECS.

For details about how to create and connect to an ECS, see How Can I Create andConnect to an ECS?

– To connect to a DB instance through an EIP, you must:

i. Bind the EIP to the DB instance. For details, see Binding an EIP.

ii. Ensure that the local device can access the EIP that has been bound to the DBinstance.

2. Install the PostgreSQL client on the ECS or device that was prepared in 1.

For details, see How Can I Install the PostgreSQL Client?

NOTE

The PostgreSQL client version must be the same as the version of RDS for PostgreSQL. ThePostgreSQL database or client will provide pg_dump and psql.

4.1.2 Exporting DataBefore migrating an existing PostgreSQL database to RDS, you need to export thePostgreSQL database.

Relational Database ServiceUser Guide 4 Working with RDS for PostgreSQL

Issue 16 (2018-08-03) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

77

Page 84: User Guide · Relational Database Service User Guide Issue 16 Date 2018-08-03 HUAWEI TECHNOLOGIES CO., LTD

NOTICEl The export tool must match the DB engine version.l Database migration is performed offline. Before the migration, you must stop any

applications using the source database.

Procedure

Step 1 Log in to the ECS or device that can access RDS prepared in 1 in section Preparing for DataMigration.

Step 2 Use the pg_dump tool to export the source database into an SQL file.

pg_dump --username=<DB_USER> --host=<DB_ADDRESS> --port=<DB_PORT> --format=plain --file=<BACKUP_FILE> <DB_NAME>

l DB_USER indicates the database username.l DB_ADDRESS indicates the database address.l DB_PORT indicates the database port.l BACKUP_FILE indicates the name of the file to which the data will be exported.l DB_NAME indicates the name of the database to be migrated.

Enter the password for the RDS DB instance as prompted.

Example:

[rds@localhost ~]$ pg_dump --username=root --host=192.168.151.18 --port=5432 --format=plain --file=backup.sql my_db

Enter the password of user root as prompted.

After this command is executed, a backup.sql file will be generated as follows:

[rds@localhost ~]$ ll backup.sql

-rw-r-----. 1 rds rds 2714 Sep 21 08:23 backup.sql

----End

4.1.3 Importing DataThis section describes how to use an ECS or a device that can access RDS to connect to a DBinstance and import the exported SQL file into RDS.

Procedure

Step 1 Ensure that the destination database to which data is to be imported exists.

If the destination database does not exist, run the following command to create a database:

# psql --host=<RDS_ADDRESS> --port=<DB_PORT> --username=root --dbname=postgres -c "create database <DB_NAME>;"l RDS_ADDRESS indicates the IP address of the RDS DB instance.

Relational Database ServiceUser Guide 4 Working with RDS for PostgreSQL

Issue 16 (2018-08-03) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

78

Page 85: User Guide · Relational Database Service User Guide Issue 16 Date 2018-08-03 HUAWEI TECHNOLOGIES CO., LTD

l DB_PORT indicates the RDS DB instance port.l DB_NAME indicates the name of the database to be imported.

Step 2 Import the exported file into RDS.

# psql --host=<RDS_ADDRESS> --port=<DB_PORT> --username=root --dbname=<DB_NAME> --file=<BACKUP_DIR>/backup.sql

l RDS_ADDRESS indicates the IP address of the RDS DB instance.l DB_PORT indicates the RDS DB instance port.l DB_NAME indicates the name of the database to which data is to be imported. Ensure

that the database exists.l BACKUP_DIR indicates the directory where the backup.sql file is stored.

Enter the password for the RDS DB instance as prompted.

Example:

[root@ecs-zyc-0815-2 ~]# psql --host=172.16.66.198 --port=5432 --username=root --dbname=my_db --file=backup.sql

Enter the password of user root as prompted.

Step 3 View the import result.

my_db=> \l my_db

In this example, the database named my_db has been imported.

my_db=> \l my_dbList of databasesName | Owner | Encoding | Collate | Ctype | Access privileges------+-------+----------+-------------+-------------+-----------my_db | root | UTF8 | en_US.UTF-8 | en_US.UTF-8 | (1 row)

----End

4.2 Configuring Database Security

Password Strength Requirementsl For strength requirements for the RDS console database password, see the database

configuration table in Buying an RDS PostgreSQL DB Instance.

l RDS has a password security policy for newly created database users. Passwords must:– Consist of at least eight characters.– Contain letters, digits, and special characters.– Not contain the username.

Strengthening Security During User Creation

When you run CREATE USER or CREATE ROLE, you are advised to specify a passwordexpiration time with the VALID UNTIL 'timestamp' parameter (timestamp indicates theexpiration time).

Relational Database ServiceUser Guide 4 Working with RDS for PostgreSQL

Issue 16 (2018-08-03) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

79

Page 86: User Guide · Relational Database Service User Guide Issue 16 Date 2018-08-03 HUAWEI TECHNOLOGIES CO., LTD

Account Description

To provide management services for PostgreSQL DB instances, users rdsAdmin, rdsRepl,rdsBackup, and rdsMetric are created when you create a MySQL DB instance. Attemptingto delete, rename, change passwords for, or change privileges for these accounts will result inan error.

4.3 Modifying Parameters in a Parameter GroupThis section describes how to modify parameters in user-created parameter groups.

NOTE

RDS includes default parameter groups that cannot be modified. You can view them by clicking theirnames. If a user-created parameter group is set incorrectly and causes a database reboot to fail, you canuse a default parameter group to reset the database.

Modifying Parameters in Batches

Step 1 Log in to the management console.

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

You can select a DCC to create a DB instance.

Step 3 Under Database, click Relational Database Service to go to the RDS console.

Step 4 On the Parameter Group Management page, click the target parameter group.

Step 5 Modify the parameters as required.

Relevant parameters are as follows:

l For details on parameter descriptions, visit the PostgreSQL official website. For detailson which parameters you can modify, see Which Parameters Can I Modify on theRDS Console (PostgreSQL)?

l If log_statement is set to ddl, mod, or all, the operations for creating and deletingdatabase users (including passwords and other sensitive information) are recorded. Thisoperation affects database performance. Exercise caution when setting this parameter.

l search_path must be set to a schema sequence where schemas are separated by commas(,). Ensure that the schemas exist. Otherwise, the database performance will be affected.

l Enabling the following parameters will affect the database performance: log_hostname,log_duration, log_connections, and log_disconnections. Exercise caution whenenabling these parameters.

l If you enable the parameter log_duration, SQL statements containing sensitiveinformation may be recorded in logs. You are advised to disable this parameter.

l If the parameter log_min_duration_statement is set to 0, SQL statements containingsensitive information will be recorded in logs. You are advised to disable this parameterby setting it to -1.

Available operations are as follows:

Relational Database ServiceUser Guide 4 Working with RDS for PostgreSQL

Issue 16 (2018-08-03) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

80

Page 87: User Guide · Relational Database Service User Guide Issue 16 Date 2018-08-03 HUAWEI TECHNOLOGIES CO., LTD

NOTICEThe modifications take effect only after you associate the parameter group with target DBinstances. For details, see section Associating a Parameter Group with DB Instances.

l To save the modifications, click Save.l To cancel the modifications, click Cancel.l To preview the modifications, click Preview.

----End

Modifying Parameters of a Specified DB Instance

Step 1 Log in to the management console.

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

You can select a DCC to create a DB instance.

Step 3 Under Database, click Relational Database Service to go to the RDS console.

Step 4 On the Instance Management page, click the target DB instance name.

Step 5 On the Parameters page, modify the parameters as required.

Relevant parameters are as follows:l For details on parameter descriptions, visit the PostgreSQL official website. For details

on which parameters you can modify, see Which Parameters Can I Modify on theRDS Console (PostgreSQL)?

l If log_statement is set to ddl, mod, or all, the operations for creating and deletingdatabase users (including passwords and other sensitive information) are recorded. Thisoperation affects database performance. Exercise caution when setting this parameter.

l search_path must be set to a schema sequence where schemas are separated by commas(,). Ensure that the schemas exist. Otherwise, the database performance will be affected.

l Enabling the following parameters will affect the database performance: log_hostname,log_duration, log_connections, and log_disconnections. Exercise caution whenenabling these parameters.

l If you enable the parameter log_duration, SQL statements containing sensitiveinformation may be recorded in logs. You are advised to disable this parameter.

l If the parameter log_min_duration_statement is set to 0, SQL statements containingsensitive information will be recorded in logs. You are advised to disable this parameterby setting it to -1.

Available operations are as follows:

Relational Database ServiceUser Guide 4 Working with RDS for PostgreSQL

Issue 16 (2018-08-03) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

81

Page 88: User Guide · Relational Database Service User Guide Issue 16 Date 2018-08-03 HUAWEI TECHNOLOGIES CO., LTD

NOTICEAfter you modify parameters in a parameter group, the modifications apply to the associatedDB instance immediately.For details about the parameter group statuses, see Statuses.After you modify parameters in a parameter group, you need to view the status of the DBinstance associated with the parameter group. If the status is Pending reboot, you mustreboot the DB instance for the modifications to take effect.Rebooting is always required after modifying parameters in a parameter group under thefollowing circumstances:l The modified parameter group is associated with primary/standby DB instances. In this

case, the standby DB instance will also be changed accordingly after the reboot.l The modified parameter group is associated with a read replica.

l To save the modifications, click Save.l To cancel the modifications, click Cancel.l To preview the modifications, click Preview.

----End

4.4 Restoring a PostgreSQL DB Instance to a Point in Time

Scenarios

This section describes how to use existing automated backups to restore DB instances to apoint in time.

You can use backup data to create a new DB instance only when your account balance isgreater than or equal to ¥0.

Background

If you enable the operation protection function, second authentication is required when youperform sensitive operations to improve the security of your account and cloud product. Fordetails about how to enable operation protection, see the Identity and Access ManagementUser Guide.

Procedure

Step 1 Log in to the management console.

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

You can select a DCC to create a DB instance.

Step 3 Under Database, click Relational Database Service to go to the RDS console.

Step 4 On the Instance Management page, click the target DB instance name.

Relational Database ServiceUser Guide 4 Working with RDS for PostgreSQL

Issue 16 (2018-08-03) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

82

Page 89: User Guide · Relational Database Service User Guide Issue 16 Date 2018-08-03 HUAWEI TECHNOLOGIES CO., LTD

Step 5 On the Backup & Restore page, click Restore to Point In Time.

Step 6 Select the time range, select or enter a point in time within the acceptable range, and selectone of the following restoration methods and click OK. If you select restoring to the originalDB instance and you have enabled operation security, click Start verification in the Restoreto Point in Time dialog box. On the displayed page, click Send Code, enter the obtainedverification code, and click Verify. The page is closed automatically.

l Create New Instance

The Create New Instance page is displayed.

– The DB engine, version, and port number of the database are the same as those ofthe original DB instance and cannot be changed.

– You need to set a new administrator password.

– You can modify the other parameter values.

l Restore to Original

NOTICERestoring to the original DB instance will overwrite all existing data and the DB instancewill be temporarily unavailable.

Step 7 View the restoration result. The result depends on which restoration method was selected:

l Create New Instance

A new DB instance is created using the backup data. The status of the DB instancechanges from Creating to Available.

The new DB instance is independent from the original one. If you need read replicas tooffload read pressure, create one or more for the new DB instance.

l Restore to Original

The status of the DB instance changes from Restoring to Available.

A new restoration time range is available. There will be a difference between the newand original time ranges. This difference reflects the duration of the restoration.

After the restoration, the system will perform a full backup.

----End

4.5 Restoring a DB Instance from a Backup

Scenarios

This section describes how to use an automated or manual backup to restore a DB instance tothe status when the backup was created.

You can use backup data to create a new DB instance only when your account balance isgreater than or equal to ¥0.

Relational Database ServiceUser Guide 4 Working with RDS for PostgreSQL

Issue 16 (2018-08-03) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

83

Page 90: User Guide · Relational Database Service User Guide Issue 16 Date 2018-08-03 HUAWEI TECHNOLOGIES CO., LTD

Procedure

Step 1 Log in to the management console.

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

You can select a DCC to create a DB instance.

Step 3 Under Database, click Relational Database Service to go to the RDS console.

Step 4 On the Instance Management page, click the target DB instance name.

Step 5 On the Backup & Restore page, locate the target backup file and click Restore in theOperation column.

Check whether the DB instance has any backups:

l If so, go to Step 6.l If not, go to Step 7.

Step 6 Select one of the following restoration methods and click OK.l Create New Instance

The Create New Instance page is displayed for you to create a DB instance using thebackup data. The new DB instance is independent from the original one. If you need readreplicas to offload read pressure, create one or more for the new DB instance.– The DB engine and version are identical to those of the original DB instance and

cannot be modified. The database port number is 5432 by default and cannot bemodified either.

– Other settings are the same as those of the original DB instance by default and canbe modified. For details, see Buying an RDS PostgreSQL DB Instance.

– After the new instance is created, the system will perform a full backup.l Restore to Original

NOTICERestoring to the original DB instance will overwrite all existing data and the DB instancewill be temporarily unavailable.

Check that the status of the DB instance on the Instance Management page isRestoring. No further operations are required.If the automated backup policy is enabled, a full backup will be triggered after therestoration is complete.

Step 7 Create a new DB instance using the backup data.

The Create New Instance page is displayed. Create a DB instance using the backup data. Thenew DB instance is independent from the original one. If you need read replicas to offloadread pressure, create one or more for the new DB instance.

l The DB engine and version are identical to those of the original DB instance and cannotbe modified. The database port number is 5432 by default and cannot be modified either.

Relational Database ServiceUser Guide 4 Working with RDS for PostgreSQL

Issue 16 (2018-08-03) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

84

Page 91: User Guide · Relational Database Service User Guide Issue 16 Date 2018-08-03 HUAWEI TECHNOLOGIES CO., LTD

l Other settings are the same as those of the original DB instance by default and can bemodified. For details, see Buying an RDS PostgreSQL DB Instance.

After the new instance is created, the system will perform a full backup.

----End

4.6 Viewing Monitoring Metricsl For details on ECS monitoring metrics, see Table 2-1.l For details on database monitoring metrics, see Table 4-1.

Table 4-1 Database performance metrics list

Metric Description Value Range

Transaction Logs Usage Measures the disk capacity used bytransaction logs.

≥ 0 MB

Replication Slot Usage Measures the disk capacity used byreplication slot files.

≥ 0 MB

Database Connections Measures the number of databaseconnections in use.

≥ 0 counts

Maximum UsedTransaction IDs

Measures the maximum number oftransaction IDs that have been used.

≥ 0 counts

Transaction LogsGeneration

Measures the size of transaction logsgenerated per second.

≥ 0 MB/s

Oldest Replication SlotLag

Measures the replica with the most lagin terms of WAL (write-ahead log)data received.

≥ 0 MB

Replication Lag Measures replication lag. ≥ 0 ms

4.7 Viewing and Downloading Error Logs

Scenarios

Error logs contain error-level logs generated during the database running. These can help youanalyze problems with the database. You can also download error logs for service analysis.

Viewing Log Details

Step 1 Log in to the management console.

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

You can select a DCC to create a DB instance.

Relational Database ServiceUser Guide 4 Working with RDS for PostgreSQL

Issue 16 (2018-08-03) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

85

Page 92: User Guide · Relational Database Service User Guide Issue 16 Date 2018-08-03 HUAWEI TECHNOLOGIES CO., LTD

Step 3 Under Database, click Relational Database Service to go to the RDS console.

Step 4 On the Instance Management page, click the target DB instance name.

Step 5 On the Error Logs page, click Log Details.l You can view error logs generated in different time periods.l If the description of a log is truncated, locate the log and move your pointer over the

description in the Description column to view details.

----End

Download a Log

Step 1 Log in to the management console.

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

You can select a DCC to create a DB instance.

Step 3 Under Database, click Relational Database Service to go to the RDS console.

Step 4 On the Instance Management page, click the target DB instance name.

Step 5 On the Error Logs page, click Download. Locate a log whose status is Preparationcompleted and click Download in the Operation column.l The system automatically loads the downloading preparation tasks. The loading duration

is determined by the log file size and network environment.– During the downloading preparation, the log status is Preparing.– After the downloading preparation is complete, the log status is Preparation

completed.– If the downloading preparation fails, the log status is Abnormal.Logs in the Preparing or Abnormal status cannot be downloaded.

l If the size of a log to be downloaded is greater than 50 MB, you need to use OBSBrowser to download it.

l The download link is valid for 15 minutes. After the download link expires, a message isdisplayed indicating that the download link has expired. If you need to download the log,click OK.

----End

4.8 Managing a PluginRDS provides the PostgreSQL plugin management solution for user root. The auto_explain isautomatically created by the system and other plugins need to be manually created.

Creating a Plugin

Step 1 Connect to the database postgres as user root and use template1 to create a database that cansupport the plugin.

# psql --host=<RDS_ADDRESS> --port=<DB_PORT> --dbname=postgres --username=root -c 'create database <DB_NAME> template template1;'

Relational Database ServiceUser Guide 4 Working with RDS for PostgreSQL

Issue 16 (2018-08-03) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

86

Page 93: User Guide · Relational Database Service User Guide Issue 16 Date 2018-08-03 HUAWEI TECHNOLOGIES CO., LTD

l RDS_ADDRESS indicates the IP address of the RDS DB instance.l DB_PORT indicates the RDS DB instance port.l DB_NAME indicates the name of the database to be created.

Enter the password of user root as prompted.

Create a database named my_extension_db that can support the plugin. Example:

[Ruby@host-172-16-0-49 ~]# psql --host=192.168.6.141 --port=5432 --dbname=postgres--username=root -c 'create database my_extension_db template template1;'

Password for user root:CREATE DATABASE

Note: If you are creating a database as a common user, log in to the created database as thecommon user and run the following command to grant all rights to user root:

GRANT ALL ON DATABASE db1 TO root;

Step 2 Connect to the created database as user root and create a plugin.

# psql --host=<RDS_ADDRESS> --port=<DB_PORT> --dbname=<DB_NAME> --username=root -c "select control_extension('create','<EXTENSION_NAME>');"

l RDS_ADDRESS indicates the IP address of the RDS DB instance.l DB_PORT indicates the RDS DB instance port.l DB_NAME indicates the name of the database to be created.l EXTENSION_NAME indicates the plugin name and has the following possible values:

– postgis. When postgis is created, the following plugins are created at the same time:postgispostgis_topologyfuzzystrmatchpostgis_tiger_geocoderaddress_standardizeraddress_standardizer_data_us

– auto_explain– btree_gin– btree_gist– hstore– pg_trgm– tablefunc– unaccent– uuid-ossp– cube– dict_int– dict_xsyn– earthdistance. To install this plugin, you must install the cube plugin first.– intagg

Relational Database ServiceUser Guide 4 Working with RDS for PostgreSQL

Issue 16 (2018-08-03) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

87

Page 94: User Guide · Relational Database Service User Guide Issue 16 Date 2018-08-03 HUAWEI TECHNOLOGIES CO., LTD

– intarray– ltree– pgcrypto– timescaledb, which does not support PostgreSQL 9.5.5– hll– hyperlog– zhparser, which provides the default dictionary only and does not support user-

defined dictionaries. The default values are as follows:zhparser.punctuation_ignore = offzhparser.punctuation_ignore = offzhparser.multi_short = offzhparser.multi_duality = offzhparser.multi_zmain = offzhparser.multi_zall = offzhparser.dict_in_memory = off

– oracle_fdw: which supports PostgreSQL 10.3 only to connect to Oracle Database12c or earlier versions

– pg_pathman– pg_stat_statements– pg_hint_plan

Enter the password of user root as prompted.

Create a plugin postgis in the database my_extension_db. Example:

[Ruby@host-172-16-0-49 ~]# psql --host=192.168.6.141 --port=5432 --dbname=my_extension_db --username=root -c "selectcontrol_extension('create','postgis');"

Password for user root: control_extension ------------------------------ create postgis successfully.(1 row)

----End

Deleting a Plugin

Connect to the database with a plugin created as user root and delete the plugin.

# psql --host=<RDS_ADDRESS> --port=<DB_PORT> --username=root --dbname=<DB_NAME> -c "select control_extension ('drop','<EXTENSION_NAME>');"

l RDS_ADDRESS indicates the IP address of the RDS DB instance.l DB_PORT indicates the RDS DB instance port.l DB_NAME indicates the name of the database to be created.l EXTENSION_NAME indicates the plugin name and has the following values:

– postgis

Relational Database ServiceUser Guide 4 Working with RDS for PostgreSQL

Issue 16 (2018-08-03) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

88

Page 95: User Guide · Relational Database Service User Guide Issue 16 Date 2018-08-03 HUAWEI TECHNOLOGIES CO., LTD

– btree_gin

– btree_gist

– hstore

– pg_trgm

– tablefunc

– unaccent

– uuid-ossp

– cube

– dict_int

– dict_xsyn

– earthdistance

NOTICETo install the earthdistance plugin, you must install the cube plugin first.

– intagg

– intarray

– ltree

– pgcrypto

– timescaledb

NOTICEThe timescaledb plugin does not support PostgreSQL 9.5.5.

– hll

– zhparser

Enter the password of user root as prompted.

Example:

[Ruby@host-172-16-0-49 ~]# psql --host=192.168.6.141 --port=5432 --dbname=my_extension_db --username=root -c "selectcontrol_extension('drop','postgis');"

Password for user root: control_extension ---------------------------- drop postgis successfully.(1 row)

Relational Database ServiceUser Guide 4 Working with RDS for PostgreSQL

Issue 16 (2018-08-03) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

89

Page 96: User Guide · Relational Database Service User Guide Issue 16 Date 2018-08-03 HUAWEI TECHNOLOGIES CO., LTD

4.9 Managing Tablespaces

Scenarios

RDS provides the PostgresQL tablespace management solution for user root.

Creating a Tablespace

Step 1 Connect to the database as user root and create a tablespace.

# psql --host=<RDS_ADDRESS> --port=<DB_PORT> --dbname=<DB_NAME> --username=root -c "select control_tablespace ('create', '<TABLESPACE_NAME>');"

l RDS_ADDRESS indicates the IP address of the RDS DB instance.l DB_PORT indicates the RDS DB instance port.l DB_NAME indicates the database name.l TABLESPACE_NAME indicates the tablespace name.

Enter the password of user root as prompted.

Log in to the my_db database and create the tbspc1 tablespace. Example:

[Ruby@host-172-16-0-49 ~]# psql --host=192.168.6.141 --port=5432 --dbname=my_db --username=root -c "select control_tablespace('create', 'tbspc1');"

Password for user root: control_tablespace ------------------------------ create tablespace tbspc1 successfully. (1 row)

If the creation fails, view error logs of the DB instance.

NOTE

To ensure performance, a maximum of 20 tablespaces can be created.

----End

Deleting a Tablespace

Connect to the database as user root and delete a tablespace.

# psql --host=<RDS_ADDRESS> --port=<DB_PORT> --username=root --dbname=<DB_NAME> -c "select control_tablespace('drop', '<TABLESPACE _NAME>');"

l RDS_ADDRESS indicates the IP address of the RDS DB instance.l DB_PORT indicates the RDS DB instance port.l DB_NAME indicates the database name.l TABLESPACE_NAME indicates the tablespace name.

Enter the password of user root as prompted.

Example:

Relational Database ServiceUser Guide 4 Working with RDS for PostgreSQL

Issue 16 (2018-08-03) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

90

Page 97: User Guide · Relational Database Service User Guide Issue 16 Date 2018-08-03 HUAWEI TECHNOLOGIES CO., LTD

[Ruby@host-172-16-0-49 ~]# psql --host=192.168.6.141 --port=8635 --dbname=my_db --username=root -c "select control_tablespace('drop', 'tbspc1');"

Password for user root: control_tablespace ---------------------------- drop tablespace tbspc1 successfully. (1 row)

Before deleting the tablespace, ensure that it is empty. If the deletion fails, view error logs ofthe DB instance.

Relational Database ServiceUser Guide 4 Working with RDS for PostgreSQL

Issue 16 (2018-08-03) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

91

Page 98: User Guide · Relational Database Service User Guide Issue 16 Date 2018-08-03 HUAWEI TECHNOLOGIES CO., LTD

5 Working with RDS for SQL Server

5.1 Migrating SQL Server Data Using DRSYou can use DRS to migrate on-premises databases to RDS for SQL Server with nodowntime.

SQL Server supports both online and offline migration.

l For details about online migration, see Online Migration in the Data ReplicationService User Guide.

l For details, see Offline Migration in the Data Replication Service User Guide.

5.2 Migrating SQL Server Data Using SQL ServerManagement Studio

5.2.1 Preparing for Data MigrationYou can access RDS through an EIP or ECS.

Preparations1. Prepare an ECS for accessing DB instances in the same VPC subnet or prepare a device

for accessing RDS through a public network.– To connect to a DB instance through an ECS, you must first create an ECS.

For details about how to create and connect to an ECS, see How Can I Create andConnect to an ECS?

– To connect to a DB instance through an EIP, you must:

i. Bind the EIP to the DB instance. For details, see Binding an EIP.ii. Ensure that the local device can access the EIP that has been bound to the DB

instance.2. Install the Microsoft SQL Server client on the ECS or device that was prepared in 1.

For details, see How Can I Install SQL Server Management Studio?

Relational Database ServiceUser Guide 5 Working with RDS for SQL Server

Issue 16 (2018-08-03) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

92

Page 99: User Guide · Relational Database Service User Guide Issue 16 Date 2018-08-03 HUAWEI TECHNOLOGIES CO., LTD

NOTE

The SQL Server Management Studio version must be equal to or later than the SQL Server DBengine version.

5.2.2 Exporting DataBefore migrating an existing SQL Server database to RDS, you need to export the SQLServer database.

NOTICEl The export tool must match the DB engine version.l Database migration is performed offline. Before the migration, you must stop any

applications using the source database.

Procedure

Step 1 Log in to the ECS or device that can access RDS prepared in 1 in section Preparing for DataMigration.

Step 2 Use SQL Server Management Studio to generate database object scripts such as tables andviews.

1. Use SQL Server Management Studio to connect to the Microsoft SQL Server database.2. On Object Explorer, expand Databases, right-click the database to be exported, and

choose Tasks > Generate Scripts. The Generate and Publish Scripts window isdisplayed.

3. Choose Choose Objects in the navigation pane on the left, select database objects to beexported, and click Next.

4. Choose Set Scripting Options in the navigation pane on the left, click Save script to aspecific location, and select a path for storing exported files from the File name drop-down list, and click Next.

NOTE

– If you select Single file, all objects will be stored in the same file.

– If you select Single file per object, each object will be stored in its own file.

5. Click Next.6. Click Finish.7. Use SQL Server Management Studio to open the exported SQL file or SQL files.8. Change USE [DATABASE] in the first line to USE [RDS database name] and save the

change.

NOTE

For details on generating scripts, see Generate and Publish Scripts Wizard.

Step 3 Use bcp to export data from the source database to a .txt file.

bcp dbname.schema_name.table_name out C:\test\table_name.txt -n -S localhost -Uusername -b 2000

Relational Database ServiceUser Guide 5 Working with RDS for SQL Server

Issue 16 (2018-08-03) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

93

Page 100: User Guide · Relational Database Service User Guide Issue 16 Date 2018-08-03 HUAWEI TECHNOLOGIES CO., LTD

l -n indicates that the native (database) data types are used for performing bulk-copyoperations.

l -S indicates the address to be used by the bcp tool to connect to the Microsoft SQLServer DB instance.

l -U indicates the database username.l -b indicates the lines of data imported in a batch.

Enter the database password as prompted.

Example:

C:\test>bcp test.dbo.t1 out c:\test\t1.txt -n -S localhost -U rdsuser -b 2000

Enter the database password as prompted.

After this command is executed, a t1.txt file will be generated as follows:

C:\test>$ dir t1.txt2017/03/27 11:51 22 t1.txt

Repeat the preceding steps to export data from the other tables in the database.

----End

5.2.3 Importing DataThis section describes how to use an ECS or a device that can access RDS to connect to a DBinstance and import the exported SQL file into RDS.

NOTICEIf the source database contains the full-text index, you need to create one on RDS.

Procedure

Step 1 Use sqlcmd to import the database objects.

The SQL Server database or client provides sqlcmd.

>sqlcmd -S "server" -d database -U login_id -i inputfile

l -S indicates the IP address and port of the RDS DB instance.l -d indicates the name of the database to be imported.l -U indicates the username used to log in to the database.l -i indicates the SQL file to be executed.

Enter the database password as prompted.

Example:

>sqlcmd -S "10.65.60.79,8636" -d test -U rdsuser -i C:\test\objects.sql

Enter the database password as prompted.

Relational Database ServiceUser Guide 5 Working with RDS for SQL Server

Issue 16 (2018-08-03) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

94

Page 101: User Guide · Relational Database Service User Guide Issue 16 Date 2018-08-03 HUAWEI TECHNOLOGIES CO., LTD

Step 2 Use bcp to import data.

>bcp dbname.schema_name.table_name in C:\test\table_name.txt -n -S Server -U username -b 2000

l -in indicates the directory which the data is imported to.l -n indicates that the native (database) data types are used for performing bulk-copy

operations.l -S indicates the address to be used by the bcp tool to connect to the Microsoft SQL

Server DB instance.l -U indicates the database username.l -b indicates the lines of data imported in a batch.

Example:

C:\test>bcp test.dbo.t1 in c:\test\t1.txt -n -S "10.65.60.79,8636" -U rdsuser -b 2000

Enter the database password as prompted.

----End

5.3 Configuring Database Security

Password Strength Requirements

NOTICESQL Server supports disabling of the database password complexity check. However, toensure database security, you are advised not to disable it.

l For strength requirements for the RDS console database password, see the databaseconfiguration table in Buying an RDS Microsoft SQL Server DB Instance.

l RDS has a password security policy for database users. You are advised to enable thispolicy. Passwords must:– Consist of 8 to 128 characters.– Contain at least three types of the following: uppercase letters, lowercase letters,

digits, and special characters.– Not contain the username.

When you create DB instances, your password strength is checked. You can modify thepassword strength as user rdsuser. For security reasons, you are advised to use a passwordthat is at least as strong as the default one.

Account Description

To provide management services for Microsoft SQL Server DB instances, system usersrdsAdmin, rdsRepl, rdsBackup, and mike are created when you create a SQL Server DBinstance.

Relational Database ServiceUser Guide 5 Working with RDS for SQL Server

Issue 16 (2018-08-03) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

95

Page 102: User Guide · Relational Database Service User Guide Issue 16 Date 2018-08-03 HUAWEI TECHNOLOGIES CO., LTD

To store objects for managing databases, SQL Server DB instance will automatically create adatabase named rdsAdmin.

Attempting to delete, rename, change passwords for, or change privileges for these accountswill result in an error.

5.4 Changing a User-Created Database Name

Scenarios

This section describes how to change a user-created database name.

NOTE

Currently, you cannot change the names of user-created Microsoft SQL Server databases running thefollowing versions:

l 2008 R2 WEB

l 2008 R2 SE

l 2008 R2 EE

Prerequisitesl An RDS Microsoft SQL Server DB instance has been connected. For details about how

to connect to a DB instance, see Connecting to a DB Instance.l For primary/standby DB instances, you need to remove database mirroring between

them. After the primary database name is changed, the system will automaticallyestablish mirroring relationship.If you do not remove database mirroring for primary/standby DB instances and attemptto change the primary database name, the system displays the following information:Database database name is on mirroring_state.

l System database names cannot be changed. If you attempt to change the name of asystem database, the system displays the following information:Error DBName_Source or DBName_Target. Please can not include in ('msdb','master','model','tempdb','rdsadmin','resource') .

l The new database name must be unique. If the new database name already exists, thesystem displays the following information:Database database name already exists. Cannot rename database with the same name.

Procedure

Run the following command to change a user-created database name:

exec msdb.dbo.rds_rename_database N'oldname',N'newname';

l oldname indicates the original database name.l newname indicates the new database name.

For example, to change a database name from ABC to XYZ, run the following command:

exec msdb.dbo.rds_rename_database N'ABC',N'XYZ';

If the database name is changed, the system displays the following information:The database name 'XYZ' has been set.

Relational Database ServiceUser Guide 5 Working with RDS for SQL Server

Issue 16 (2018-08-03) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

96

Page 103: User Guide · Relational Database Service User Guide Issue 16 Date 2018-08-03 HUAWEI TECHNOLOGIES CO., LTD

After the database name is changed, the system will automatically perform a full backup.

5.5 Modifying Parameters in a Parameter GroupThis section describes how to modify parameters in user-created parameter groups.

NOTE

RDS includes default parameter groups that cannot be modified. You can view them by clicking theirnames. If a user-created parameter group is set incorrectly and causes a database reboot to fail, you canuse a default parameter group to reset the database.

Modifying Parameters in Batches

Step 1 Log in to the management console.

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

You can select a DCC to create a DB instance.

Step 3 Under Database, click Relational Database Service to go to the RDS console.

Step 4 On the Parameter Group Management page, click the target parameter group.

Step 5 Modify the parameters as required.

Relevant parameters are as follows:

l For details on parameter descriptions, visit the Microsoft SQL Server official website.For details on which parameters you can modify, see Which Parameters Can I Modifyon the RDS Console (Microsoft SQL Server)?

l Set remote access to 0 (default value) to prevent locally stored procedures from runningon a remote server and remotely stored procedures from running on a local server.

l max server memory (MB) indicates the server memory. Its default value is equal to theOS memory (MB) minus 520 MB. Its minimum value is 16.

Available operations are as follows:

NOTICEThe modifications take effect only after you associate the parameter group with target DBinstances. For details, see section Associating a Parameter Group with DB Instances.

l To save the modifications, click Save.l To cancel the modifications, click Cancel.l To preview the modifications, click Preview.

----End

Modifying Parameters of a Specified DB Instance

Step 1 Log in to the management console.

Relational Database ServiceUser Guide 5 Working with RDS for SQL Server

Issue 16 (2018-08-03) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

97

Page 104: User Guide · Relational Database Service User Guide Issue 16 Date 2018-08-03 HUAWEI TECHNOLOGIES CO., LTD

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

You can select a DCC to create a DB instance.

Step 3 Under Database, click Relational Database Service to go to the RDS console.

Step 4 On the Instance Management page, click the target DB instance name.

Step 5 On the Parameters page, modify the parameters as required.

Relevant parameters are as follows:l For details on parameter descriptions, visit the Microsoft SQL Server official website.

For details on which parameters you can modify, see Which Parameters Can I Modifyon the RDS Console (Microsoft SQL Server)?

l Set remote access to 0 (default value) to prevent locally stored procedures from runningon a remote server and remotely stored procedures from running on a local server.

l max server memory (MB) indicates the server memory. Its default value is equal to theOS memory (MB) minus 520 MB. Its minimum value is 16.

Available operations are as follows:

NOTICEAfter you modify parameters in a parameter group, the modifications apply to the associatedDB instance immediately.For details about the parameter group statuses, see Statuses.After you modify parameters in a parameter group, you need to view the status of the DBinstance associated with the parameter group. If the status is Pending reboot, you mustreboot the DB instance for the modifications to take effect.Rebooting is always required after modifying parameters in a parameter group under thefollowing circumstances:l The modified parameter group is associated with primary/standby DB instances. In this

case, the standby DB instance will also be changed accordingly after the reboot.l The modified parameter group is associated with a read replica.

l To save the modifications, click Save.l To cancel the modifications, click Cancel.l To preview the modifications, click Preview.

----End

5.6 Restoring a Microsoft SQL Server DB Instance to aPoint in Time

ScenariosThis section describes how to use existing automated backups to restore DB instances to apoint in time.

Relational Database ServiceUser Guide 5 Working with RDS for SQL Server

Issue 16 (2018-08-03) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

98

Page 105: User Guide · Relational Database Service User Guide Issue 16 Date 2018-08-03 HUAWEI TECHNOLOGIES CO., LTD

You can use backup data to create a new DB instance only when your account balance isgreater than or equal to ¥0.

Background

If you enable the operation protection function, second authentication is required when youperform sensitive operations to improve the security of your account and cloud product. Fordetails about how to enable operation protection, see the Identity and Access ManagementUser Guide.

Procedure

Step 1 Log in to the management console.

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

You can select a DCC to create a DB instance.

Step 3 Under Database, click Relational Database Service to go to the RDS console.

Step 4 On the Instance Management page, click the target DB instance name.

Step 5 On the Backup & Restore page, click Restore to Point In Time.

Step 6 Select the time range, select or enter a point in time within the acceptable range, and selectone of the following restoration methods and click OK. If you select restoring to the originalDB instance and you have enabled operation security, click Start verification in the Restoreto Point in Time dialog box. On the displayed page, click Send Code, enter the obtainedverification code, and click Verify. The page is closed automatically.l Create New Instance

The Create New Instance page is displayed.– The DB engine and port number of the database are the same as those of the

original DB instance and cannot be changed.– The original DB instance can be restored to a same or later DB engine version, as

shown in Table 5-1.

Table 5-1 Restoring to specific DB engine versions

Original DB Engine Version Restore To

2008 R2 WEB 2008 R2 WEB2008 R2 SE2008 R2 EE

2008 R2 SE 2008 R2 SE2008 R2 EE

2008 R2 EE 2008 R2 EE

2014 WEB 2014 WEB2014 SE2014 EE

Relational Database ServiceUser Guide 5 Working with RDS for SQL Server

Issue 16 (2018-08-03) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

99

Page 106: User Guide · Relational Database Service User Guide Issue 16 Date 2018-08-03 HUAWEI TECHNOLOGIES CO., LTD

Original DB Engine Version Restore To

2014 SE 2014 SE2014 EE

2014 EE 2014EE

2016 WEB 2016 WEB2016 SE2016 EE

2016 SE 2016 SE2016 EE

2016 EE 2016 EE

– You need to set a new administrator password.– Other settings are the same as those of the original DB instance by default and can

be modified.l Restore to Original

NOTICERestoring to the original DB instance will overwrite all existing data and the DB instancewill be temporarily unavailable.

Step 7 View the restoration result. The result depends on which restoration method was selected:l Create New Instance

A new DB instance is created using the backup data. The status of the DB instancechanges from Creating to Available.The new DB instance is independent from the original one. If you need read replicas tooffload read pressure, create one or more for the new DB instance.

l Restore to OriginalThe status of the DB instance changes from Restoring to Available.A new restoration time range is available. There will be a difference between the newand original time ranges. This difference reflects the duration of the restoration.

After the restoration, the system will perform a full backup.

----End

5.7 Restoring a DB Instance from a Backup

ScenariosThis section describes how to use an automated or manual backup to restore a DB instance tothe status when the backup was created.

Relational Database ServiceUser Guide 5 Working with RDS for SQL Server

Issue 16 (2018-08-03) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

100

Page 107: User Guide · Relational Database Service User Guide Issue 16 Date 2018-08-03 HUAWEI TECHNOLOGIES CO., LTD

You can use backup data to create a new DB instance only when your account balance isgreater than or equal to ¥0.

Procedure

Step 1 Log in to the management console.

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

You can select a DCC to create a DB instance.

Step 3 Under Database, click Relational Database Service to go to the RDS console.

Step 4 On the Backup Management page, locate the target backup and click Restore in theOperation column.

Check whether the DB instance has any backups:

l If yes, go to Step 5.l If no, go to Step 6.

Step 5 Select one of the following restoration methods and click OK.l Create New Instance

The Create New Instance page is displayed for you to create a DB instance using thebackup data. The new DB instance is independent from the original one. If you need readreplicas to offload read pressure, create one or more for the new DB instance.– The DB engine are identical to those of the original DB instance and cannot be

modified. The database port number is 1433 by default and cannot be modifiedeither.

– The original DB instance can be restored to a same or later DB engine version, asshown in Table 5-2.

Table 5-2 Restoring to specific DB engine versions

Original DB Engine Version Restore To

2008 R2 WEB 2008 R2 WEB2008 R2 SE2008 R2 EE

2008 R2 SE 2008 R2 SE2008 R2 EE

2008 R2 EE 2008 R2 EE

2014 WEB 2014 WEB2014 SE2014 EE

2014 SE 2014 SE2014 EE

2014 EE 2014EE

Relational Database ServiceUser Guide 5 Working with RDS for SQL Server

Issue 16 (2018-08-03) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

101

Page 108: User Guide · Relational Database Service User Guide Issue 16 Date 2018-08-03 HUAWEI TECHNOLOGIES CO., LTD

Original DB Engine Version Restore To

2016 WEB 2016 WEB2016 SE2016 EE

2016 SE 2016 SE2016 EE

2016 EE 2016 EE

– Other settings are the same as those of the original DB instance by default and canbe modified. For details, see Buying an RDS Microsoft SQL Server DB Instance.

– After the new instance is created, the system will perform a full backup.

l Restore to Original

NOTICERestoring to the original DB instance will overwrite all existing data and the DB instancewill be temporarily unavailable.

Check that the status of the DB instance on the Instance Management page isRestoring. No further operations are required.

If the automated backup policy is enabled, a full backup will be triggered after the restorationis complete.

Step 6 Create a new DB instance using the backup data.

The Create New Instance page is displayed for you to create a DB instance using the backupdata. The new DB instance is independent from the original one. If you need read replicas tooffload read pressure, create one or more for the new DB instance.

l The DB engine and version are identical to those of the original DB instance and cannotbe modified. The database port number is 1433 by default and cannot be modified either.

l Other settings are the same as those of the original DB instance by default and can bemodified. For details, see Buying an RDS Microsoft SQL Server DB Instance.

After the new instance is created, the system will perform a full backup.

----End

5.8 Viewing Monitoring Metricsl For details on ECS monitoring metrics, see Table 2-1.

l For details on database monitoring metrics, see Table 5-3.

Relational Database ServiceUser Guide 5 Working with RDS for SQL Server

Issue 16 (2018-08-03) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

102

Page 109: User Guide · Relational Database Service User Guide Issue 16 Date 2018-08-03 HUAWEI TECHNOLOGIES CO., LTD

Table 5-3 Database performance monitoring metrics list

Metric Description Value Range

Number of DatabaseConnections in Use

Measures the number of databaseconnections.

≥ 0 counts

Number of Transactionsper Second

Measures the number of transactionsstarted for the database per second.

≥ 0 counts/s

Number of Batches perSecond

Measures the number of Transact-SQLcommand batches received per second.

≥ 0 counts/s

Number of Logins perSecond

Measures the total number of logins startedper second.

≥ 0 counts/s

Number of Logouts perSecond

Measures the total number of logoutsstarted per second.

≥ 0 counts/s

Cache Hit Ratio Measures the percentage of pages found inthe buffer cache without having to readfrom disks.

0% to 100%

Number of SQLCompilations per Second

Measures the number of SQL compilationsper second.

≥ 0 counts/s

Number of SQL Re-Compilations per Second

Measures the number of statementrecompiles per second.

≥ 0 counts/s

Number of Full Scans perSecond

Measures the number of unrestricted fullscans per second.

≥ 0 counts/s

Number of Errors perSecond

Measures the number of errors per second. ≥ 0 counts/s

Number of Latch Waitsper Second

Measures the number of latch requests thatcould not be granted immediately.

≥ 0 counts/s

Number of Lock Waits perSecond

Measures the number of lock requests persecond that required the caller to wait.

≥ 0 counts/s

Number of Lock Requestsper Second

Measures the number of new locks andlock conversions per second requestedfrom the lock manager.

≥ 0 counts/s

Lock Timeouts per Second Measures the number of lock requests persecond that timed out.

≥ 0 counts/s

Average Lock Wait Time Measures the average amount of wait time(ms) for each lock request that resulted in await.

≥ 0 ms

Number of Deadlocks perSecond

Measures the number of lock requests persecond that resulted in a deadlock.

≥ 0 counts/s

Relational Database ServiceUser Guide 5 Working with RDS for SQL Server

Issue 16 (2018-08-03) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

103

Page 110: User Guide · Relational Database Service User Guide Issue 16 Date 2018-08-03 HUAWEI TECHNOLOGIES CO., LTD

Metric Description Value Range

Number of CheckpointPages per Second

Measures the number of pages flushed todisks per second by a checkpoint or otheroperations that require all dirty pages to beflushed.

≥ 0 counts/s

Number of Slow Queries Measures the number of currently runningslow queries.

≥ 0 counts

5.9 Viewing and Downloading System Logs

Scenarios

System logs contain error-level logs generated during the database running. These can helpyou analyze problems with the database. You can also download system logs for serviceanalysis.

Viewing Log Details

Step 1 Log in to the management console.

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

You can select a DCC to create a DB instance.

Step 3 Under Database, click Relational Database Service to go to the RDS console.

Step 4 On the Instance Management page, click the target DB instance name.

Step 5 On the System Logs page, click Log Details.l You can view system logs generated in different time periods.l If the description of a log is truncated, locate the log and move your pointer over the

description in the Description column to view details.

----End

Download a Log

Step 1 Log in to the management console.

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

You can select a DCC to create a DB instance.

Step 3 Under Database, click Relational Database Service to go to the RDS console.

Step 4 On the Instance Management page, click the target DB instance name.

Step 5 On the System Logs page, click Download.

1. Locate a log to be downloaded and click Download in the Operation column.

Relational Database ServiceUser Guide 5 Working with RDS for SQL Server

Issue 16 (2018-08-03) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

104

Page 111: User Guide · Relational Database Service User Guide Issue 16 Date 2018-08-03 HUAWEI TECHNOLOGIES CO., LTD

The system automatically loads the downloading preparation tasks. The loading durationis determined by the log file size and network environment.– During the downloading preparation, the log status is Preparing.– After the downloading preparation is complete, the log status is Preparation

completed.– If the downloading preparation fails, the log status is Abnormal.

2. In the displayed dialog box, click OK to download the log whose status is Preparationcompleted. If you click Cancel, the system does not download the log and returns to theDownload page.The download link is valid for 15 minutes. After the download link expires, a message isdisplayed indicating that the download link has expired. You can close the window andrepeat the procedure Step 5.1 to try to download a log.

----End

Relational Database ServiceUser Guide 5 Working with RDS for SQL Server

Issue 16 (2018-08-03) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

105

Page 112: User Guide · Relational Database Service User Guide Issue 16 Date 2018-08-03 HUAWEI TECHNOLOGIES CO., LTD

6 Troubleshooting

6.1 Failed to Connect to MySQL DB Instances

ScenariosWhen you remotely connect to a MySQL DB instance or run the telnet command to connectto port 3306, the following error message is displayed: Host * is not allowed to connect to thisMySQL server.

Possible CausesYour account cannot be used for remote login and can only be used on localhost.

SolutionsTwo solutions are provided as follows:

Solution 1: Modifying the user tableOn the localhost, log in to the MySQL database and change the value of host from localhostto % in the user table. Run the following commands:mysql -u root –ppasswduse mysql;mysql>update user set host = '%' where user = 'root';mysql>select host, user from user;mysql>flush privileges;

Solution 2: Granting Permissions to Your Accountl If you want to use username myuser and password mypassword to connect to a MySQL

DB instance from any ECSs and local devices, log in to the MySQL database onlocalhost and run the following commands:GRANT ALL PRIVILEGES ON *.* TO 'myuser'@'%' IDENTIFIED BY 'mypassword' WITH GRANT OPTION;FLUSH PRIVILEGES;

l If you want to use username myuser and password mypassword to connect to a MySQLDB instance from the ECS and local device whose IP address is 192.168.1.6, run thefollowing commands:

Relational Database ServiceUser Guide 6 Troubleshooting

Issue 16 (2018-08-03) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

106

Page 113: User Guide · Relational Database Service User Guide Issue 16 Date 2018-08-03 HUAWEI TECHNOLOGIES CO., LTD

GRANT ALL PRIVILEGES ON *.* TO 'myuser'@'192.168.1.6' IDENTIFIEDBY 'mypassword' WITH GRANT OPTION;FLUSH PRIVILEGES;Run the following commands on the host where MySQL is installed:mysql -h localhost -u root //Log in.mysql>GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' WITHGRANT OPTION //Allow any ECSs and local devices to access data.mysql>FLUSH PRIVILEGES;//Make the modification take effect.mysql>QUIT //Exit from the MySQL DB instance.

Then, you can log in to the MySQL DB instance from any ECSs and local devices as userroot.

NOTE

If remote connections to databases on HUAWEI CLOUD ECSs fail when these databases allow remoteconnections, you can clear firewall rules and open a specific port of the security group.

6.2 Failed to Change the Password of MySQL 5.7 byModifying the user Table

Scenarios

When you change the password by modifying the user table, the path cannot be found.

Solution

Step 1 Modify the MySQL configuration file to skip password verification.

vim /etc/my.cnf

Add skip-grant-tables at the end of [mysqld].

Step 2 Restart MySQL service.

service mysqld restart

Relational Database ServiceUser Guide 6 Troubleshooting

Issue 16 (2018-08-03) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

107

Page 114: User Guide · Relational Database Service User Guide Issue 16 Date 2018-08-03 HUAWEI TECHNOLOGIES CO., LTD

Step 3 Log in to the database.

Step 4 Run the desc mysql.user command.

The command output indicates that MySQL 5.7 does not have the password field but has theauthentication_string field.

Step 5 Set a new password:

update mysql.user set authentication_string=password('New password') whereuser='root' and Host = 'localhost'

The new password has been set.

Relational Database ServiceUser Guide 6 Troubleshooting

Issue 16 (2018-08-03) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

108

Page 115: User Guide · Relational Database Service User Guide Issue 16 Date 2018-08-03 HUAWEI TECHNOLOGIES CO., LTD

Step 6 Log out and delete or comment out the skip-grant-tables line.

----End

6.3 Viewing RDS DB Instance Storage Space

ScenariosStorage space of RDS DB instances refers to the storage space you have purchased on EVS,not including the ECS system disks. You can use Cloud Eye to monitor the total disk size,disk usage, and disk utilization of ECS system disks and set alarm rules. However, you cannotview the RDS DB instance storage space on Cloud Eye.

Solution

Step 1 Log in to the management console.

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

You can select a DCC to create a DB instance.

Step 3 Under Database, click Relational Database Service to go to the RDS console.

Step 4 On the Instance Management page, click the target DB instance name.

Step 5 On the Basic Information page, view the storage type and utilization in the StorageInformation area.

----End

NOTE

The displayed used storage space is greater than the space you used because both data files and binlogfiles are stored in RDS storage space.

l If you enable an automated backup policy, backup binlog files will be stored in the storage space.The retention period is determined by the expire_logs_days value.

l If you perform a pressure test on the database or service traffic in a certain period is heavy, a largenumber of binlog files will occupy the storage space, increasing the storage space utilization.

Suggestions: If you have enabled an automated backup policy, you can set expire_logs_days to asmaller value to reduce the storage space utilization under the prerequisite that data security isguaranteed.

6.4 Viewing Slow Query Logs

ScenariosSlow query logs record statements whose execution period exceeds the threshold specified bythe slowms value (100 ms by default). Based on slow query logs, you can identify andoptimize slowly executed statements.

Solution

Step 1 Log in to the management console.

Relational Database ServiceUser Guide 6 Troubleshooting

Issue 16 (2018-08-03) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

109

Page 116: User Guide · Relational Database Service User Guide Issue 16 Date 2018-08-03 HUAWEI TECHNOLOGIES CO., LTD

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

You can select a DCC to create a DB instance.

Step 3 Under Database, click Relational Database Service to go to the RDS console.

Step 4 On the Instance Management page, locate the target RDS DB instance and view its DBengine version.

Step 5 In the navigation pane on the left, choose Parameter Group Management.

Step 6 Click Create Parameter Group. In the displayed dialog box, create a parameter group of thesame DB engine version.

Step 7 Click the name of the parameter group you have created. On the displayed page, change thelong_query_time value to 1, and save the change.

Step 8 In the navigation pane on the left, choose Instance Management. Locate the target DBinstance and choose More > Change Parameter Group in the Operation column. In thedisplayed dialog box, select the parameter group you have created. Then, locate the target DBinstance and choose More > Reboot in the Operation column.

Step 9 Run the following command to connect to the RDS database:

mysql -h <DB instance private IP address> -P <Port number> -u root -p

Figure 6-1 Connecting to the RDS database

Step 10 Execute the following statements for more than 1s.

select sleep(2);

select sleep(3);

Relational Database ServiceUser Guide 6 Troubleshooting

Issue 16 (2018-08-03) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

110

Page 117: User Guide · Relational Database Service User Guide Issue 16 Date 2018-08-03 HUAWEI TECHNOLOGIES CO., LTD

Step 11 On the Instance Management page, click the target DB instance name.

Step 12 On the Slow Query Logs page, view log details.

----End

6.5 The Replication Relationship Is Abnormal BetweenPrimary and Standby RDS DB Instances

Scenarios

The replication relationship between primary and standby RDS DB instances is abnormal. Apossible cause is that the default security group rule is deleted.

Solution

Step 1 Log in to the management console.

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

You can select a DCC to create a DB instance.

Step 3 Under Database, click Relational Database Service to go to the RDS console.

Step 4 On the Instance Management page, click the target DB instance name.

Step 5 On the Basic Information page, click the security group name.

Step 6 On the displayed page, click Add Rule. In the displayed dialog box, select Inbound forTransfer Direction, Any for Protocol/Application and Security group for Source. In thedrop-down list, select the same security group as the displayed one on the Basic Informationpage.

Figure 6-2 Adding a rule

Relational Database ServiceUser Guide 6 Troubleshooting

Issue 16 (2018-08-03) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

111

Page 118: User Guide · Relational Database Service User Guide Issue 16 Date 2018-08-03 HUAWEI TECHNOLOGIES CO., LTD

Step 7 Wait until the rule is added. Check that the replication relationship between primary andstandby DB instances is restored.

----End

6.6 Failed to Connect to an RDS Microsoft SQL Server DBInstance

Fault Locationl Check whether the ECS can connect to the RDS DB instance.

If the ECS cannot connect to the RDS DB instance, check whether the ECS and RDS DBinstance are located in the same VPC and security group.

l Check whether the IP address and port number are correct.Use a colon to separate an IP address and a port number.

l Check whether the RDS service is running properly.l Check whether the username and password are correct. You can reset the password.l Reboot the RDS DB instance and check whether it can be connected through an ECS.

Solution

Step 1 Log in to the management console, select a region and a project, and choose RelationalDatabase Service under Database. On the Instance Management page, click the target DBinstance name. On the Basic Information and Backup & Restore pages, check connectionand backup information.

Step 2 On the Basic Information page, check the administrator.

Step 3 Download an SQL Server Management Studio installation package and install it on an ECS.

Step 4 Connect to the RDS DB instance through an ECS.

----End

6.7 CPU Resource Exhaustion Caused by a Large Numberof Concurrent Slow Queries

ScenariosA large number of slow select count(0) operations are being concurrently executed on a DBinstance. As a result, CPU resources are exhausted, causing system breakdown risks.

A list of processes is displayed as follows.

Relational Database ServiceUser Guide 6 Troubleshooting

Issue 16 (2018-08-03) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

112

Page 119: User Guide · Relational Database Service User Guide Issue 16 Date 2018-08-03 HUAWEI TECHNOLOGIES CO., LTD

Slow query log information about these operations is displayed as follows.

Possible CausesApplications triggered a large number of concurrent and slow select count(0) operations,exhausting CPU resources.

Solution

Step 1 Apply for permissions to intermittently kill the slow select count(0) operations in batches.Locate the source of triggering the slow operations, stop the source, and optimize SQLstatements.

Relational Database ServiceUser Guide 6 Troubleshooting

Issue 16 (2018-08-03) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

113

Page 120: User Guide · Relational Database Service User Guide Issue 16 Date 2018-08-03 HUAWEI TECHNOLOGIES CO., LTD

Kill the slow operations in batches.

Step 2 Increase CPU idle time.

----End

Relational Database ServiceUser Guide 6 Troubleshooting

Issue 16 (2018-08-03) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

114

Page 121: User Guide · Relational Database Service User Guide Issue 16 Date 2018-08-03 HUAWEI TECHNOLOGIES CO., LTD

A Change History

Release Date Description

2018-08-03 This issue is the sixteenth official release, which incorporates thefollowing changes:l Supported changing the instance type from single to primary/

standby for yearly/monthly DB instances.l Added the following PostgreSQL plugins: auto_explain,

oracle_fdw, pg_pathman, pg_stat_statements, and pg_hint_plan.l Supported changing the instance type from single to primary/

standby for Microsoft SQL Server DB instances.l Supported using backup data to create a new DB instance of a

later version.l Added the AD domain for Microsoft SQL Server.l Supported buying DB instances with the same specifications as

the selected DB instance.l Supported displaying the progresses and logs of changing the

instance type from single to primary/standby for Microsoft SQLServer DB instances in the task center.

2018-07-13 This issue is the fifteenth official release, which incorporates thefollowing changes:l Supported buying DB instances with the same specifications as

the selected DB instance.l Supported reverting the whitelist to its most recently used

configuration when public accessibility is re-enabled.l Changed the default port number to 5432 when a PostgreSQL

DB instance is created.l Supported downloading logs for PostgreSQL and Microsoft

SQL Server DB instances.l Supported restoring Microsoft SQL Server DB instances to

original DB instances.l Supported changing Microsoft SQL Server DB instance names.

Relational Database ServiceUser Guide A Change History

Issue 16 (2018-08-03) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

115

Page 122: User Guide · Relational Database Service User Guide Issue 16 Date 2018-08-03 HUAWEI TECHNOLOGIES CO., LTD

Release Date Description

2018-06-30 This issue is the fourteenth official release, which incorporates thefollowing changes:l Had no operation restrictions on accounts with a balance greater

than or equal to ¥0.l Supported selections of instance information items displayed on

the RDS console.l Supported changing a DB instance's billing mode from pay-per-

use to yearly/monthly.l Supported displaying the progresses and logs of the following

tasks in the task center: creating read replicas for MySQL DBinstances, enabling or disabling public accessibility for MySQLDB instances, and changing the instance type from single toprimary/standby for MySQL and PostgreSQL DB instances.

l Supported statistics analysis for MySQL slow query logs.l Deleted warning logs from MySQL error logs.l Supported the configuration and change of the private IP address

for a MySQL DB instance.l Supported public accessibility enabling and disabling for

MySQL read replicas.l Supported cloud DBA for MySQL DB instances.l Supported storage space scaling of MySQL and PostgreSQL DB

instances for an unlimited number of times. Each scaling mustbe a multiple of 10 GB.

l Supported storage space scaling of SQL Server DB instances bya multiple of 10 GB.

l Supported changing the instance type from single to primary/standby for MySQL and PostgreSQL pay-per-use DB instances.

l Added 17 SQL Server database metrics in Table 5-3.l Supported downloading of backup files of a single database for

SQL Server.

2018-06-15 This issue is the thirteenth official release, which incorporates thefollowing changes:l Prolonged the backup retention period to 732 days.l Supporting whitelist configurations.l Supported downloading of slow query logs and error logs for

MySQL DB instances.l Displayed default parameter groups and user-created parameter

groups on different pages.l Supported 1 vCPU | 2 GB and 1 vCPU | 4 GB instance classes

for PostgreSQL DB instances.

Relational Database ServiceUser Guide A Change History

Issue 16 (2018-08-03) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

116

Page 123: User Guide · Relational Database Service User Guide Issue 16 Date 2018-08-03 HUAWEI TECHNOLOGIES CO., LTD

Release Date Description

2018-06-01 This issue is the twelfth official release, which incorporates thefollowing changes:l Provided an option for enabling or disabling automated backups.l Supported working with the DSS service.l Supported a maximum of 4,000 GB of storage space when you

create or scale up a DB instance.l After a parameter group is modified, it must apply to the target

DB instance for the modifications to take effect.l Supported yearly/monthly DB instance creation in batches.l Support secondary verification for important operations,

including resetting passwords, restoring to original DBinstances, and manual primary/standby switchovers.

l Added the parameter management tab.l Supported exports of DB instance lists.l Supported creation of user accounts.l Supported creation of databases.l Supported public accessibility enabling or disabling of MySQL

DB instances.l Changed the default port number to 3306 when a MySQL DB

instance is created.l Supported display of progresses and logs of creating or scaling

MySQL DB instances in the task center.l Supported PostgreSQL 10.0.l Supported Microsoft SQL Server 2008 R2 SP3 EE.l Supported restoring to original DB instances for Microsoft SQL

Server.l Supported time zone selections during restoration to new DB

instances for Microsoft SQL Server.l Supported permission reset for Microsoft SQL Server.l Added O&M cases.

Relational Database ServiceUser Guide A Change History

Issue 16 (2018-08-03) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

117

Page 124: User Guide · Relational Database Service User Guide Issue 16 Date 2018-08-03 HUAWEI TECHNOLOGIES CO., LTD

Release Date Description

2018-05-15 This issue is the eleventh official release, which incorporates thefollowing changes:l Supports DeC.l Supported disk encryption.l Support secondary verification for important operations.l Supported Microsoft SQL Server 2016 SP1 SE.l Supported Microsoft SQL Server 2016 SP1 EE.l Supported creation and restoration for Microsoft SQL Server

manual backups.l Modified the method of modifying the automated backup policy.l Added information about product introduction.l Added quick start for each DB engine.

2018-04-11 This issue is the tenth official release, which incorporates thefollowing changes:l Supported renewal of yearly/monthly DB instances on the RDS

console.l Supported allocation of default VPC resources during the DB

instance creation.l Supported changing instance classes and scaling up storage

space on the Basic Information page.l Supported primary/standby switchover manually.l Changed the minimum start value of each scaling to 40 GB.l Supported management of plugins and tablespaces for

PostgreSQL.l Supported Microsoft SQL Server 2014 SP2 EE.l The default port number is 1433 when creating a Microsoft SQL

Server DB instance.

2018-03-20 This issue is the ninth official release, which incorporates thefollowing changes:l Based on the console modifications, updated the following

procedure descriptions: creating DB instances, connecting DBinstances, creating read replicas, scaling up storage space,changing instance classes, creating backups, restoring backups,changing database ports, changing administrator passwords,rebooting DB instances, and deleting DB instances.

l Supported HWSQL 5.6.l Supported SQL Server 2008 R2 SP3 SE.l Supported DB instance name modifications.

2017-12-01 This issue is the eighth official release, which incorporates thefollowing change:Supported public accessibility enabling and disabling.

Relational Database ServiceUser Guide A Change History

Issue 16 (2018-08-03) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

118

Page 125: User Guide · Relational Database Service User Guide Issue 16 Date 2018-08-03 HUAWEI TECHNOLOGIES CO., LTD

Release Date Description

2017-10-16 This issue is the seventh official release, which incorporates thefollowing changes:l Supported the yearly/monthly billing mode for PostgreSQL and

Microsoft SQL Server.l Supported PostgreSQL and Microsoft SQL Server commercial

use.l Supported PostgreSQL plugins.l Modified the methods of loading Microsoft SQL Server logs.

2017-08-18 This issue is the sixth official release, which incorporates thefollowing changes:l Supported PostgreSQL 9.6.3.l Supported MySQL 5.6.36.l Based on the console modifications, updated the following

procedure descriptions: purchasing DB instances, connecting toDB instances through SSL, creating read replicas, scaling upstorage space, changing administrator passwords, rebooting DBinstances, and deleting DB instances.

l Updated the procedures of replicating and deleting manualsnapshots based on changes made to the RDS console.

l Supported cross-AZ PostgreSQL HA DB instances.l Supported changing the security group assigned to a DB

instance.l Supported changing the parameter group description for a DB

instance.l Support interconnecting with CTS.

2017-06-19 This issue is the fifth official release, which incorporates thefollowing change:Supported multi-AZ deployment of MySQL HA DB instances.

2017-05-06 This issue is the fourth official release, which incorporates thefollowing changes:l Supported MySQL 5.7.17.l Supported PostgreSQL 9.5.5.l Supported Microsoft SQL Server 2014 SP2 SE.l Supported parameter groups.

2017-03-03 This issue is the third official release, which incorporates thefollowing changes:l Supported MySQL 5.6.35.l Supported changing the database port for a DB instance.l Supported resetting the administrator password.

Relational Database ServiceUser Guide A Change History

Issue 16 (2018-08-03) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

119

Page 126: User Guide · Relational Database Service User Guide Issue 16 Date 2018-08-03 HUAWEI TECHNOLOGIES CO., LTD

Release Date Description

2016-10-29 This issue is the second official release, which incorporates thefollowing changes:l Supported MySQL 5.6.33.l Supported MySQL 5.6.34.l Supported changing the CPU or memory of a DB instance.l Supported storage space scaling of DB clusters.l Supported creating, replicating, restoring, and deleting a manual

snapshot.l Supported point-in-time recovery from an automated snapshot.

2016-06-30 This issue is the first official release.

Relational Database ServiceUser Guide A Change History

Issue 16 (2018-08-03) Huawei Proprietary and ConfidentialCopyright © Huawei Technologies Co., Ltd.

120