All Products
Search
Document Center

ApsaraDB RDS:Create and use an ApsaraDB RDS for SQL Server instance

Last Updated:Oct 28, 2024

This topic describes how to create an ApsaraDB RDS for SQL Server instance and create and configure databases and accounts for the RDS instance in the ApsaraDB RDS console. This topic also provides multiple methods to connect to the RDS instance. This helps you quickly get started with ApsaraDB RDS for SQL Server.

If this is the first time you use ApsaraDB RDS, we recommend that you familiarize yourself with the limits of ApsaraDB RDS. For more information, see Limits.

Prerequisites

If you use a Resource Access Management (RAM) user to create an RDS instance, the AliyunRDSFullAccess and AliyunBSSOrderAccess policies must be attached to the RAM user. For more information, see Use RAM for resource authorization.

Billing rules

After you create an RDS instance, you are charged for the instance type and the storage capacity of the RDS instance. The fees that are generated for the RDS instance vary based on the billing method, RDS edition, instance type, storage type, and storage capacity. For more information, see Billable items.

1. Create an RDS SQL Server instance

On the ApsaraDB RDS buy page, click New Version or Back to Old Version to go to the new version or old version of the ApsaraDB RDS buy page.

New version

  1. Go to the ApsaraDB RDS buy page of the new version.

  2. Configure the Billing Method parameter.

    Billing method

    Suggestion

    Benefit

    Subscription

    A subscription instance is an instance for which you pay an upfront fee. If you want to use an instance for a long period of time, we recommend that you select the Subscription billing method. If you select the subscription billing method, configure the Subscription Duration parameter in the lower part of the page.

    For long-term use, the subscription billing method is more cost-effective than the pay-as-you-go billing method. You are offered lower prices for longer subscription durations.

    Pay-as-you-go

    You are charged on an hourly basis for a pay-as-you-go RDS instance based on your actual resource usage. If you want to use an RDS instance for a short period of time, we recommend that you select the Pay-as-you-go billing method.

    You can create a pay-as-you-go RDS instance. After you confirm that the created RDS instance meets your business requirements, you can change the billing method of the RDS instance from Pay-as-you-go to .

    You can release a pay-as-you-go RDS instance based on your business requirements. The billing cycle of a pay-as-you-go RDS instance immediately stops after you release the RDS instance.

    Serverless

    If you want to run scheduled tasks, your business workloads frequently change, or the business workloads are fully managed or do not require O&M, we recommend that you select Serverless. For more information, see Overview of serverless ApsaraDB RDS for SQL Server instances and Create a serverless ApsaraDB RDS for SQL Server instance.

    You are charged based on your consumption of resources for workloads. This can help reduce costs.

    Note

    You can view the price in the lower-right corner of the page. The price is displayed only after you configure all required parameters.

  3. Configure the Region parameter.

    Important

    You cannot change the region of a RDS instance after purchase. Exercise caution when you configure this parameter.

    We recommend that you create the serverless RDS instance in the same region as the ECS instance. If the RDS instance and the ECS instance reside in different regions, these instances cannot communicate over an internal network. As a result, these instances cannot deliver optimal performance.

    Note
    • If an ECS instance connects to an RDS instance over an internal network, make sure that the RDS instance and the ECS instance reside in the same region.

    • If your application is deployed on an on-premises server or computer, we recommend that you select a region that is in close proximity to the on-premises server or computer. This way, you can use the public endpoint of the RDS instance to connect to the RDS instance from your application.

  4. Configure the Database Engine, Product Type, and Storage Type parameters.

    1. Configure the Database Engine parameter.

      Select Microsoft SQL Server. SQL Server 2008 R2, SQL Server 2012, SQL Server 2016, SQL Server 2017, SQL Server 2019, and SQL Server 2022 are supported.

      Note
      • The available database engines and versions vary based on the region that you select.

      • RDS instances that run SQL Server Basic and SQL Server Web can reside in the classic network and VPCs. RDS instances that run other SQL Server editions can reside only in VPCs, and you must configure the VPC and vSwitch of Primary Node parameters.

    2. Configure the Edition parameter.

      RDS edition

      Description

      Benefit

      RDS Basic Edition

      • The database system consists of only a primary RDS instance. Computing is separated from storage.

      • Read-only RDS instances are not supported.

      RDS Basic Edition is cost-effective and is suitable for learning and testing.

      Note

      RDS instances that run RDS Basic Edition require a long period of time to restart or recover from faults.

      RDS High-availability Edition

      • The database system consists of a primary RDS instance and a secondary RDS instance. These instances work in HA mode and support automatic failover. The secondary RDS instance cannot be accessed.

      • Read-only RDS instances are not supported.

      We recommend that you use this RDS edition. RDS High-availability Edition is suitable for production environments and is suitable for more than 80% of business scenarios.

      RDS Cluster Edition

      • The database system consists of a primary RDS instance and a secondary RDS instance. These instances work in HA mode and support automatic failover. The secondary RDS instances can be accessed. This increases the read capability of your database system.

      • You can create up to seven read-only RDS instances to improve the read capability. However, read-only RDS instances do not participate in the primary instance election or workload switchover.

      • You can manage costs in a flexible manner.

      • Secondary RDS instances are readable.

      Note
      • The available RDS editions vary based on the region and database engine that you select.

      • Serverless RDS instances run only RDS High-availability Edition.

      • For more information, see Overview of ApsaraDB RDS editions.

    3. Configure the Storage Type parameter.

      Item

      ESSD

      Scalability

      • You can increase the storage capacity up to 32 TB.

      • No transient connections occur during storage capacity expansion.

      • You can upgrade, downgrade, create, or release the RDS instance within minutes.

      • Automatic storage expansion is supported.

      Performance

      • PL1<PL2<PL3

      • A performance level 2 (PL2) Enterprise SSD (ESSD) delivers twice the IOPS and throughput of a PL1 ESSD.

      • A PL3 ESSD delivers IOPS that is up to 20 times the IOPS delivered by a PL1 ESSD. A PL3 ESSD also delivers throughput that is up to 11 times the throughput delivered by a PL1 ESSD.

      Backup

      • A backup can be completed within minutes or seconds.

      • The highest backup frequency is one backup every 15 minutes.

      Note
  5. Configure the Network Type parameter. The Network Type parameter is fixed as VPC.

    1. Configure the VPC parameter.

      We recommend that you select the VPC in which your ECS instance resides for the RDS instance. If the RDS instance and the ECS instance reside in different VPCs, these instances cannot communicate over an internal network.

      Note

      You can connect the RDS instance and the ECS instance over an internal network even if the instances use different vSwitches in the same VPC.

    2. Configure the Add to Whitelist parameter to specify whether to add the CIDR block of the selected VPC to a whitelist of the RDS instance.

      If you set this parameter to Yes, the ECS instances that reside in the selected VPC can access the RDS instance.

      Note

      If you set the Add to Whitelist parameter to No, you can configure a whitelist after the RDS instance is created. For more information, see Configure an IP address whitelist.

  6. Select a zone and a vSwitch fo the instance and then configure the Deployment Method parameter.

    • Select a zone.

      A zone is an independent physical area within a region. For example, the China (Hangzhou) region contains Zone H, Zone I, and Zone J.

      • No significant differences exist between the zones in the same region.

      • If the RDS instance resides in the same zone as the ECS instance that you want to connect, these instances can deliver optimal performance. If the RDS instance and the ECS instance reside in different zones in the same region, the performance of these instances slightly decreases.

    • Select a vSwitch.

      A vSwitch is a basic network device that connects different cloud resources. When you create a cloud resource in a VPC, you must specify a vSwitch to which the cloud resource is connected.

      Select an existing vSwitch or click Create vSwitch. For more information, see Create and manage a vSwitch.

    • Select a deployment method.

      • Multi-zone Deployment: We recommend that you use the deployment method. The primary RDS instance and the secondary RDS instance reside in different zones of a region to provide cross-zone disaster recovery.

        If you set the Deployment Method parameter to Multi-zone Deployment, you must configure the Zone and Network of Primary Node and Zone and Network of Secondary Node parameters.

      • Single-zone Deployment: The primary RDS instance and the secondary RDS instance reside in the same zone.

        If you select RDS Basic Edition, you can select only the Single-zone Deployment method.

      Note
      • If your database system consists of primary and secondary RDS instances, we recommend that you select Multi-zone Deployment to implement cross-zone disaster recovery.

      • If Sold Out appears in the upper-right corner of a zone name, this zone does not have sufficient resources. Switch to another zone.

  7. Configure the Instance Type parameter.

    1. Configure the Category parameter. Valid values: General-purpose, Dedicated, and Shared. The available instance types vary based on the RDS edition and database engine. Refer to the available instance types in the ApsaraDB RDS console.

      Instance type

      Description

      Benefit

      General-purpose

      A general-purpose RDS instance occupies all the allocated memory and I/O resources.

      A general-purpose RDS instance shares CPU and storage resources with the other general-purpose RDS instances that are deployed on the same host.

      RDS instances of the general-purpose instance type are cost-effective.

      Dedicated

      A dedicated RDS instance occupies all the allocated CPU, memory, storage, and I/O resources.

      Note

      The dedicated host instance family is the highest configuration of the dedicated instance family. A dedicated host RDS instance exclusively occupies all the CPU, memory, storage, and I/O resources of the host on which the RDS instance is deployed.

      RDS instances of the dedicated instance type provide higher performance and higher stability.

      Note

      An RDS instance that runs RDS Basic Edition does not support the dedicated instance family.

      Shared

      A shared RDS instance exclusively occupies the allocated memory and storage resources.

      A shared RDS instance shares CPU resources with other RDS instances that are deployed on the same host.

      A shared RDS instance is cost-effective but delivers moderate stability.

    2. Configure detailed specifications, including CPU cores, memory capacity, and maximum number of connections.

  8. Configure the Storage Capacity parameter.

    The storage capacity is used to store data files, system files, archived log files, and transaction files. The valid values of the Storage Capacity parameter vary based on the values of the Storage Type and Instance Type parameters that you specify. You can adjust the storage capacity at a step size of 5 GB.

    Note

    If you select the local SSD storage type, the storage capacity of the RDS instance may vary based on the instance type. If you select the standard SSD or ESSD storage type, the storage capacity of the RDS instance does not vary based on the instance type. For more information, see Primary ApsaraDB RDS instance types.

  9. Optional. If you set the Billing Method parameter to Subscription, configure the Subscription Duration parameter based on your business requirements.

    • Baseline Price: The list price of a subscription RDS instance without any discounts.

    • Preferential Monthly Fee: The monthly price that is calculated based on the baseline price of a subscription RDS instance.

      Note

      The fee is calculated based only on the list price of the RDS instance, which does not include coupons or promotions.

    • Price: You can move the pointer over View Details on the right side of the page to view the estimated total price that is calculated based on the subscription duration and the baseline price of the RDS instance.

  10. Configure other custom parameters. If you do not have special business requirements, you can retain the default values of these parameters.

    Parameter

    Description

    Port

    You can initialize the port when you create the RDS instance. Valid values: 1000 to 5999.

    Release Protection

    If you set the Billing Method parameter to Pay-as-you-go, you can select Release Protection to prevent the RDS instance from being released due to unintended operations. For more information, see Enable or disable the release protection feature.

    Resource Group

    You can use the default resource group or select a custom resource group based on your business requirements.

    Instance Description

    Enter a description for easy identification.

    Character Set Collation Rule

    You can configure the Character Set Collation Rule parameter when you create the RDS instance. Default value: Chinese_PRC_CI_AS. You can also modify the value of the Character Set Collation Rule parameter after you create the RDS instance. For more information, see Change the character set collation and time zone of system databases.

    Tags

    You can add tags to distinguish multiple RDS instances to facilitate instance management. For more information, see Use tags to filter ApsaraDB RDS for SQL Server instances.

    Privileged Account

    If you select Configure Now, you must configure the Database Account, Password, and Confirm Password parameters. If you select Configure Later, you can create a privileged account after the RDS instance is created.

    Note
    • Each RDS instance can have only one privileged account. The privileged account cannot be deleted.

    • For more information about privileged accounts and how to create accounts, see Create a database and an account.

  11. In the upper-right corner of the page, configure the Quantity parameter.

    The default value is 1. You can purchase up to 20 instances at a time. Specify the number of instances based on your business requirements.

  12. Confirm the configurations, quantity, and subscription duration of the RDS instance, read and select ApsaraDB RDS Terms of Service, click Pay Now, and then complete the payment. You must configure the Subscription Duration parameter only when you select the subscription billing method for the RDS instance. The Congratulations or The service is activated message is displayed in the ApsaraDB RDS console.

    Note

    If you select the subscription billing method for the RDS instance, we recommend that you select Enable Auto-renewal. This prevents interruptions on your application even if you forget to renew the RDS instance.

    The auto-renewal cycle is one month for monthly subscription and one year for yearly subscription. The actual auto-renewal cycle in the order prevails. You can disable auto-renewal at any time. For more information, see Use the auto-renewal feature.

  13. View the RDS instance.

    Go to the Instances page. In the top navigation bar, select the region in which the RDS instance resides. Then, find the RDS instance based on the Creation Time parameter.

    Note

    The system requires 1 to 10 minutes to create an RDS instance. You can refresh the page to view the RDS instance that you created.

