How To Do An Out of Place Patching In ExaCC via dbaascli

How To Do An Out of Place Patching In ExaCC via dbaascli

This will be a small post on how to do an Out of Place Patching for your database in an ExaCC environment. The documentations shows how to do it via the console, but in this example it will be a 19.11 patch via dbaascli  that will be applied to the database. One thing to know is that unless stated other wise, all commands are run with root

The first thing to do is to check the Images that you have in your ExaCC, this might be a long list, so I am showing a reduced version of it

[root@hostname1 ~]# dbaascli cswlib showImages
...
30.IMAGE_TAG=19.11.0.0.0
  VERSION=19.11.0.0.0
  DESCRIPTION=19c APR 2021 DB Image
  IMAGE_ALIASES=19000-191100,19000-APR2021
31.IMAGE_TAG=19.11.0.0.0-NC
  VERSION=19.11.0.0.0
  DESCRIPTION=19c APR 2021 Non CDB Image
  IMAGE_ALIASES=19000-NC191100,19000-NCAPR2021,NC19.11.0.0.0-NC
...
GI:
8.IMAGE_TAG=19.11.0.0.0
  VERSION=19.11.0.0.0
  DESCRIPTION=19c APR 2021 GI Image
  IMAGE_ALIASES=

Now that we see what are the available options, we can create the new ORACLE_HOME

[root@hostname1 ~]# dbaascli dbhome create --version 19000
INFO: OSS details are not provided, Restoring from local acfs image
Please confirm yes/no: yes
...
Completed Plugin_cleanup job
---------- START OF PLUGIN RESULT ----------
{"ORACLE_HOME_NAME":"OraHome4","ORACLE_HOME":"/u02/app/oracle/product/19.0.0.0/dbhome_12"}
---------- END OF PLUGIN RESULT ----------

Prior to patch the new ORACLE_HOME, we can run a precheck and verify if there will be issues with the patch

[root@hostname1 ~]# dbaascli dbhome patch --oracleHome /u02/app/oracle/product/19.0.0.0/dbhome_12 --targetVersion 19.11.0.0.0 --executePrereqs
Executing command dbhome patch --oracleHome /u02/app/oracle/product/19.0.0.0/dbhome_12 --targetVersion 19.11.0.0.0 --executePrereqs
-----------------
Setting up parameters...
Patch Parameters setup successful.
-----------------
Validating Inputs.
Successfully Validated Inputs.
-----------------
...
Completed check_patch_conflict job
-----------------
Running remove_unzip_loc job
Completed remove_unzip_loc job
DBHome Patching Prereqs Execution Successful.

It is good to know that the log file from the dbaascli dbhome patch command is written to /var/opt/oracle/log/dbHomePatch/dbHomePatch.log on the specific node the check was run against.

Now that the ORACLE_HOME has been created, we can now patch the new ORACLE_HOME

[root@hostname1 ~]# dbhome patch --oracleHome /u02/app/oracle/product/19.0.0.0/dbhome_12 --targetVersion 19.11.0.0.0 --skipDatapatch
...
DBAAS CLI version 21.2.1.2.0
Executing command dbhome patch --oracleHome /u02/app/oracle/product/19.0.0.0/dbhome_12 --targetVersion 19.11.0.0.0
-----------------
Setting up parameters...
Patch Parameters setup successful.
-----------------
Validating Inputs.
Successfully Validated Inputs.
-----------------
...
-----------------
Running release_lock job
Completed release_lock job
Running backup_old_home job
Completed backup_old_home job
-----------------
Running cleanup job
Completed cleanup job
DBHome Patching Successful.

You can check that the 19.11 are applied in the new ORACLE_HOME with the oracle user

[oracle@hostname1 OPatch]$ pwd
/u02/app/oracle/product/19.0.0.0/dbhome_12/OPatch

