All Products
Search
Document Center

ApsaraDB RDS:Create a database

Last Updated:Nov 27, 2025

After you create an ApsaraDB RDS for SQL Server instance, you must create a database on the instance. This topic describes how to create a database on an RDS instance and explains the limits on the number of databases you can create.

Prerequisites

An RDS instance is created. For more information, see Create an ApsaraDB RDS for SQL Server instance.

Limits on the number of databases

An RDS instance that runs SQL Server 2008 R2 supports up to 50 databases. If your RDS instance runs other SQL Server versions, the maximum number of databases varies based on the RDS edition. You can use the following formulas to calculate the maximum number of databases:

  • RDS Cluster Edition/RDS High-availability Edition

    You must extract the square root of the number of CPU cores, round the square root down to the integer, and then multiply the integer by 50. Assume that the obtained value is X. In this example, the maximum number of databases equals the smaller value between X and 300. For example, if your RDS instance runs SQL Server 2016 SE on RDS High-availability Edition and provides 4 CPU cores and 8 GB of memory, the RDS instance supports a maximum of 100 databases.

  • RDS Basic Edition

    You must extract the square root of the number of CPU cores, round the square root down to the integer, and then multiply the integer by 100. Assume that the obtained value is X. In this example, the maximum number of databases equals the smaller value between X and 400. For example, if your RDS instance runs SQL Server 2019 SE on RDS Basic Edition and provides 4 CPU cores and 8 GB of memory, the RDS instance supports a maximum of 200 databases.

Note

min in the preceding formulas indicates that the smaller value between two values is used. For example, the value of min{100,300} is 100.

Create a database

  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. In the left-side navigation pane, click Databases.

  3. Click Create Database, configure the following parameters, and then click Create.

    Parameter

    Description

    Database Name

    The name of the database. The name must be 2 to 64 characters in length and can contain letters, digits, underscores (_), and hyphens (-). The database name cannot contain Chinese characters. The name must start with a letter and end with a letter or a digit.

    Supported Character Set

    The character set of the database.

    Description

    The description of the database. The description can be up to 256 characters in length.

Related operations

  • You can also call the CreateDatabase operation to create a database on an RDS instance.

  • You can use various methods such as Data Management (DMS) and Microsoft SQL Server Management Studio (SSMS) to connect to an RDS instance.

FAQ

How do I resolve the error The current database name is incorrect. Please reset the database name.?

Issue description

When creating a database on the Databases page of an RDS SQL Server instance, the error message The current database name is incorrect. Please reset the database name. appears with error code InvalidDBName.Duplicate.

image

Cause

The database cannot be created because a database with the same name already exists.

The Databases page of an RDS SQL Server instance only displays databases with ONLINE status. Databases with non-ONLINE status (such as RESTORING, RECOVERING, OFFLINE, etc.) are not displayed in the console. This might lead users to mistakenly believe that the database does not exist, resulting in creation failure.

Solution

  1. Connect to the SQL Server instance using SSMS.

  2. Execute the following SQL to view non-system databases and their status:

    SELECT
        [name] AS DatabaseName,  -- Database name
        state_desc AS StateDescription,  -- Current database status (such as ONLINE, OFFLINE, RECOVERING, etc.)
        recovery_model_desc AS RecoveryModel  -- Database recovery model (such as SIMPLE, FULL, etc.)
    FROM
        sys.databases
    WHERE
        database_id > 4; -- Filter out system databases

    As shown below, the query results will confirm whether a database with the same name exists and its current status.

    image

  3. For databases with non-ONLINE status that have the same name, resolve the issue based on different scenarios:

    • Scenario 1: OSS backup data recovery to cloud with the option to not open the database

      • Cause

        When using OSS backup data recovery to RDS SQL Server, if you select the Access Pending (Incremental Backup) option, the database will be in a non-ONLINE state.

        image

      • Solution

        If you need to continue uploading incremental backup files, you need to open the database from the Cloud Migration Records of Backup Data tab after the recovery is complete. If you no longer need incremental recovery, you can open the database directly.

        image

        If this database is no longer needed and you want to recreate it, you can open the database and then delete the database. After deletion, you can create a new database.

    • Scenario 2: Database enters RECOVERING state due to log space being full

      • Cause

        When log space is full, logs cannot be written, and the database enters the RECOVERING state. You can confirm this by checking the instance error logs:

        image

      • Solution

        • If the instance space is full and log space cannot be expanded, you need to expand the instance storage space and then manually restart the instance. After restart, the RECOVERING process will continue, and when recovery is complete, the database will return to ONLINE status.

        • If the database log file has a growth limit set and the log space is full, but the instance space is not full, you only need to adjust the database log space limit without restarting the instance. The steps to adjust the database file limit are as follows:

          image

          image

          image

        If this database is no longer needed and you want to recreate it, wait until the database status becomes ONLINE, then delete the database. After deletion, you can create a new database.

    • Scenario 3: Database manually set to OFFLINE status

      • Cause

        The database might have been manually set to OFFLINE status by an administrator.

      • Solution

        Use the sp_rds_set_db_online stored procedure to set the database back to ONLINE status:

        USE master;
        GO
        EXEC sp_rds_set_db_online 'database_name';
        GO

        If this database is no longer needed and you want to recreate it, wait until the database status becomes ONLINE, then delete the database. After deletion, you can create a new database.

What do I do if the error message Due to the limit number you can't create a database is displayed when I create a database?

  • Cause: The error message appears because the number of databases on your RDS instance has reached the upper limit supported by the current instance specifications. The number of databases you can create on an RDS instance is restricted by the instance specifications. For more information about calculating the maximum number of databases you can create, see the Limits on the number of databases section of this topic.

  • Solution: You can upgrade the specifications of your RDS instance to increase the maximum number of databases you can create.

When I create a database on an RDS instance, can I use Chinese characters for the database name?

No, you cannot use Chinese characters for the database name. Using Chinese characters may cause compatibility issues, script parsing difficulties, migration risks, and increased management complexity. The name of a database on an RDS instance must be 2 to 64 characters in length and can contain letters, digits, underscores (_), and hyphens (-). The name must start with a letter and end with a letter or digit. You must follow these naming conventions to ensure system stability and maintainability.