Old version

Step 1: Configure basic settings

  1. Go to the ApsaraDB RDS buy page of the old version.

  2. Configure the Billing Method parameter.

    Billing method

    Suggestion

    Benefit

    Subscription

    A subscription instance is an instance for which you pay an upfront fee. If you want to use an instance for a long period of time, we recommend that you select the Subscription billing method. If you select the subscription billing method, configure the Subscription Duration parameter in the lower part of the page.

    For long-term use, the subscription billing method is more cost-effective than the pay-as-you-go billing method. You are offered lower prices for longer subscription durations.

    Pay-as-you-go

    You are charged on an hourly basis for a pay-as-you-go RDS instance based on your actual resource usage. If you want to use an RDS instance for a short period of time, we recommend that you select the Pay-as-you-go billing method.

    You can create a pay-as-you-go RDS instance. After you confirm that the created RDS instance meets your business requirements, you can change the billing method of the RDS instance from Pay-as-you-go to Subscription.

    You can release a pay-as-you-go RDS instance based on your business requirements. The billing cycle of a pay-as-you-go RDS instance immediately stops after you release the RDS instance.

    Serverless

    If you want to run scheduled tasks, your business workloads frequently change, or the business workloads are fully managed or do not require O&M, we recommend that you select Serverless. For more information, see Overview of serverless ApsaraDB RDS for SQL Server instances and Create a serverless ApsaraDB RDS for SQL Server instance.

    You are charged based on your consumption of resources for workloads. This can help reduce costs.

    Note

    You can view the price in the lower-right corner of the page. The price is displayed only after you configure all required parameters.

  3. Configure the Region parameter.

    The region in which the RDS instance resides. We recommend that you create the RDS instance in the same region as the ECS instance. If the RDS instance and the ECS instance reside in different regions, these instances cannot communicate over an internal network. As a result, these instances cannot deliver optimal performance.

    Note
    • After an RDS instance is created, you cannot change the region of the RDS instance. If an ECS instance connects to an RDS instance over an internal network, make sure that the RDS instance and the ECS instance reside in the same region.

    • If your application is deployed on an on-premises server or computer, we recommend that you select a region that is in close proximity to the on-premises server or computer. This way, you can use the public endpoint of the RDS instance to connect to the RDS instance from your application.

  4. Configure the Database Engine, Product Type, and Storage Type parameters.

    1. Configure the Database Engine parameter.

      Select Microsoft SQL Server. SQL Server 2008 R2, SQL Server 2012, SQL Server 2016, SQL Server 2017, SQL Server 2019, and SQL Server 2022 are supported.

      Note
      • The available database engines and versions vary based on the region that you select.

      • RDS instances that run SQL Server Basic and SQL Server Web can reside in the classic network and VPCs. RDS instances that run other SQL Server editions can reside only in VPCs, and you must configure the VPC and vSwitch of Primary Node parameters.

    2. Configure the Edition parameter.

      RDS edition

      Description

      Benefit

      RDS Basic Edition

      • The database system consists of only a primary RDS instance. Computing is separated from storage.

      • Read-only RDS instances are not supported.

      RDS Basic Edition is cost-effective and is suitable for learning and testing.

      Note

      RDS instances that run RDS Basic Edition require a long period of time to restart or recover from faults.

      RDS High-availability Edition

      • The database system consists of a primary RDS instance and a secondary RDS instance. These instances work in HA mode and support automatic failover. The secondary RDS instance cannot be accessed.

      • Read-only RDS instances are not supported.

      We recommend that you use the RDS edition. RDS High-availability Edition is suitable for production environments and is suitable for more than 80% of business scenarios.

      RDS Cluster Edition

      • The database system consists of a primary RDS instance and a secondary RDS instance. These instances work in HA mode and support automatic failover. The secondary RDS instances can be accessed. This increases the read capability of your database system.

      • You can create up to seven read-only RDS instances to improve the read capability. However, read-only RDS instances do not participate in the primary instance election or workload switchover.

      • You can manage costs in a flexible manner.

      • Secondary RDS instances are readable.

      Note
      • The available RDS editions vary based on the region and database engine that you select.

      • Serverless RDS instances run only RDS High-availability Edition.

      • For more information, see Overview of ApsaraDB RDS editions.

    3. Configure the Storage Type parameter.

      Item

      ESSD

      Scalability

      • You can increase the storage capacity up to 32 TB.

      • No transient connections occur during storage capacity expansion.

      • You can upgrade, downgrade, create, or release the RDS instance within minutes.

      • Automatic storage expansion is supported.

      Performance

      • PL1<PL2<PL3

      • A PL2 ESSD delivers twice the IOPS and throughput of a PL1 ESSD.

      • A PL3 ESSD delivers IOPS that is up to 20 times the IOPS delivered by a PL1 ESSD. A PL3 ESSD also delivers throughput that is up to 11 times the throughput delivered by a PL1 ESSD.

      Backup

      • A backup can be completed within minutes or seconds.

      • The highest backup frequency is one backup every 15 minutes.

      Note
  5. Select a zone for the instance and configure the Deployment Method parameter.

    • Select a zone.

      A zone is an independent physical area within a region. For example, the China (Hangzhou) region contains Zone H, Zone I, and Zone J.

      • No significant differences exist between the zones in the same region.

      • If the RDS instance resides in the same zone as the ECS instance that you want to connect, these instances can deliver optimal performance. If the RDS instance and the ECS instance reside in different zones in the same region, the performance of these instances slightly decreases.

    • Select a deployment method.

      • Multi-zone Deployment: We recommend that you use the deployment method. The primary RDS instance and the secondary RDS instance reside in different zones of a region to provide cross-zone disaster recovery.

        If you set the Deployment Method parameter to Multi-zone Deployment, you must configure the Zone of Primary Node and Zone of Secondary Node parameters.

      • Single-zone Deployment: The primary RDS instance and the secondary RDS instance reside in the same zone.

        If you select Basic Edition, you can select only the Single-zone Deployment method.

      Note
      • If your database system consists of primary and secondary RDS instances, we recommend that you select Multi-zone Deployment to implement cross-zone disaster recovery.

      • If Sold Out appears in the upper-right corner of a zone name, this zone does not have sufficient resources. Switch to another zone.

  6. Configure the Instance Type parameter.

    1. Configure the Category parameter. Valid values: General-purpose, Dedicated, and Shared. The available instance types vary based on the RDS edition and database engine. Refer to the available instance types in the ApsaraDB RDS console.

      Instance type

      Description

      Benefit

      General-purpose

      A general-purpose RDS instance occupies all the allocated memory and I/O resources.

      A general-purpose RDS instance shares CPU and storage resources with the other general-purpose RDS instances that are deployed on the same host.

      RDS instances of the general-purpose instance type are cost-effective.

      Dedicated

      A dedicated RDS instance occupies all the allocated CPU, memory, storage, and I/O resources.

      Note

      The dedicated host instance family is the highest configuration of the dedicated instance family. A dedicated host RDS instance exclusively occupies all the CPU, memory, storage, and I/O resources of the host on which the RDS instance is deployed.

      RDS instances of the dedicated instance type provide higher performance and higher stability.

      Note

      An RDS instance that runs RDS Basic Edition does not support the dedicated instance family.

      Shared

      A shared RDS instance exclusively occupies the allocated memory and storage resources.

      A shared RDS instance shares CPU resources with other RDS instances that are deployed on the same host.

      A shared RDS instance is cost-effective but delivers moderate stability.

    2. Configure detailed specifications, including CPU cores, memory capacity, and maximum number of connections.

  7. Configure the Storage Capacity parameter.

    The storage capacity is used to store data files, system files, archived log files, and transaction files. The valid values of the Storage Capacity parameter vary based on the values of the Storage Type and Instance Type parameters that you specify. You can adjust the storage capacity at a step size of 5 GB.

    Note

    If you select the local SSD storage type, the storage capacity of the RDS instance may vary based on the instance type. If you select the standard SSD or ESSD storage type, the storage capacity of the RDS instance does not vary based on the instance type. For more information, see Primary ApsaraDB RDS instance types.

  8. Optional. If you set the Billing Method parameter to Subscription, configure the Subscription Duration parameter based on your business requirements.

  9. In the lower-right corner of the page, click Next: Instance Configuration.

