Oracle has recently announced the capability to Upgrade Oracle Base Database in Oracle Cloud Infrastructure from 19c to 23ai using console.

Let’s explore how we can do this.

We will do it in two parts.

You can find part 1 here.

In part 2 ( this article) , we will understand how to Upgrade the Database to 23ai.

My Environment :

Platform : Oracle Base Database in Oracle Cloud Infrastructure

Database Version : 19.22

Grid Version : 23.5 (Upgraded from 19c using steps in Part 1)

OS : Oracle Linux (OL8)

Shape : AMD E4 (Flex Shape)

Goal : Upgrade Database to 23ai

Prerequisites

Database must be in archivelog mode.

Database must have flashback enabled as per documentation , however it worked for me without enabling flashback. I don’t see any reason for enabling flashback since Guaranteed Restore point is used in case of rollback which doesn’t need flashback to be enabled.

Oracle Database 19c or 21c can be Upgraded to Oracle Database 23ai.

If our DB System uses Automatic Storage Management (ASM) storage management software, then we must have GI version 23ai.

The DB system must use Oracle Linux 8 (OL8) to upgrade to Oracle Database 23ai.

Oracle recommends that we backup our database and test the new software version on a test system before you upgrade.

Oracle also recommends running an Upgrade precheck operation for our database before we upgrade so that we can discover any issues that need mitigation before the time we plan to perform the upgrade.

An upgrade operation cannot take place while an automatic backup operation is underway. Before upgrading, Oracle recommends disabling automatic backups and performing a manual backup.

It is also recommended to do a manual precheck outside of console before doing the Upgrade.

Check for more details in the documentation.

Things to consider

Database upgrades involve database downtime. Oracle recommends considering this when scheduling our database upgrade.

After upgrading, we cannot use automatic backups taken before the upgrade to restore the database to an earlier point in time.

DST version of your database might get changed as part of Upgrade depending on your current version , for me it was changed from 42 to 43.

I have seen that increase in the number of OCPUs will reduce the downtime to a certain extend , test your Upgrades on test environment with different OCPUs to know the exact downtime.

This blog doesn’t deal with necessary measures to ensure performance stability of your database queries , please take care of them as required.

Step 1 : Perform precheck for Database Upgrade

Oracle recommends to do precheck in advance to identify any issues that can prevent from Upgrade.

Please note that this is an online activity and we can perform this multiple times , ideally we should do one precheck very close to the downtime window.

Navigate to the Database console and go to the version section as shown below.

Click on the View to bring up the available patches/Upgrades for Database.

Click on three dot against the 23ai version to which we would like to Upgrade and select Run precheck to initiate the work request for precheck.

Click on Run precheck on the confirmation screen to proceed with precheck.

Below is the screenshot of a successful precheck.

It is also recommended to a Manual Preupgrade check (not using console) and perform manual actions if required before the Upgrade.

Step 2 : Perform Database Upgrade

Database Upgrade requires complete downtime of application for RAC and Non-RAC DB systems.

We also need complete downtime for DB system with Data guard while using Upgrade from console.

Bring down the application and proceed as below.

Create a manual backup using the console and proceed with Upgrade.

Navigate to the same section as earlier step for available Database Upgrades and initiate the Database Upgrade by selecting Apply for the same database version for which we have done precheck in earlier step as shown below.

It will ask for confirmation and also notifies us about the time of last manual backup.

Click on Upgrade to proceed.

We will see a screen similar to below after successful Upgrade.

That’s all , we have upgraded our database to 23ai.

Post Upgrade

Bring up the application and perform sanity check .

Check whether Automatic Backup is enabled even though Upgrade workflow does it for us.

Ensure that the .bashrc file in the home directory of the Oracle User has been updated to point to the 23ai Database Home , I see this is taken care by the process but better to double check.

Init parameter COMPATIBLE of our database remains at 19.0.0 and we can modify this some time later after things have stabilized.

Oracle recommends that we remove the old Database Home using the dbcli ultility.For more information, see documentation.

How to rollback ?

If our database upgrade does not complete successfully, then we will have the option of performing a rollback. Following an unsuccessful database upgrade operation, the rollback option is provided in a banner message displayed on the Database Details page. Please note that this is not available for Oracle Database Standard Edition.

If there are scenarios where it is taking time to bring our DB system to previous state , we can also restore the manual backup taken before the upgrade to create a new DB system with original version of database.

How long does it take to Upgrade ?

It depends on lot of factors such your Shape ( I see it matters ) , number of components in your database , OCPUs , how big is your metadata etc.

For me Database Upgrade with 1 OCPU took close to 3 hour 40 minutes and the time was reduced to 1 hour 40 minutes with 4 OCPUs for AMD E4 Shape.

Leave a Reply