Modernisation of entire database stack is key not just to ensure that you can benefit from the latest features but also to ensure that you are on a supported version of Platform/Shape/Database.

Modernisation in OCI is easy and you have multiple solutions to adopt based on your requirement.

Let’s explore 3 solutions which can help you to modernise your Operating System and Shape of your Oracle Base Database.

My Environment :

Platform : Oracle Base Database

Database Version : 19.16

Grid Version : 19.16

OS : Oracle Linux (OL7)

Shape : Intel X7 (Fixed Shape)

Goal : Upgrade OS to Oracle Linux 8 (OL8) and Shape to Intel X9 (Flex shape)

Solution 1 : Using Backup and Restore with Downtime

Concept

We will perform Backup of the existing DB System (Intel X7 on OL7) and use the backup to create a new DB System (Intel X9 on OL8) using cloud console and Upgrade the OS (if required).

Phase 1 : Initiate Manual Backup

Shutdown your Application (Application should remain down until end of all phases).

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

Initiate a new backup by clicking on Create Backup to bring up below screen.

Enter the backup name and click on Create Backup to initiate a backup. This will initiate a backup and you will have a backup created for your database at the end of the request.

Phase 2 : Create a new DB System from backup

Navigate to the backup section from database console and click on 3 dots against the backup name to bring up Create Database option as shown below.

Click on Create database option.

Leave the default selections on the new screen and click on Next.

Enter required details as shown below .

Click on Change Shape to bring up below screen.

Select Intel X9 and the required OCPUs and click on Select Shape to go back to original screen.

Select appropriate options on the remaining screens as shown below.

Click on Next to bring up next screen and provide details requested.

Click on Create DB System after entering all required all details to initiate a work request .

At the end of the work request , we will have a DB system created from the backup taken.

Our New DB system is in Intel X9 and will have OL7 unless our DB version is already 19.21 or above.

Phase 3 : Upgrade OS from OL7 to OL8

Navigate to the New DBSystem console and go to the version section to see available Upgrades and patches.

Click on the View button next to Upgrades Available to bring up below screen.

Click on Run precheck against the OS update to initiate a precheck.

After successful precheck , navigate to same place and initiate an Upgrade by clicking on Apply.

It will bring up a screen similar to below.

Enter the DB system name and click on Upgrade DB system to initiate the workrequest for OS Upgrade.

At the end of successful work request , we will have a DB system with OL8 which is in Intel X9.

Modify the application to point to new DB system and bring up the Application.

How to Fallback ?

Option 1 : Before releasing New DB System for Business

Simply use the old DB System

Option 2 : After releasing New DB system for Business

Use the same method (Backup and Restore) to go back to DB system on Intel X7 with OL7 .

Pros

Easy to accomplish.

Database version remains the same (tested with 19.16 and above)

Original DB system remains intact.

Cons

Downtime Required for the entire activity.

Application connection strings might need to change to reflect New DB System.

Solution 2 : Using console with downtime

Concept

We will perform OS upgrade , DB Patching , GI patching followed by Shape Change using cloud console.

Bring down Application before starting with any of the phases.

Phase 1 : Upgrade Operating System from OL7 to OL8 (Requires downtime)

Navigate to the DBSystem console and go to the version section to see available Upgrades and patches.

Click on the View button next to Upgrades Available to bring up below screen.

Click on Run precheck to initiate a precheck.

Precheck is an online operation and can be done any time before the actual Upgrade.

Schedule a downtime for OS Upgrade and bring down application before initiating the OS Upgrade.

Navigate to same place where you initiated precheck and this time initiate an Upgrade by clicking on Apply.

It will bring up a screen similar to below.

Enter the DB system Name and click on Upgrade DB System to initiate the Upgrade.

This will take some time and at the end of successful Work request , we will have a DB System Upgraded with Oracle Linux 8.

Please note Upgrade process will create a new DB System with Oracle Linux 8 and everything will be replicated to new DB System.

Cloud automation keeps the private IP and hostname during the Upgrade , however Public IP will get changed.

Refer documentation for more details about the process.

Bring up the Application and release for business operations after sanity check.

You can continue with next Phase in a later downtime window or in the same window depending on your requirement and downtime.

Phase 2 : Patch Database and GI to 19.17 or higher (Requires downtime)

Shape Change to Intel X9 is not supported for DB version 19.16 and below , that means we need to update our database to 19.17 before doing the Shape Change.

You can ignore this step if your database version is 19.17 or higher.

It is also recommended to keep your GI version same or higher than the DB version.

We can use console to do GI and DB Patching , I will not elaborate on the details since it is not the topic of the article.

