Amazon Relational Database Service
User Guide (API Version 2014-10-31)
Did this page help you?  Yes | No |  Tell us about it...
« PreviousNext »
View the PDF for this guide.Go to the AWS Discussion Forum for this product.Go to the Kindle Store to download this guide in Kindle format.

Upgrading and Amazon RDS Resource Maintenance

Periodically, the Amazon RDS system performs maintenance on Amazon RDS resources, such as DB instances. Maintenance can range from a DB instance's operating system (OS) updates and DB engine upgrades to changing size or storage for an instance. A DB engine upgrade can consist of either a major or minor database version upgrade.

You can choose to apply maintenance items on a DB instance at your convenience instead of waiting for the maintenance process initiated by AWS during your maintenance window. You can view whether a maintenance update is available for your DB instance both on the RDS console and by using the Amazon RDS API. If an update is available, you can choose to do one of the following:

  • Have the maintenance items applied immediately.

  • Schedule the maintenance items to be applied during your next maintenance window.

    Note

    The maintenance window setting determines when pending operations are to be started and does not limit the total execution time of these operations. In other words, pending operations will be initiated during the configured maintenance window but they are not guaranteed to finish before the maintenance window closes.

  • Defer the maintenance items.

Certain maintenance items will be marked as Required in the Maintenance column in the Amazon RDS console. These updates cannot be deferred indefinitely. If you choose to defer a required update, you will receive a communication from AWS that notifies you of the time at which the update will be performed on your DB instance. Other updates will be marked as Available. You can defer these maintenance items indefinitely and the update will not be applied to your DB instance.

Maintenance items require that Amazon RDS take your DB instance offline for a short time. Maintenance that requires your DB instance to be offline include scale compute operations, which generally take only a few minutes from start to finish, and required operating system or database patching. Required patching is automatically scheduled only for patches that are related to security and instance reliability. Such patching occurs infrequently (typically once every few months) and seldom requires more than a fraction of your maintenance window.

If you don't specify a preferred weekly maintenance window when creating your DB instance, a 30-minute default value is assigned. If you want to change when maintenance is performed on your behalf, you can do so by modifying your DB instance in the AWS Management Console or by using the ModifyDBInstance API. Each of your DB instances can have different preferred maintenance windows, if you so choose.

Running your DB instance as a Multi-AZ deployment can further reduce the impact of a maintenance event, because Amazon RDS will conduct maintenance by following these steps:

  1. Perform maintenance on the standby.

  2. Promote the standby to primary.

  3. Perform maintenance on the old primary, which becomes the new standby.

Note

When you modify the database engine for your DB instance in a Multi-AZ deployment, then Amazon RDS upgrades both the primary and secondary DB instances at the same time. In this case, the database engine for the entire Multi-AZ deployment is shut down during the upgrade.

For more information on Multi-AZ deployments, see High Availability (Multi-AZ).

Operating System Updates for a DB Instance

Operating system (OS) updates for Amazon RDS DB instances are most often updates for security or reliability reasons. You can decide when Amazon RDS will apply OS updates by using the RDS console, command line interface (CLI), or API.

You can choose to apply OS updates on a DB instance at your convenience instead of waiting for the maintenance process initiated by AWS during your maintenance window. You can view whether an OS update is available for your DB instance both on the Amazon RDS console and by using the Amazon RDS CLI or API. If an update is available, it will be indicated by the word Available in the Maintenance column for the DB instance on the Amazon RDS console. For OS updates that are marked Available, you can choose to do one of the following:

  • Have the OS update applied immediately.

  • Schedule the OS update to be applied during your next maintenance window.

    Note

    The maintenance window setting determines when pending operations are to be started and does not limit the total execution time of these operations. In other words, pending operations will be initiated during the configured maintenance window but they are not guaranteed to finish before the maintenance window closes.

  • Defer the OS update.