[oracle@hostname1 OPatch]$ ./opatch lspatches
30310195;DBSAT REPORTED DISABLED CONSTRAINTS FOR SHARDING  STS_CHUNKS ON GSMADMIN_INTERNAL.SHARD_TS
29780459;INCREASE _LM_RES_HASH_BUCKET AND BACK OUT CHANGES FROM THE BUG 29416368 FIX
32327208;DSTV36 UPDATE - TZDATA2020E - NEED OJVM FIX
32327201;RDBMS - DSTV36 UPDATE - TZDATA2020E
31335037;RDBMS - DSTV35 UPDATE - TZDATA2020A
30432118;MERGE REQUEST ON TOP OF 19.0.0.0.0 FOR BUGS 28852325 29997937
31732095;UPDATE PERL IN 19C DATABASE ORACLE HOME TO V5.32
32490416;JDK BUNDLE PATCH 19.0.0.0.210420
32399816;OJVM RELEASE UPDATE: 19.11.0.0.210420 (32399816)
32579761;OCW RELEASE UPDATE 19.11.0.0.0 (32579761)
32545013;Database Release Update : 19.11.0.0.210420 (32545013)
OPatch succeeded.

Now we will proceed to move the database to the new 19.11 ORACLE_HOME as the root user

[root@hostname1 ~]# dbaascli database move --dbname testdb01 --ohome /u02/app/oracle/product/19.0.0.0/dbhome_12
DBAAS CLI version 21.2.1.2.0
Executing command database move --ohome /u02/app/oracle/product/19.0.0.0/dbhome_12
INFO : Source version is 19.11.0.0.0
INFO : Target version is 19.11.0.0.0
INFO : Review log file => /var/opt/oracle/log/testdb01/dbmigrate/dbmigrate_2021-10-07_17:14:34.868404143693.log
INFO : Review log file for this node - /var/opt/oracle/log/testdb01/dbmigrate_local/dbmigrate_local.log
INFO : Executing on node: hostname1
INFO : cmd: /var/opt/oracle/ocde/assistants/dbda/dbmigrate.pl -dbname testdb01 -ohome /u02/app/oracle/product/19.0.0.0/dbhome_12 -prereq -local
INFO : dbmove precheck completed on node: hostname1
INFO : Executing on node: hostname2
INFO : cmd: /var/opt/oracle/ocde/assistants/dbda/dbmigrate.pl -dbname testdb01 -ohome /u02/app/oracle/product/19.0.0.0/dbhome_12 -prereq -local
INFO : dbmove precheck completed on node: hostname2
INFO : Precheck completed successfully on all the nodes.
INFO : Executing on node: hostname1
INFO : cmd: /var/opt/oracle/ocde/assistants/dbda/dbmigrate.pl -dbname testdb01 -ohome /u02/app/oracle/product/19.0.0.0/dbhome_12 -local
INFO : dbmove completed on node: hostname1
INFO : Checking testdb01 is up on hostname1...
INFO : Executing on node: hostname2
INFO : cmd: /var/opt/oracle/ocde/assistants/dbda/dbmigrate.pl -dbname testdb01 -ohome /u02/app/oracle/product/19.0.0.0/dbhome_12 -local
INFO : dbmove completed on node: hostname2
INFO : Checking testdb01 is up on hostname2...
INFO : dbmove completed successfully on all the nodes

The next step is to run the datapatch to the database as the oracle user

[oracle@hostname1 OPatch]$  $ORACLE_HOME/OPatch/datapatch -verbose
SQL Patching tool version 19.11.0.0.0 Production on Thu Oct 7 14:40:26 2021
Copyright (c) 2012, 2021, Oracle.  All rights reserved.
Log file for this invocation: /u01/app/oracle/cfgtoollogs/sqlpatch/sqlpatch_2302_2021_10_07_14_40_26/sqlpatch_invocation.log
Connecting to database...OK
Gathering database info...done
Note:  Datapatch will only apply or rollback SQL fixes for PDBs
       that are in an open state, no patches will be applied to closed PDBs.
       Please refer to Note: Datapatch: Database 12c Post Patch SQL Automation
       (Doc ID 1585822.1)
Bootstrapping registry and package to current versions...done
Determining current state...done
Current state of interim SQL patches:
  No interim patches found