Step 2: Configure advanced settings

  1. Configure the Network Type parameter. The Network Type parameter is fixed as VPC.

    1. Configure the VPC and vSwitch of Primary Node parameters.

      We recommend that you select the VPC in which your ECS instance resides for the RDS instance. If the RDS instance and the ECS instance reside in different VPCs, these instances cannot communicate over an internal network.

      Note
      • You can connect the RDS instance and the ECS instance over an internal network even if the instances use different vSwitches in the same VPC.

      • If you set the Deployment Method parameter to Multi-zone Deployment in the Basic Resources step, you must also configure the vSwitch of Secondary Node parameter.

    2. Configure the Add to Whitelist parameter to specify whether to add the CIDR block of the selected VPC to a whitelist of the RDS instance.

      If you set this parameter to Yes, the ECS instances that reside in the selected VPC can access the RDS instance.

      Note

      If you set the Add to Whitelist parameter to No, you can configure a whitelist after the RDS instance is created. For more information, see Configure an IP address whitelist.

    3. Configure the Port parameter.

      You can initialize the port when you create the RDS instance. Valid values: 1000 to 5999.

  2. Configure other custom parameters. If you do not have special business requirements, you can retain the default values of these parameters.

    Parameter

    Description

    Release Protection

    If you set the Billing Method parameter to Pay-as-you-go, you can select Release Protection to prevent the RDS instance from being released due to unintended operations. For more information, see Enable or disable the release protection feature.

    Resource Group

    You can use the default resource group or select a custom resource group based on your business requirements.

    Instance Description

    Enter a description for easy identification.

    Tag

    You can add tags to distinguish multiple RDS instances to facilitate instance management. For more information, see Use tags to filter ApsaraDB RDS for SQL Server instances.

    Privileged Account

    If you select Configure Now, you must configure the Database Account, Password, and Confirm Password parameters. If you select Configure Later, you can create a privileged account after the RDS instance is created.

    Note
    • Each RDS instance can have only one privileged account. The privileged account cannot be deleted.

    • For more information about privileged accounts and how to create accounts, see Create a database and an account.

  3. In the lower-right corner of the page, click Next: Confirm Order.