Certain OS updates will be marked as Required in the Maintenance column in the Amazon RDS console. These updates cannot be deferred indefinitely. If you choose to defer a required update, you will receive a communication from AWS that notifies you of the time at which the update will be performed on your DB instance. Other updates will be marked as Available. You can defer these OS updates indefinitely and the update will not be applied to your DB instance.

If you use the Amazon RDS console, it will indicate when an operating system update is either available or required for your DB instance. For example, the following screenshot shows that an OS update is available:

Offline patch required

The Maintenance column indicates whatever option you select. For example, the following screenshot shows that the selected DB instance can be updated either immediately or during the DB instance's next maintenance window:

Offline patch next window

AWS Management Console

To manage an OS update for a DB instance

  1. Sign in to the AWS Management Console and open the Amazon RDS console at https://console.aws.amazon.com/rds/.

  2. In the navigation pane, click Instances.

  3. Click the check box for the DB instance that has a required operating system update.

  4. Click Instance Actions and click one of the following:

    • Upgrade Now

    • Upgrade at Next Window

      Note

      If you choose the Upgrade at Next Window option, and later want to delay the OS update, you can click Instance Actions and then select Defer Upgrade.

CLI

To apply a pending OS update to a DB instance

  • Use the rds-apply-pending-maintenance-action command to apply pending maintenance actions.

    Example

    PROMPT> rds-apply-pending-maintenance-action arn:aws:rds:us-west-2:001234567890:db:mysql-db -a os-upgrade -o immediate


To return a list of resources that have at least one pending OS update

  • Use the rds-describe-pending-maintenance-actions command to list all pending maintenance actions.

    Example

    PROMPT> rds-describe-pending-maintenance-actions arn:aws:rds:us-west-2:001234567890:db:mysql-db


API

To apply an OS update to a DB instance

  • Call ApplyPendingMaintenanceAction.

    Example

    https://rds.us-west-2.amazonaws.com/
       ?Action=ApplyPendingMaintenanceAction
       &ResourceIdentifier=arn:aws:rds:us-east-1:123456781234:db:my-instance
       &ApplyAction=os-upgrade
       &OptInType=immediate
       &SignatureMethod=HmacSHA256
       &SignatureVersion=4
       &Version=2014-10-31
       &X-Amz-Algorithm=AWS4-HMAC-SHA256
       &X-Amz-Credential=AKIADQKE4SARGYLE/20141216/us-west-2/rds/aws4_request
       &X-Amz-Date=20140421T194732Z
       &X-Amz-SignedHeaders=content-type;host;user-agent;x-amz-content-sha256;x-amz-date
       &X-Amz-Signature=6e25c542bf96fe24b28c12976ec92d2f856ab1d2a158e21c35441a736e4fde2b
    							

To return a list of resources that have at least one pending OS update

  • Call DescribePendingMaintenanceActions.

    Example

    https://rds.us-west-2.amazonaws.com/
       ?Action=DescribePendingMaintenanceActions
       &SignatureMethod=HmacSHA256
       &SignatureVersion=4
       &Version=2014-10-31
       &X-Amz-Algorithm=AWS4-HMAC-SHA256
       &X-Amz-Credential=AKIADQKE4SARGYLE/20141216/us-west-2/rds/aws4_request
       &X-Amz-Date=20140421T194732Z
       &X-Amz-SignedHeaders=content-type;host;user-agent;x-amz-content-sha256;x-amz-date
       &X-Amz-Signature=6e25c542bf96fe24b28c12976ec92d2f856ab1d2a158e21c35441a736e4fde2b
    							

Upgrading Database Versions for a DB Instance

Database version upgrades consist of major and minor version upgrades. You control when to upgrade your DB instance to a new version supported by Amazon RDS. This level of control helps you maintain compatibility with specific database versions and test new versions with your application before deploying in production. When you are ready, you can perform version upgrades at the times that best fit your schedule. You can also schedule them to be applied automatically.

