By using AWS re:Post, you agree to the AWS re:Post Terms of Use

How can I decrease the total provisioned storage size of my Amazon RDS DB instance?

2 minute read
0

I want to decrease the total allocated storage size of my Amazon Relational Database Service (Amazon RDS) DB instance. How can I do this?

Short description

After you create an Amazon RDS DB instance, you can't modify the allocated storage size of the DB instance to decrease the total storage space it uses. To decrease the storage size of your DB instance, create a new DB instance that has less provisioned storage size. Then, migrate your data into the new DB instance using one of the following methods:

  • Use the database engine's native dump and restore method. This method causes some downtime.
  • Use AWS Database Migration Service (AWS DMS) for minimal downtime.

Resolution

DB dump and restore

  1. Open the Amazon RDS console, and then choose Databases from the navigation pane.
  2. Choose Create database.
  3. Launch a new Amazon RDS DB instance that has a smaller storage size than your existing DB instance.
  4. Use your database engine's native tools to dump your existing DB instance (the instance you want to decrease in size).
  5. Optionally, you can rename your old DB instance, and then name the new DB instance using the old DB instance's name. Or, you can reconfigure applications to use the new DB instance's name.
  6. Restore the database in your new DB instance.

To restore your database, you can use the pg_dump utility for PostgreSQL or for PostgreSQL versions 10.10 and later, and 11.5. Or, you can use Transportable Databases, which moves data much faster than the pg_dump/pg_restore method. The mysqldump utility is available for importing data into MySQL/MariaDB engines, or you can use the external replication method for reduced downtime. Similarly, you can use Data Pump for Oracle and native full backup (.bak files) for SQL Server.

Note: Downtime occurs from the time that your old DB instance stops receiving connections until the time that Amazon RDS directs the connections from your application to the new DB instance.

Replication with AWS DMS

You can use AWS DMS to set up homogeneous replication between your two DB instances. For more information, see Getting started with AWS Database Migration Service.


Related information

Sources for AWS Database Migration Service

Targets for AWS Database Migration Service

Restoring from a DB snapshot

Amazon RDS pricing

3 Comments

that's a bummer, is there no option to have RDS do the dump/restore or export/import? :( If the patching exercise can be actioned, dump/restore can be too. Obviously the size of the database matters, maybe an enhancement or feature at least for small sized DBs.

replied 9 months ago

Thank you for your comment. We'll review and update the Knowledge Center article as needed.

profile pictureAWS
EXPERT
replied 9 months ago

It is weird that AWS can change storage options from I01,GP2 or GP3 with a simple click of button. But when you spend weeks cleaning up your Cloud Oracle RDS tablespaces and your Free-Storage-Space is now 3x times bigger than your data (in the Terabytes). There is no simple resize leaving just 25% as Free-Storage-Space.

https://docs.aws.amazon.com/ebs/latest/userguide/ebs-volumes.html they claim "AWS EBS volumes are flexible." but not that flexible ;-)

replied 4 months ago