Using OCI CLI and Custom Database Software Images to Create, Patch, and Upgrade your Exadata Cloud Databases

Introduction

After covering how to use the OCI CLI and Custom Database Software Images to patch and upgrade databases on VM DB Systems in the previous blogs, we are now going to see how to do this on Exadata systems.

Exadata systems allow to provision multiple database homes of different software versions and having multiple databases per database home.

The Environment

I’ll create a Custom Database Software Image using version 19.8 with three additional one-off patches (jut as example: 28889389,30835853,31301460), and use this to:

  1. Create a new database home
  2. Create a new database in the new database home
  3. Patch an existing database of version 19.7 by moving it to the new database home
  4. Upgrade an existing database of version 18.11 by using the new database home

0. Create a Custom Database Software Image

Create a json file with the desired values as follows with EXADATA_SHAPE as value of the imageShapeFamily parameter:

vi create_image.json
{
   "compartmentId": "ocid1.compartment.oc1..........loa4a",
   "databaseSoftwareImageOneOffPatches": [
     "28889389",
     "30835853",
     "31301460"
   ],
   "databaseVersion": "19.0.0.0",
   "displayName": "Custom_Image_19.8_plus_three_one-offs",
   "imageShapeFamily": "EXADATA_SHAPE",
   "imageType": "DATABASE_IMAGE",
   "patchSet": "19.8.0.0"
}

Use the JSON file to create the database software image:

oci db database-software-image create --from-json file://create_image.json

1. Crate a New Database Home

Create a new database home using the software image created in the previous step:

VM_CLUSTER_OCID=ocid1.cloudvmcluster.oc1.eu-frankfurt-1..........x4kqa
IMAGE_OCID=ocid1.databasesoftwareimage.oc1.eu-frankfurt-1..........7mcnq
oci db db-home create --vm-cluster-id $VM_CLUSTER_OCID --database-software-image-id $IMAGE_OCID --display-name dbhome198PlusOneOffs

2. Create a New Database

Create a new database in the database home created in the previous step:

VM_CLUSTER_OCID=ocid1.cloudvmcluster.oc1.eu-frankfurt-1..........x4kqa
DB_HOME_OCID=ocid1.dbhome.oc1.eu-frankfurt-1..........on6pq #OCID of db home created in step 1
oci db database create --vm-cluster-id $VM_CLUSTER_OCID --db-home-id $DB_HOME_OCID --db-name CDB198 --db-workload OLTP --admin-password MyAdminPw__198

3. Patch an existing Database

Patch an existing database by moving it to the database home created in step 1:

DATABASE_OCID=ocid1.database.oc1.eu-frankfurt-1........vxllq #existing db of version 19.7
DB_HOME_OCID=ocid1.dbhome.oc1.eu-frankfurt-1..........on6pq #OCID of db home created in step 1
oci db database update --database-id $DATABASE_OCID --db-home-id $DB_HOME_OCID

Using the console, on the database details page, click on “Move to Another Home”:

4. Upgrade an existing Database

Upgrade an existing database by using the database home created in step 1:

DATABASE_OCID=ocid1.database.oc1.eu-frankfurt-1........5xdq #existing db of version 18.11
DB_HOME_OCID=ocid1.dbhome.oc1.eu-frankfurt-1..........on6pq #OCID of db home created in step 1
oci db database upgrade-with-db-home --database-id $DATABASE_OCID --db-home-id $DB_HOME_OCID --action PRECHECK
oci db database upgrade-with-db-home --database-id $DATABASE_OCID --db-home-id $DB_HOME_OCID --action UPGRADE

Using the console, on the database details page, click on “More Actions”, then “Upgrade”:

For log information, have a look at /var/opt/oracle/alert.log on the local Exadata machine.

Further Reading

Would you like to get notified when the next post is published?