Relational Database ServiceRelational Database Service

Compute
Elastic Cloud Server
Bare Metal Server
Auto Scaling
Image Management Service
Dedicated Host
FunctionGraph
Networking
Virtual Private Cloud
Elastic IP
Elastic Load Balance
NAT Gateway
Direct Connect
Virtual Private Network
Domain Name Service
VPC Endpoint
Cloud Connect
Enterprise Switch
Security & Compliance
Anti-DDoS
Web Application Firewall
Host Security Service
Data Encryption Workshop
Database Security Service
Advanced Anti-DDoS
Data Security Center
Container Guard Service
Situation Awareness
Managed Threat Detection
Compass
Cloud Certificate Manager
Anti-DDoS Service
Databases
Relational Database Service
Document Database Service
Data Admin Service
Data Replication Service
GaussDB NoSQL
GaussDB(for MySQL)
Distributed Database Middleware
GaussDB(for openGauss)
Developer Services
ServiceStage
Distributed Cache Service
Simple Message Notification
Application Performance Management
Application Operations Management
Blockchain Service
API Gateway
Cloud Performance Test Service
Distributed Message Service for Kafka
Distributed Message Service for RabbitMQ
Distributed Message Service for RocketMQ
Cloud Service Engine
DevCloud
ProjectMan
CodeHub
CloudRelease
CloudPipeline
CloudBuild
CloudDeploy
Cloud Communications
Message & SMS
Cloud Ecosystem
Marketplace
Partner Center
User Support
My Account
Billing Center
Cost Center
Resource Center
Enterprise Management
Service Tickets
HUAWEI CLOUD (International) FAQs
ICP License Service
Support Plans
Customer Operation Capabilities
Partner Support Plans
Professional Services
enterprise-collaboration
Meeting
IoT
IoT
Intelligent EdgeFabric
DeveloperTools
SDK Developer Guide
API Request Signing Guide
Terraform
Koo Command Line Interface
Help Center> Relational Database Service> User Guide> Working with RDS for SQL Server> Suggestions on Using RDS for SQL Server Instances
Updated at: Apr 02, 2022 GMT+08:00

Suggestions on Using RDS for SQL Server Instances

Instance Class

Do not use instances with 2 vCPUs and 4 GB memory for production workloads. Such instances are provided only for experience testing.

Use instances with at least 4 vCPUs and 8 GB memory for production workloads. Instances with 2 vCPUs and 4 GB memory are not suitable for production workloads because Microsoft SQL Server runs on the Windows OS and both the engine and OS require a large number of resources. Using instances with 2 vCPUs and 4 GB for a long time may cause low memory and system freezing.

Database Connection

  • Use the form of "ip,port" (use a comma (,) between them) to connect to an RDS for SQL Server instance.
  • Do not use the server name to connect to a database.
  • Your application must be able to reconnect to the database if a disaster occurs in the database or the database is disconnected.

Database Migration

After the migration is complete, perform the following operations:

  • Check the permission integrity. Database migration only restores data. Other service-level permissions, such as those for database users and login names, must be recreated and re-associated with database accounts.
  • Recreate indexes. After the migration is complete, the physical environment of data files changes, and the database indexes become invalid. You need to recreate the indexes to minimize the impact on the database performance.
  • Compare parameter settings. After data is migrated to the cloud, RDS for SQL Server uses parameter groups provided on the cloud. You need to compare the parameter settings on the cloud with those of the original on-premises database. Modify the parameter settings on the cloud to keep them the same as those for the original database.

Instance Usage

  • It is not recommended to create an instance configured with the AD domain although RDS for SQL Server supports this function. This is because the domain controller server is deployed on the user side, and the user has high permissions. If the user changes group policy configurations of the domain controller server, the permission security risks of the DB instance may increase.
  • The number of databases in a single instance cannot exceed 100. The maximum number of databases that a single DB instance supports depends on the instance specifications. Too many databases occupy resources such as worker threads, deteriorating your instance performance.
  • Do not use the sysadmin role to connect your application to a database. An account with the sysadmin role has the super administrator permission. Improper use of this account will threaten database security and stability. RDS does not grant the super administrator permission to any user.
  • Do not create tables in the system database. Create a user-defined database to store user data. Do not create any table in the system database to write data because storing data in the system database is insecure.
  • Do not enable the AutoClose property for the database. Enabling AutoClose may result in failures to establish the replication relationship between primary and standby DB instances.
  • Do not set the database to single-user mode. Single-user mode allows only one session to access the database at a time. If a fault occurs in the database, no sessions initiated by O&M personnel can connect to the database. If you have set your database to single-user mode, change it to multi-user mode.
  • Do not leave Slow Query Log enabled for a long time. Slow query logs help analyze slow SQL statements. However, if Slow Query Log is enabled for a long time, database performance will deteriorate. You are advised to disable Slow Query Log when you do not need to trace or analyze SQL problems.
  • Schedule a time to automatically recreate indexes. When a database is used for a long time, a large number of index fragments may be generated. This reduces the speed of database access. To address this issue, create an SQL Agent job to recreate indexes once a month.
  • Update statistics periodically. Database statistics need to be updated at regular intervals. You are advised to create an SQL Agent job to update statistics once a week.
  • Pay attention to the database size and shrink the database as required. If a database has been used for a long time, some physical space may not be released in a timely manner. In this case, you need to shrink the database to release the physical space. Pay attention to the log file size and physical file size. If any file bloat is found, shrink the database during off-peak hours.
  • The database name cannot exceed 64 characters. Only digits, uppercase letters, lowercase letters, hyphens (-), and underscores (_) are allowed.
  • You are advised to change the default port. The default port of RDS for SQL Server is 1433. Some insecure programs on the Internet may scan the default port.
  • You are advised to use primary/standby instances. Compared with single instances, primary/standby instances greatly improve the availability and reliability of production workloads.
  • Deploy primary/standby instances across AZs for AZ-level DR.
  • During off-peak hours, reboot instances that have been running for a long time. After an instance runs for a long time, its performance may deteriorate. You are advised to reboot the instance every three months during off-peak hours.
  • Configure the maximum degree of parallelism. This parameter affects the CPU usage of your workloads. Its default value is 0, indicating that a session can use all CPUs. If you set it to the default value, the CPUs may not be allocated to other sessions due to a SQL problem. You are advised to configure this parameter based on instance specifications, for example, setting it to the value of the number of cores divided by 2.
  • Create multiple NDF files for the tempdb database.
  • If a permission problem occurs when you perform an operation, refer to Usage of Stored Procedures to find a proper stored procedure.
  • To modify SQL Server parameters, modify them on the console instead of running SQL commands.
  • Back up and restore data on the console or by calling RDS APIs or SDK APIs. Do not use SQL Server Management Studio (SSMS) or SQL statements for backup and restoration. For details about how to migrate your data to RDS, see Data Replication Service (DRS).
  • Restoring data to an existing DB instance may cause existing data to be overwritten. Exercise caution when performing this operation. You are advised to restore data to a new DB instance.
  • Set the recovery model of your database to FULL instead of SIMPLE.
    • In the SIMPLE recovery model, no incremental backup is performed for the database. Therefore, the database cannot be restored to a specified time point.
    • For primary/standby or cluster instances, if the recovery model is set to SIMPLE, no replication relationship will be established for the instances. As a result, the primary/standby switchover or instance class change cannot be performed.

Did you find this page helpful?

Failed to submit the feedback. Please try again later.

Which of the following issues have you encountered?







Please complete at least one feedback item.

Content most length 200 character

Content is empty.

OK Cancel