Step 3: Confirm the order

  1. Confirm the configuration of the RDS instance in the Parameter Configuration section, configure the Quantity and Subscription Duration parameters, read and select Terms of Service, and then click Pay Now to complete the payment. You must configure the Subscription Duration parameter only if you select the subscription billing method for the RDS instance.

    Note

    If you select the subscription billing method for the RDS instance, we recommend that you select Auto-renewal. This way, you can prevent interruptions on your workloads even if you forget to renew the RDS instance.

    The auto-renewal cycle is one month for monthly subscription and one year for yearly subscription. The actual auto-renewal cycle in the order prevails. You can disable auto-renewal at any time. For more information, see Use the auto-renewal feature.

  2. View the RDS instance.

    Go to the Instances page. In the top navigation bar, select the region in which the RDS instance resides. Then, find the RDS instance based on the Creation Time parameter.

    Note

    The system requires 1 to 10 minutes to create an RDS instance. You can refresh the page to view the RDS instance that you created.

2. Create a database

  1. Log on to the ApsaraDB RDS console and go to the Instances page. In the top navigation bar, select the region in which the RDS instance created in Step 1 resides. Then, find the RDS instance and click the instance ID.

    image

  2. In the left-side navigation pane of the page that appears, click Databases. On the page that appears, click Create Database.

  3. In the Create Database panel, configure the required parameters.

    In this topic, you can set the Database Name parameter to dbtest and the Supported Character Set parameter to Chinese_PRC_CI_AS. Then, click Create.

    image

  4. On the Databases page, view the database that you create.