Please refer below documentation for more details.

Update DB System (GI)

Update Database

Please note that you need to bring down the application for the duration of the GI and DB patching.

I have updated my Database and GI to 19.24 using the console.

Phase 3 : Change Shape of DB System (Requires downtime)

Navigate to the DB System console and click on Change Shape as shown below.

Select Intel X9 shape , required OCPUs and click on Change shape to initiate the work request.

After successful completion of work request our DB System shape will be Intel X9.

That’s all , we have successfully modernised our OS and Shape using console.

Bring up the Application.

How to fallback ?

Option 1 : Before /After releasing New DB System for Business

Take a database backup and restore that backup to a new DB system with Intel X7 and OL7 (similar method as Solution 1) – Needs downtime

Pros

No change in hostname and private ip address which means no change in Application connectivity settings.

Ability to do one change at a time.

Cons

Multiple downtime ( Four downtimes for DB versions below 19.17 and two downtimes for other DB versions).

Fallback needs additional downtime.

Database RUs might get updated based on the DB version.

Solution 3 : Using Refreshable PDB with minimal downtime

Concept

We will use Refreshable cloning method to clone the existing PDB (on Intel X7 Shape ) to a new CDB on Intel X9 Shape with minimal downtime.

Step 1 : Create a new DB system with Intel X9 Shape (No downtime)

Create a DB system with database version 19.21 or above. I have created a DB System with GI/DB version 19.24.

We can do this from OCI console , ensure to select Intel X9 as the shape while provisioning a new DB System.

We have to select database version 19.21 or above so that the new DB System will have OL8.

I haven’t elaborated on the details of Creating a new DB System since it is a fairly simple process.

Refer documentation if you need any help.

Step 2 : Create a common user in the Source CDB (on Intel X7) (No downtime)

Create a common user using below commands.

CREATE USER c##clone IDENTIFIED BY some-password CONTAINER=ALL; 
GRANT CREATE SESSION, CREATE PLUGGABLE DATABASE, SELECT_CATALOG_ROLE TO c##clone CONTAINER=ALL;
GRANT READ ON sys.enc$ TO c##clone CONTAINER=ALL;

Step 3 : Create a Refreshable PDB (No downtime)

We will use PDB lifecycle management options from console for this.

Navigate to PDB console on OCI for the Intel X7 DB system and click on Clone option as seen below for the PDB(SALES in this example ) that you want to migrate to new DB system.

Select Refreshable clone , Destination DB system (created in step 1 ) , Destination Database and also enter the name of the new PDB as seen below.

Provide Source Database (Intel X7) SYS password and also the details of the user created in step 2.

Click on the Clone pluggable database to initiate a Work request.

We will see a screen similar to below after completion of Work request indicating that Refreshable PDB has been created.

We will be able to see the newly cloned PDB on the Intel X9 DB System now.

Step 4 : Refresh the Refreshable PDB (No downtime)

We have to refresh our PDB regulalry as our goal is to reduce the downtime during the final cut over.

Navigate to the PDB console for Intel X9 DB System and click on Refresh as shown below.

We can repeat the refresh as many times as we need before the downtime.

Step 5: Convert the Refreshable PDB to Regular PDB(Downtime required)

This is the final step in completing the migration of PDB new DB system(Intel X9).

We have to shutdown the Applications pertaining to the Source PDB (in Intel X7) and perform a final refresh (using same the procedure mentioned in step 4).

Once the final refresh has been completed , we can navigate to the PDB in the Target DB system and click on Convert to regular PDB as seen below.

After successful conversion , you will have a screen similar to below.

PDB migration has been completed now.

We can check for any PDB plug in violations using below query.

select con_id,name,type,status,message from pdb_plug_in_violations where status<>'RESOLVED';

I didn’t find out any violations.

We can now modify the Application to point to new PDB and bring up the application.

That’s all, we have successfully modernised our shape and OS with minimal downtime.

How to fallback ?

Option 1 : Before releasing New DB System for Business

Simply switch to the old DB System

Option 2 : After releasing New DB system for Business

Use the same method in reverse mode (Refreshable PDB ) to go back to DB system on Intel X7 with OL7 .

Pros

Very minimal downtime.

Original DB system is intact (Easy fallback for option 1)

Cons

Hostname and private IP will get modified which may or may not require application changes since it depends on each customer.

All changes in one go which sometime is not preferred.

Database RUs will be updated ( in this case it was changed from 19.16 to 19.24)

That’s it .

As you can see modernising the database is easy and fast in OCI and you have lot of options to choose from!

Leave a Reply