All Products
Search
Document Center

ApsaraDB RDS:FAQ about storage capacity

Last Updated:Jul 19, 2024

This topic provides answers to some frequently asked questions about the storage capacity of ApsaraDB RDS instances.

Can I expand the storage capacity of my RDS instance without data migration? What are the impacts of an expansion?

If the host on which your RDS instance is deployed can provide sufficient storage resources, data migration is not required. If the host cannot provide sufficient storage resources, the system creates an RDS instance on a host that can provide sufficient storage resources and migrates the data of your RDS instance to the new RDS instance that has the required storage capacity.

What are the billing rules for storage capacity expansion?

After you expand the storage capacity of your RDS instance, the fee that is generated for the RDS instance changes. For more information, see Billing details about configuration change.

How do I troubleshoot an abrupt increase in storage usage?

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

  2. In the left-side navigation pane of the page that appears, click Monitoring and Alerts. On the page that appears, view the storage usage of different data types and trends of storage usage.

How do I release storage by deleting files?

I created an empty database on my RDS instance, but the database occupies storage. Why?

When the database is initialized, system tables are created to store information about accounts and permissions. In addition, the logs of the database system, such as redo logs and undo logs, occupy storage.

Why more storage is occupied by MySQL databases when data is imported from other heterogeneous databases?

Different database storage engines process data in different ways. For example, the compression feature and indexes on some fields affect the storage usage.

Does the storage capacity of an RDS instance include backup storage?

The value of the Storage Capacity parameter does not count backup storage. To view the value of this parameter, perform the following operations: Log on to the ApsaraDB RDS console, go to the Basic Information page of your RDS instance, and then locate the Storage Capacity parameter in the Usage Statistics section. For more information about the backup storage usage, see View and manage the size of backup files.

After the storage capacity of my RDS instance is exhausted, how long does it take for the RDS instance to enter the Locking state?

When the storage capacity of an RDS instance is exhausted, the RDS instance is automatically locked and enters the Locking state. However, the RDS instance may be locked at a specific latency due to the inspection mechanism.

If an RDS instance is locked, you cannot write data to the RDS instance. We recommend that you configure alerts to prevent your RDS instance from being locked before the storage capacity of the RDS instance is exhausted. For more information, see Configure alerting. In addition, you can configure automatic storage expansion for the RDS instance. If the storage usage of the RDS instance reaches a threshold, the system automatically expands the storage capacity of the RDS instance. For more information, see the following topics:

If the RDS instance runs MySQL, you can enable the automatic fragment reclamation feature to recycle tablespace fragments and reduce storage wastes. For more information, see Use the automatic fragment reclamation feature.

After I delete a large amount of data on an RDS instance that runs SQL Server, why is the occupied disk space not reclaimed?

After you execute the DELETE statement to delete a large amount of data on an RDS instance that runs SQL Server, the reason why the occupied disk space is not reclaimed is related to the design mechanism of the database management system and the behaviors recorded in logs.

  • Records in transaction logs: To ensure data consistency and data restorability, all operations including the DELETE operation are recorded in logs. In this case, even if a specific amount of data on your RDS instance is deleted, relevant logs still occupy the disk space, and the disk usage may increase.

  • Unreleased data pages: The data of an RDS instance that runs SQL Server is stored in data pages. If the data is deleted, the data pages that store the data are labeled as reusable instead of being immediately reclaimed. This helps improve the efficiency of subsequent insert operations and avoid frequent recycling operations on physical disks. Even if a specific amount of data on your RDS instance is logically deleted, the occupied disk space is not immediately reclaimed.

  • Tables and index fragments: After a specific amount of data on your RDS instance is deleted, holes may be left in the tables and indexes of the RDS instance. This results in fragmented storage. The fragmented storage is considered allocated by the database system.

To reclaim the fragmented storage, we recommend that you perform the following operations:

  • Shrink databases or file groups: Execute the DBCC SHRINKDATABASE or DBCC SHRINKFILE statement to reclaim unused disk space and reduce the size of data files.

    Important

    This process may be time-consuming, and frequent shrinking operations may adversely affect the performance of your RDS instance. For more information, see Solves the problem that SQL Server instances are locked when the storage space is full or Troubleshoot insufficient storage space issues on an ApsaraDB RDS for SQL Server instance.

  • Recreate indexes: After you delete a large amount of data on your RDS instance, the indexes may become fragmented. Recreating indexes helps reorganize data pages, reclaim disk space, and improve query efficiency.

  • Back up transaction logs: For databases that use the full recovery model, the transaction logs that are backed up on a regular basis can be truncated to free up the storage occupied by logs. For more information, see Manage logs.

  • Execute the TRUNCATE TABLE statement: The TRUNCATE TABLE statement is more efficient than the DELETE statement in specific scenarios. You can execute the TRUNCATE TABLE statement to release data pages in a quicker manner without generating a large number of logs.

    Important

    The execution of the TRUNCATE statement is irreversible and does not support the WHERE clause.

If you want to reclaim occupied disk space for your RDS instance in an efficient manner, you must take various measures based on your business requirements. This helps optimize the disk space of the RDS instance.