3. Create an account

  1. In the left-side navigation pane of the instance details page, click Accounts.

  2. On the page that appears, click Account Password Policy to configure a password policy in advance. The password policy is used to manage the validity period of the password and enhance account security.

    Note

    Password policies are not supported for shared and serverless RDS instances. If the RDS instance that you create belongs to the shared instance family or is a serverless RDS instance, you do not need to configure password policies for the RDS instance. For more information, see Instance families and Serverless ApsaraDB RDS for SQL Server instances. For more information, see Configure a password policy for an account

    View the configuration example

    If you want to reset a password every 90 days and use a password for at least 30 days after each password change, set the Maximum password usage time parameter to 90 and the Minimum password usage time parameter to 30.

    image

  3. Click Create Account. In the panel that appears, configure the parameters.

    Note

    If the username of the account already exists or an account creation task is in progress, an error message may be displayed. If the error message is displayed, check whether the username of the account already exists or whether an account creation task is in progress.

    image

    1. Configure the Database Account parameter. In this topic, the value is set to testuser.Database Account

    2. Configure the Account Type parameter. ApsaraDB RDS for SQL Server supports Privileged Account, Standard Account, and system admin accounts. In this topic, the value is set to Privileged Account. For more information about how to create a standard account or a system admin account, see Accounts and permissions.

      Important

      The first account that you create for an RDS instance must be a privileged account, and only one privileged account can be created for an RDS instance. A privileged account has the read and write permissions on all databases of an RDS instance. If a privileged account fails to be created for an RDS instance, a privileged account is already created for the RDS instance.

    3. Configure the New Password and Confirm Password parameters.

    4. Apply the password policy that you configured in Step 2 to the privileged account.

  4. Click OK.

  5. Refresh the Accounts page to view the privileged account that you create.

    image

