Update a Database

This article describes the procedure to update a database in a DB system by using the Console and the API.

Required IAM Policy

To use Oracle Cloud Infrastructure, you must be granted security access in a policy by an administrator. This access is required whether you're using the Console or the REST API with an SDK, CLI, or other tool. If you get a message that you don’t have permission or are unauthorized, verify with your administrator what type of access you have and which compartment to work in.

For administrators: The policy in Let database admins manage Oracle Cloud database systems lets the specified group do everything with databases and related Database resources.

If you're new to policies, see Getting Started with Policies and Common Policies. If you want to dig deeper into writing policies for databases, see Details for the Database Service.

About Updating a Database

Oracle recommends updating the DB system before updating the database within that DB system.

For the Oracle Database, updates are available for four most recent versions (N through N-3). For example, if an instance is using 21c and the latest version of 21c offered is 21.10.0.0, then 21.10.0.0, 21.9.0.0, 21.8.0.0, and 21.7.0.0 are available for Oracle Database updates. You can use any of these updates, but Oracle recommends using the latest.

You can also update your Oracle Database using a custom database software image. When updating with a software image, Oracle supports updating with any image based on any of the four most recent versions (N through N-3).

The following applies only to Oracle based updates starting April 2022 updates for 12.1 and 12.2 and July 2022 updates for 19c.

If you have any interim updates (previously known as a one-off patch) installed, then those interim updates will be rolled back automatically before installing the new update. If the new update does not include the interim updates, you could install the interim update again after you complete installing the new update.

If you have any interim updates installed in your database, then to avoid installing interim updates after the new update, Oracle recommends using a custom database software image and updating your database using that image.

After running precheck, you can identify if you have installed any additional interim updates by executing the following command in dbcli.

dbcli describe-job -i <job id>

where job id (dbcli list-jobs) is the job id of the precheck run.

All the changes in the Oracle Home will be copied to the newly updated and installed database.

Note

  • Oracle does not recommend changing any files within the Database Home.
  • It is essential to ensure that all the changes you made to the Database Home are copied correctly. If you have copied any files or folders in the Database Home, like tnsnames.ora, listener.ora etc., you should back up those files manually.

The DB system should have access to the Identity and Object Storage endpoints within OCI. If the DB system running on a private subnet was only configured with a service gateway and no additional gateway (e.g., NAT Gateway), you should ensure that the service gateway is set to allow the access to all Oracle Services and not just the Object Storage. No change is required if the Identity and Object Storage endpoints can be reached by other means.

For more information on the list of currently available database updates, see Currently Available Updates.

Note

OJVM updates have to be applied manually using the OPATCH tool.

Apply Interim Updates Using a Database Software Image

We do not recommend applying interim updates to the DB systems. Instead, you should create and deploy a database software image that contains the necessary fixes. Only in cases where you cannot use a database software image, for example, to apply an interim update to a GI Home, you can file a Service Request (SR) and request support assistance to download an interim update.

For more information on database software images, see Software Images.

Apply a Database Update

View the Database Update History

Apply an Interim Update

Use the API

For information about using the API and signing requests, see REST APIs and Security Credentials. For information about SDKs, see Software Development Kits and Command Line Interface.

Use the following APIs to manage database updates:

  • ListDbHomePatches
  • ListDbHomePatchHistoryEntries
  • GetDbHomePatch
  • GetDbHomePatchHistoryEntry
  • UpdateDbHome
  • UpdateDatabase

For the complete list of APIs for the Database service, see Database Service API.