Amazon RDS supports the following changes to your operating system or database engine version:

  • OS Updates, which can be manually or automatically applied. In some cases, an OS update must be applied before you can perform a DB engine version upgrade. For more information, see Operating System Updates for a DB Instance.

  • Minor DB engine version upgrades, which can be manually or automatically applied. You can specify whether minor DB engine version upgrades are applied to your DB instance using the AutoMinorVersionUpgrade option. For more information, see Minor DB Engine Version Upgrades for a DB Instance

  • Major DB engine version upgrades, which can only be manually applied. Major DB version upgrades present a risk to backward-compatibility and must be fully tested before being applied. Amazon RDS does not automatically apply major DB version upgrades. For more information, see Major DB Engine Version Upgrades for a DB Instance

Amazon RDS currently supports the following DB engine in-place major version upgrades:

  • MySQL 5.1 to MySQL 5.5

  • MySQL 5.5 to MySQL 5.6

  • Microsoft SQL Server 2008 to SQL Server 2012

Important

In some cases, you must first perform an OS update before you can perform a major database version upgrade. For example, MySQL DB instances created before April 24, 2014, are required to update their OS before upgrading to MySQL version 5.6. In this case, the DB instance will show that it has an Available OS update. For more information on OS updates, see Operating System Updates for a DB Instance earlier in this topic.

Major DB Engine Version Upgrades for a DB Instance

Major database version upgrades can contain changes that are not backward-compatible with existing applications. As a result, Amazon RDS does not apply major version upgrades automatically; you must manually modify your DB instance. You should thoroughly test any upgrade before applying it to your production instances.

You use the Amazon RDS modify operation to perform a major version upgrade of a DB instance. You can also use the modify operation to manually apply a minor version upgrade. To perform a major version upgrade, follow the instructions in Upgrading the Database Version of a DB Instance later in this topic.

Major DB Engine Version Upgrades for a MySQL DB Instance

To perform a major version upgrade for a MySQL version 5.1 DB instance on Amazon RDS to MySQL version 5.6, you must first perform any Available OS updates, then upgrade your DB instance to MySQL version 5.5, and then upgrade your DB instance to MySQL version 5.6. MySQL DB instances created before April 24, 2014 will show an Available OS update (unless the update has been applied).

Follow the instructions in Operating System Updates for a DB Instance to update the OS for your DB instance. Once you have updated the OS for your DB instance, follow the instructions in Upgrading the Database Version of a DB Instance later in this topic to upgrade the engine version for your DB instance.

Major DB Engine Version Upgrades for a PostgreSQL DB Instance

Amazon RDS does not currently support an in-place upgrade from a PostgreSQL 9.3.x DB instance to a PostgreSQL 9.4.1 DB instance. However, you can migrate a database from a PostgreSQL 9.3.5 DB instance to a PostgreSQL 9.4.1 DB instance by using the following steps:

  1. Create a new PostgreSQL 9.4.1 DB instance

  2. Create a backup of your existing PostgreSQL 9.3.5 database using pg_dump

  3. Import the dump file into your PostgreSQL 9.4.1 DB instance using pg_restore

Be sure to test your application against the new version of PostgreSQL before going into production.

Minor DB Engine Version Upgrades for a DB Instance

Minor database version upgrades generally involve less compatibility risk than major version upgrades. By default, your DB instance will automatically be upgraded to new minor versions as they are supported by Amazon RDS. This patching occurs during your scheduled maintenance window, and is announced on the Amazon RDS Community Forum in advance. To turn off automatic version upgrades in the Amazon RDS console, modify your DB instance and set AutoMinorVersionUpgrade to No.

If you set AutoMinorVersionUpgrade to No, you can manually upgrade a DB instance to a supported minor version release by modifying the DB instance and specifying the new minor version number.

Testing an Upgrade