4. Configure secure connections to the RDS instance

If you want to use a CLI or a client to connect to the RDS instance, you must add the IP address of your Elastic Compute Service (ECS) instance or your on-premises device to an IP address whitelist of the RDS instance. Then, you can obtain the internal endpoint or public endpoint of the RDS instance based on the connection type and use the endpoint to connect to the RDS instance. If you want to use Data Management (DMS) to connect to the RDS instance, go to Step 5.

4.1 Configure an IP address whitelist

  1. In the left-side navigation pane of the instance details page, click Whitelist and SecGroup.

  2. Click Create Whitelist. In the dialog box that appears, configure the Whitelist Name and IP Addresses parameters.

    image

    Obtain common IP addresses

    Scenario

    IP address to be obtained

    Method to obtain the IP address

    You want to connect to the RDS instance from an ECS instance that is accessible over an internal network.

    Private IP address of the ECS instance

    1. Log on to the ECS console and go to the Instances page.

    2. In the top navigation bar, select the region in which the ECS instance resides.

    3. View the public IP address and private IP address of the ECS instance.

    You want to connect to the RDS instance from an ECS instance that is inaccessible over an internal network.

    Public IP address of the ECS instance

    You want to connect to the RDS instance from an on-premises device.

    Public IP address of the on-premises device

    On the on-premises device, use a search engine such as Google to search for IP.

    Note

    The IP address that is obtained by using this method may be inaccurate.

  3. Click OK.

  4. Refresh the Whitelist and SecGroup page to view the IP address whitelist that you create.

    image

