All Products
Search
Document Center

ApsaraDB RDS:Database attribute management

Last Updated:Feb 28, 2026

ApsaraDB RDS for SQL Server provides a GUI-based interface that allows you to view and modify database-level attributes directly from the ApsaraDB RDS console, without writing T-SQL statements. You can configure basic settings, review runtime metrics, and adjust advanced options such as snapshot isolation, delayed durability, and accelerated database recovery. You can also manually shrink database transaction logs and update database statistics to optimize performance and improve query efficiency.

For the full list of database attributes and their SQL Server equivalents, see sys.databases (Transact-SQL) in the Microsoft documentation.

Prerequisites

You have created a database on your ApsaraDB RDS for SQL Server instance.

View or modify attributes

Usage notes

When you modify certain database attributes, the database temporarily enters the exclusive mode. During this period, the system closes all connections to the database and rolls back existing transactions for the modifications to take effect. If the database is under heavy load, the modifications may fail. To prevent business interruptions, we recommend that you perform attribute modifications during off-peak hours.

Note

When a database enters the exclusive mode, only one user or process can access and manage the database. Other users or processes can access the database only after all operations on it are completed.

Procedure

  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. Find the database that you want to manage and click View Details in the Actions column.

    Note

    For more information about the database attributes, see Appendix: Database attributes in this topic or sys.databases (Transact-SQL) in the Microsoft documentation.

    View database attributes

  4. In the Allowed Values column, modify the attribute values and click Submit.

    Modify database attributes

Shrink database transaction logs

Transaction log files can accumulate unused space over time. You can shrink database transaction logs to reclaim disk space when the following conditions are met:

  • The transaction log files use only a small portion of their total allocated storage. Compare the LogUsedSizeInMB value (space used by transaction log files) against the TotalLogSizeInMB value (total space allocated for transaction log files) to assess this.

  • The log_reuse_wait_desc attribute of the database is set to Nothing, which means the transaction log has no pending operations preventing reuse.

Procedure

  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. In the Actions column, choose More > Shrink Database Transaction Logs.

  4. In the message that appears, click OK.

Update database statistics

The amount and distribution of data in a database change over time. To ensure that the query optimizer generates accurate and efficient execution plans, you must update database statistics on a regular basis.

When to use

Consider manually updating database statistics in the following scenarios:

  • After a major engine version upgrade: A new engine version may introduce new data types, storage engines, or query optimizers. The original database statistics may become inaccurate or unavailable. Update the statistics to adjust data distribution for the new engine.

  • After migrating a self-managed database to the cloud: The change in environment may require statistics to be refreshed for optimal query performance and query plan generation.

  • When automatic statistics updates are insufficient: This can happen when:

    • Business data is unevenly distributed.

    • You perform many DELETE or UPDATE operations, but the volume of modified data does not exceed 20% of the table, which may not trigger the automatic update threshold.

    • The automatic statistics update feature of SQL Server is no longer applicable to your workload pattern.

Note

By default, SQL Server enables automatic statistics updates. However, the automatic update frequency may be lower than the rate at which your data changes, which can lead to poor query performance. For more information, see Statistics in the Microsoft documentation.

Usage notes

Updating database statistics may cause heavy I/O loads. To prevent service interruptions, we recommend that you perform this operation during off-peak hours.

Procedure

  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. In the Actions column, click More > Update Database Statistics.

  4. In the message that appears, click OK.

Appendix: Database attributes

Basic information

AttributeDescriptionDefault value
page_verify

The page-level verification method for the database. Uses the checksum of each data page for integrity verification.

CHECKSUM
target_recovery_time_in_secondsThe target recovery time for the database, in seconds.60
compatibility_levelThe database compatibility level, which determines the behavior of T-SQL features. Valid values: 100 (SQL Server 2008 or later), 110 (SQL Server 2012 or later), 120 (SQL Server 2014 or later), 130 (SQL Server 2016 or later), 140 (SQL Server 2017 or later), 150 (SQL Server 2019 or later), 160 (SQL Server 2022 or later), 170 (SQL Server 2025 or later).-
parameterizationThe parameterization behavior for SQL queries. SIMPLE: Parameterizes only queries with simple constant parameters. FORCED: Forces parameterization for all queries.SIMPLE
read_committed_snapshotSpecifies whether to use row versioning for READ COMMITTED isolation. OFF: Uses read locks for the READ COMMITTED isolation level. ON: Enables READ COMMITTED SNAPSHOT ISOLATION. Concurrent read operations are allowed and are not blocked by write operations.OFF
collation_nameThe character set collation and character encoding of the database. For more information, see Change the character set collation and time zone of system databases.-
auto_closeSpecifies whether to automatically close the database when no users are connected. When set to OFF, the database remains open.OFF
recovery_model_descThe recovery model of the database. Enables full recovery and supports point-in-time restore.FULL
auto_update_statisticsSpecifies whether to enable automatic statistics updates. Valid values: ON, OFF.ON
auto_update_statistics_asyncSpecifies whether to update statistics asynchronously. OFF: Updates statistics synchronously. Queries wait for the statistics update to complete before execution. ON: Updates statistics asynchronously. Queries proceed with existing statistics while the update runs in the background.OFF
allow_snapshot_isolationSpecifies whether to enable the SNAPSHOT isolation level. Valid values: OFF, ON.OFF
state_descThe current status of the database. The value ONLINE indicates that the database is online and available.-
create_dateThe date and time when the database was created.-
log_reuse_wait_descThe reason why the transaction log cannot be reused. The value NOTHING indicates that no conditions are preventing log reuse.-