Before you perform a major version upgrade on your DB instance, you should thoroughly test both your database and the host application for compatibility. We suggest you do the following:

  1. Review the upgrade documentation for the new version of the database engine to see if there are compatibility issues that might affect your database or applications:

  2. If your DB instance is a member of a custom DB parameter group, you need to create a new DB parameter group with your existing settings that is compatible with the new major version. Specify the new DB parameter group when you upgrade your test instance, so that your upgrade testing ensures that it works correctly. For more information about creating a DB parameter group, see Working with DB Parameter Groups.

  3. Create a DB snapshot of the DB instance to be upgraded. For more information, see Creating a DB Snapshot.

  4. Restore the DB snapshot to create a new test DB instance. For more information, see Restoring From a DB Snapshot.

  5. Modify this new test DB instance to upgrade it to the new version, using one of the methods detailed following. If you created a new parameter group in step 2, specify that parameter group.

  6. Evaluate the storage used by the upgraded instance to determine if the upgrade requires additional storage.

  7. Run as many of your quality assurance tests against the upgraded DB instance as needed to ensure that your database and application work correctly with the new version. Implement any new tests needed to evaluate the impact of any compatibility issues you identified in step 1. Test all stored procedures and functions. Direct test versions of your host applications to the upgraded DB instance.

  8. If all tests pass, then perform the upgrade on your production DB instance. We suggest you do not allow write operations to the DB instance until you can confirm that everything is working correctly.

Considerations for DB Instance Upgrades

If your DB instance is using read replication, you must upgrade all of the Read Replicas before upgrading the source instance. If the DB instance is in a Multi-AZ deployment, both the primary and standby replicas are upgraded, and the instance might not be available until the upgrade is complete.

Amazon RDS takes two DB snapshots during the upgrade process. The first DB snapshot is of the DB instance before any upgrade changes have been made. If the upgrade doesn't work for your databases, you can restore this snapshot to create a DB instance running the old version. The second DB snapshot is taken when the upgrade completes.

If Amazon RDS encounters any issues when upgrading SQL Server and needs to roll back, Amazon RDS restores your DB instance from the first DB snapshot.

For MySQL upgrades, the first snapshot is a user snapshot that is retained until you delete it. For SQL Server upgrades, the first snapshot is a system snapshot that is retained only until the end of the backup retention period.

MySQL major version upgrades typically complete in about 10 minutes, and SQL Server upgrades typically complete in about 30 minutes. Upgrades might take longer, depending on the class of DB instance, or whether the instance follows the operational guidelines in Best Practices for Amazon RDS. If you are upgrading a DB instance from the Amazon RDS console, the status of the DB instance will indicate when the upgrade is complete. If you are using the CLI, use the rds-describe-db-instance command and check the Status value.

After the upgrade is complete, you cannot revert to the previous version of the database engine. If you want to return to the previous version, restore the first DB snapshot taken to create a new DB instance.

In addition to applying major version upgrades to instances of MySQL and SQL Server, you can manually apply minor version upgrades to instances of MySQL or Oracle Database. You can also specify that minor version upgrades be applied automatically to instances of MySQL and Oracle. For more information about managing minor version upgrades, see MySQL on Amazon RDS Versions or Oracle Version Management.

Note

During a major version upgrade of SQL Server, the Free Storage Space and Disk Queue Depth metrics will display -1. After the upgrade is complete, both metrics will return to normal.

During a major version upgrade of MySQL, Amazon RDS runs the MySQL binary mysql_upgrade to upgrade tables, if required. Also, Amazon RDS will empty the slow_log and general_log tables during a major version upgrade. If you need to preserve log information, then you will need to save the log contents before the major version upgrade.

Upgrading the Database Version of a DB Instance

The following procedures cover the process of upgrading the database version of a DB instance.

AWS Management Console

To apply a DB engine major version upgrade to a DB instance

  1. Sign in to the AWS Management Console and open the Amazon RDS console at https://console.aws.amazon.com/rds/.

  2. In the navigation pane, click Instances.

  3. Click the check box for the DB instance that you want to upgrade.

  4. Click Instance Actions and click Modify.

  5. In the DB Engine Version box, click the new version.

  6. To upgrade immediately, click to select the Apply Immediately check box. To delay the upgrade to the next maintenance window, make sure this check box is clear.

  7. Click Continue.

  8. Review the modification summary information. To proceed with the upgrade, click Modify DB Instance. To cancel the upgrade, click the X in the upper right corner.