4.2 Select a connection type

You can connect to the RDS instance over an internal network or the Internet. If you want to connect to the RDS instance over an internal network, you must use the internal endpoint of the RDS instance. If the conditions for communication over an internal network are not met or you want to connect to the RDS instance from an on-premises device, you must use the public endpoint of the RDS instance. The following list describes the conditions that must be met to connect to an RDS instance over an internal network and how to obtain the internal endpoint and public endpoint of the RDS instance.

Important

If you want to connect to the RDS instance over an internal network, make sure that the following conditions are met:

  • If you want to connect to the RDS instance from an ECS instance, make sure that the ECS instance and the RDS instance reside in the same region and use the same network type.

  • If the ECS instance and the RDS instance use the virtual private cloud (VPC) network type, make sure that the instances reside in the same VPC.

Scenario

Endpoint to be obtained

Method to obtain the endpoint

You want to connect to the RDS instance, and the conditions for communication over an internal network are met.

Internal endpoint of the RDS instance

In the left-side navigation pane of the instance details page, click Database Connection to view the internal and public endpoints and ports of the RDS instance.

image

Note

The public endpoint is displayed only after you click Apply for Public Endpoint to apply for a public endpoint for the RDS instance.

You want to connect to the RDS instance from an ECS instance, but the conditions for communication over an internal network are not met.

Public endpoint of the RDS instance

You want to connect to the RDS instance from an on-premises device.

5. Connect to the RDS instance

You can use DMS or a client to connect to the RDS instance.

Method 1: Use DMS to connect to the RDS instance

DMS is a one-stop data management platform that allows you to manage data throughout its lifecycle. You can use DMS to manage global data assets, govern data, design and develop databases, integrate data, develop data, and consume data. These features help enterprises obtain value from data in an efficient and secure manner and facilitate the digital transformation of enterprises. For more information, see What is DMS?