Current state of release update SQL patches:
  Binary registry:
    19.11.0.0.0 Release_Update 210413004009: Installed
  PDB CDB$ROOT:
    Applied 19.10.0.0.0 Release_Update 210108185017 successfully on 20-JAN-21 01.03.57.749255 AM
  PDB PDB$SEED:
    Applied 19.10.0.0.0 Release_Update 210108185017 successfully on 20-JAN-21 01.03.58.234326 AM
  PDB PDB1:
    Applied 19.10.0.0.0 Release_Update 210108185017 successfully on 20-JAN-21 01.03.58.234326 AM
Adding patches to installation queue and performing prereq checks...done
Installation queue:
  For the following PDBs: CDB$ROOT PDB$SEED PDB1
    No interim patches need to be rolled back
    Patch 32545013 (Database Release Update : 19.11.0.0.210420 (32545013)):
      Apply from 19.10.0.0.0 Release_Update 210108185017 to 19.11.0.0.0 Release_Update 210413004009
    No interim patches need to be applied
Installing patches...
Patch installation complete.  Total patches installed: 3
Validating logfiles...done
Patch 32545013 apply (pdb CDB$ROOT): SUCCESS
  logfile: /u01/app/oracle/cfgtoollogs/sqlpatch/32545013/24175065/32545013_apply_CDB2_CDBROOT_2021Apr21_14_41_01.log (no errors)
Patch 32545013 apply (pdb PDB$SEED): SUCCESS
  logfile: /u01/app/oracle/cfgtoollogs/sqlpatch/32545013/24175065/32545013_apply_CDB2_PDBSEED_2021Apr21_14_42_22.log (no errors)
Patch 32545013 apply (pdb PDB1): SUCCESS
  logfile: /u01/app/oracle/cfgtoollogs/sqlpatch/32545013/24175065/32545013_apply_CDB2_PDB1_2021Apr21_14_42_22.log (no errors)
SQL Patching tool complete on Thu Oct 7 14:43:47 2021

You can check which patches are applied to the database by checking the registry

SQL> select * from sys.registry$history;
ACTION_TIME                                                                 ACTION                         NAMESPACE                      VERSION                                ID
--------------------------------------------------------------------------- ------------------------------ ------------------------------ ------------------------------ ----------
COMMENTS                                                                                                                                                                                                                                    BUNDLE_SERIES
---------------------------------------------
...
07-OCT-21 05.26.50.579750 PM                                                jvmpsu.sql                     SERVER                         19.11.0.0.210420OJVMRU                  0
RAN jvmpsu.sql
07-OCT-21 05.26.50.585261 PM                                                ROLLBACK                       SERVER                         19.11.0.0.210420OJVMRU                  0
OJVM RU post-deinstall
07-OCT-21 05.26.50.672514 PM                                                jvmpsu.sql                     SERVER                         19.11.0.0.210420OJVMRU                  0
RAN jvmpsu.sql
07-OCT-21 05.26.50.676553 PM                                                APPLY                          SERVER                         19.11.0.0.210420OJVMRU                  0
OJVM RU post-install
07-OCT-21 05.28.51.154425 PM                                                RU_APPLY                       SERVER                         19.0.0.0.0
Patch applied from 19.10.0.0.0 to 19.11.0.0.0: Release_Update - 210413004009
19 rows selected.

The last thing to do is to purge the old ORACLE_HOME as root, be careful to only remove the ORACLE_HOME that is no longer in use

[root@hostname1 ~]# dbaascli dbhome purge
DBAAS CLI version 21.2.1.2.0
Executing command dbhome purge
Enter
1 - If you wish to enter homename to be purged
2 - If you wish to enter home path to be purged
2
Enter the home path
/u02/app/oracle/product/19.0.0.0/dbhome_2

INFO: Removing Oracle Home /u02/app/oracle/product/19.0.0.0/dbhome_2

Hope this small post helps you when you are doing patching excercises and gives you an idea of how to do it via command line.

Tags:
,
Rene Antunez
[email protected]
No Comments

Sorry, the comment form is closed at this time.