CLI

To apply a DB engine major version upgrade to a DB instance

  • Use the CLI command rds-modify-db-instance specifying the DB instance identifier and using the following parameters:

    • --engine-version = the new DB engine version

    • --allow-major-version-upgrade = true

    • --apply-immediately = true to upgrade immediately, or false to delay the upgrade until the next maintenance window

    Example

    PROMPT>rds-modify-db-instance SQLServer1 --engine-version 11.00.2100.60.v1 --allow-major-version-upgrade true --apply-immediately true


API

To apply a DB engine major version upgrade to a DB instance

  • Call ModifyDBInstance with the following parameters:

    • DBInstanceIdentifier = the identifier of the instance to be upgraded

    • EngineVersion = the new DB engine version

    • AllowMajorVersionUpgrade = true

    • ApplyImmediately = true to upgrade immediately, or false to delay the upgrade until the next maintenance window

    Example

    https://rds.amazonaws.com/
    	?Action=ModifyDBInstance
    	&DBInstanceIdentifier=MySQL-Instance1
    	&EngineVersion=5.5.31
    	&AllowMajorVersionUpgrade=true
    	&ApplyImmediately=true
    							

Upgrading a MySQL Database with Reduced Downtime

If your MySQL DB instance is currently in use with a production application, you can use the following procedure to upgrade the database version for your DB instance and reduce the amount of downtime for your application.

To upgrade an MySQL database while a DB instance is in use

  1. Using the Amazon RDS console, create a Read Replica of your MySQL 5.5 DB instance. This process will create an upgradable copy of your database.

    1. On the console, click Instances and click the DB instance that you want to upgrade.

    2. Click Instance Actions and click Create Read Replica.

    3. Provide a value for DB Instance Identifier for your Read Replica and ensure that the DB instance Class and other settings match your MySQL 5.5 DB instance.

    4. Click Yes, Create Read Replica.

  2. When the Read Replica has been created and Status shows available, upgrade the Read Replica to MySQL 5.6.

    1. On the console, click Instances and click the Read Replica that you just created.

    2. Click Instance Actions and click Modify.

    3. In the DB Engine Version box, select the MySQL 5.6 version to upgrade to and click the Apply Immediately check box. Click Continue.

    4. Click Modify DB Instance to start the upgrade.

  3. When the upgrade is complete and Status shows available, verify that the upgraded Read Replica is up to date with the master MySQL 5.5 DB instance. You can do this by connecting to the Read Replica and issuing the SHOW SLAVE STATUS command. If the Seconds_Behind_Master field is 0, then replication is up to date.

  4. Make your MySQL 5.6 Read Replica a master DB instance.

    Important

    When you promote your MySQL 5.6 Read Replica to a stand-alone, single-AZ DB instance, it will no longer be a replication slave to your MySQL 5.5 DB instance. We recommend that you promote your MySQL 5.6 Read Replica during a maintenance window when your source MySQL 5.5 DB instance is in read-only mode and all write operations are suspended. When the promotion is completed, you can direct your write operations to the upgraded MySQL 5.6 DB instance to ensure that no write operations are lost.

    In addition, we recommend that prior to promoting your MySQL 5.6 Read Replica you perform all necessary data definition language (DDL) operations, such as creating indexes, on the MySQL 5.6 Read Replica. This approach will avoid any negative effects on the performance of the MySQL 5.6 Read Replica after it has been promoted.

    1. On the console, click Instances and click the Read Replica that you just upgraded.

    2. Click Instance Actions and click Promote Read Replica.

    3. Enable automated backups for the Read Replica instance. For more information, see Working With Automated Backups.

      Click Continue.

    4. Click Yes, Promote Read Replica.

  5. You now have an upgraded version of your MySQL database. At this point, you can direct your applications to the new MySQL 5.6 DB instance, add Read Replicas, set up Multi-AZ support, and so on.