Runtime information

AttributeDescriptionUnit
TotalDataSizeInMBThe total space allocated for the data files of the database.MB
DataUsedSizeInMBThe space used by the data files of the database.MB
TotalLogSizeInMBThe total space allocated for the transaction log files of the database.MB
LogUsedSizeInMBThe space used by the transaction log files of the database.MB
VLFCountThe number of virtual log files (VLFs) in the database.-
LastestBackupTimeThe date and time of the most recent backup of the database.-
LastestBackupTypeThe type of the most recent database backup. Valid values: D (Full backup), I (Differential backup), L (Log backup).-

Advanced information

AttributeDescriptionDefault value
accelerated_database_recoverySpecifies whether to enable Accelerated Database Recovery (ADR). ADR uses versioned storage and logical rollback to achieve near-instant database recovery, which significantly reduces downtime caused by restarts or failures. ADR is suitable for online transaction processing (OLTP) systems that frequently handle long-running transactions and require high availability. Valid values: OFF, ON.
Note

This feature is supported only on Standard Edition and Enterprise Edition instances that run SQL Server 2019 or later. Enabling ADR can significantly reduce recovery time for scenarios with long-running transactions and improve system availability. However, it increases storage consumption and introduces minor performance overhead.

OFF
ansi_nullsSpecifies whether to enable ANSI NULL behavior. When enabled, comparisons with NULL always return UNKNOWN instead of TRUE or FALSE. Valid values: OFF, ON.OFF
recursive_triggersSpecifies whether to allow triggers to fire recursively. Valid values: OFF, ON.OFF
delayed_durabilitySpecifies whether to enable delayed durability. When enabled, transactions write to the transaction log asynchronously after commit, which improves transaction throughput. DISABLED: Transactions are fully durable. After a commit, data is synchronously written to disk at the earliest opportunity. ALLOWED: Enables delayed durability on a per-transaction basis. Individual transactions can opt in. FORCED: All transactions use delayed durability.
Important

Enabling delayed durability (ALLOWED or FORCED) may result in data loss if the server fails before the transaction log is flushed to disk. Evaluate the trade-off between performance and durability for your workload.

DISABLED
ansi_warningsSpecifies whether to enable ANSI warnings. When enabled, warnings are raised for conditions such as null values in aggregate functions or divide-by-zero errors. Valid values: OFF, ON.OFF
ansi_null_defaultSpecifies whether new columns default to allowing NULL values when no explicit NULL or NOT NULL constraint is specified. Valid values: OFF, ON.OFF
ansi_paddingSpecifies whether to enable ANSI padding for character columns. When enabled, trailing spaces in varchar values and trailing zeros in varbinary values are preserved. Valid values: OFF, ON.OFF
optimized_lockingSpecifies whether to enable optimized locking. Optimized locking reduces lock memory consumption and blocking between concurrent transactions. Valid values: OFF, ON.
Note

This feature is supported only on instances that run SQL Server 2022 or later.

OFF
db_ownerThe owner of the database. The database owner has the highest level of permissions, including deleting the database, modifying all objects, and managing user permissions. The default value is typically the account that created the database. The owner must be a valid user account in the current instance.
Note

Modifying the db_owner attribute directly changes the ownership identity of the database, which affects the principal to which the database belongs. This is different from setting the permission of an account to "Owner" for a database on the Account Management page, which assigns the db_owner role to the target account. Assigning the role is a permission grant and does not change the ownership principal of the database.

-
concat_null_yields_nullSpecifies whether concatenating a value with NULL returns NULL. When enabled, any string concatenation involving NULL produces a NULL result. Valid values: OFF, ON.OFF

Related API operation

You can modify the attributes of an ApsaraDB RDS for SQL Server database by calling the ModifyDatabaseConfig API operation.