You can use DMS to log on to your RDS instance to manage and use data without the need to configure IP address whitelists or connection types for the RDS instance.

  1. Go to the Instances page. In the top navigation bar, select the region in which the RDS instance resides. Then, find the RDS instance and click the ID of the instance.

  2. On the page that appears, click Log On to Database.

    image..png

  3. In the Log on to Database Instance dialog box, enter the logon information and click Login.

    image

    • Configure the Access Mode parameter. In this topic, Account + password login is selected.

    • Configure the Database Account and Database Password parameters. In this topic, a privileged account named testuser and a custom password are used.

    • Configure the Control Mode parameter. In this topic, Flexible Management is selected.

      Note
      • If your RDS instance is managed in Flexible Management mode, you can use DMS to manage the instance free of charge. If your RDS instance is managed in Stable Change or Security Collaboration, fees are generated. For more information, see Pricing.

      • Compared with the Flexible Management mode, the Stable Change and Security Collaboration modes provide more features and enhanced database management capabilities. If your RDS instance is for trial use, we recommend that you select Flexible Management. For more information, see Control modes.

  4. View the database. In the left-side navigation pane of the DMS console, choose Database Instances > Instances Connected to view the database that you create. In this topic, the database named dbtest is displayed. You can also double-click a database.

    image

    Note

    If the RDS instance exists but the required database is not displayed on the Instance Connected page of the DMS console, troubleshoot the issue based on the following information:

    • The logon account does not have the permissions to connect to the required database. In this case, you can go to the Accounts page of the RDS instance, find the logon account, and then click Change Permissions in the Actions column to grant the required permissions. For more information, see Modify the permissions of an account.

    • The metadata of the required database is not synchronized. In this case, move the pointer over the RDS instance to which the required database belongs and click the image icon to the right of the instance name. Then, you can find the required database.

Method 2: Use the SSMS client to connect to the RDS instance

Microsoft SQL Server Management Studio (SSMS) client is a GUI tool that enables you to manage and handle SQL Server databases. SSMS can be used to connect to different SQL Server databases such as RDS instances, on-premises SQL Server instances, and instances that run SQL Server in other clouds. For more information, see Download SQL Server Management Studio (SSMS).

This section provides an example on how to use SSMS 19.0 to connect to an RDS instance.

Note
  • We recommend that you download the latest version of SSMS to support all SQL Server versions.

  • If you want to use a client to connect to an RDS instance, you must configure an IP address whitelist for the RDS instance and obtain the endpoint of the RDS instance based on your business requirements.

  1. Start the SSMS 19.0 client.

  2. Choose Connect > Database Engine.

  3. In the Connect to Server dialog box, configure the parameters that are required for the logon.

    Parameter

    Example value

    Description

    Server name

    rm-2ze****.rds.aliyuncs.com,1433

    The endpoint and port number of the RDS instance. Enter the public endpoint and public port number obtained when you apply for the public endpoint. Separate the endpoint and port number with a comma (,).

    Authentication

    SQL Server Authentication

    The authentication mode of SQL Server.

    Username

    testuser

    The username of the account for the RDS instance.

    Password

    Test_pw123

    The password of the account for the RDS instance.

  4. Click Connect.

    After the connection is successful, the connection information is displayed on the left side of SSMS.

What to do next

Appendix: Video tutorial on getting started with ApsaraDB RDS for SQL Server

FAQ

How do I view the total number of RDS instances within my Alibaba Cloud account?

Log on to the ApsaraDB RDS console. On the Overview page, you can view the total number of RDS instances that run different database engines within your Alibaba Cloud account. On this page, you can also view the regions in which the RDS instances are created and the number of running RDS instances in each region.

image

After I create an RDS instance, why am I unable to find the RDS instance?

Possible cause

Description

Suggestion

Incorrect region

The RDS instance does not reside in the region that you selected in the top navigation bar of the ApsaraDB RDS console.

In the top navigation bar, select the region in which the RDS instance resides.

Insufficient resources

The zone that you selected cannot provide sufficient resources.

If the RDS instance cannot be created, you can go to the Orders page in the Billing Management console to view the refunded fees.

Select a different zone and try again.

RAM policies that do not allow users to create unencrypted RDS instances

RAM policies that do not allow users to create unencrypted RDS instances are attached to a RAM user.

  • If you use the credentials of the RAM user to create an RDS instance that uses local disks, the RDS instance cannot be created. When you create an RDS instance that uses local disks, you cannot enable cloud disk encryption.

  • If you use the credentials of the RAM user to create an RDS instance that uses cloud disks and you do not enable cloud disk encryption for the RDS instance, the RDS instance cannot be created.

For more information, see Use RAM policies to manage the permissions of RAM users on ApsaraDB RDS instances.

When you create an RDS instance, select the standard SSD or ESSD storage type, select Cloud Disk Encryption, configure the Key parameter, and then try again.

Do serverless RDS instances support all features of regular RDS instances?

No, serverless RDS instances do not allow you to change time zones and character sets, connect to self-managed domains, configure Transparent Data Encryption (TDE), SSL encryption, and cloud disk encryption, upgrade major engine versions, or update minor engine versions.

References