I primarily work on Oracle RAC setups on HP-UX servers - where the bash shell is not installed (and cant be due to policy). You will agree, life is much easier on Linux. Therefore I must make use of the old and dependable 'opatch' utility!
About the October 2016 patch:
Patch File: p24412235_121020_HPUX-IA64.zip
Contents: DB PSU patch #24006101 and OCW PSU patch #23854735
The unzipped patch file path: /u01/software/psuoct2016/12cGI/24412235
About the environment:
- In the below example, I am applying the patch on a 2-node RAC in a rolling mode. I will be sharing only the tested steps and not the outputs.
- I usually have 4 putty sessions open on each node:
- GRID_HOME environment variables set
- RDBMS_HOME environment variables set
- Monitoring the activity in the alert.log of the crs
- Monitoring the activity in the alert.log of the database
- The GRID and RDBMS home owner is 'oracle' in this example.
Prerequisites:
Make sure your have the latest OPatch in both the RDBMS_HOME and GRID_HOME.
$ opatch version
OPatch Version: 12.2.0.1.8
OPatch succeeded.
Let's begin...
Node 1:
1. As RDBMS owner (oracle), shutdown the instance on node 1 and stop all services on the RDBMS_HOME
$ srvctl stop instance -d testdb -i testdb1
# NOTE: Make sure the shutdown database was clean by verifying the message "Instance shutdown complete" in the alert log.
$ $ORACLE_HOME/bin/srvctl stop home -o $RDBMS_HOME -s /tmp/status -n node1
2. Unlock the CRS as ‘root’ user:
export GRID_HOME=/u01/app/12.1.0/grid
$GRID_HOME/crs/install/rootcrs.pl -prepatch
3. As Grid Infrastructure Owner (oracle), apply the OCW patch on the Grid Home:
$GRID_HOME/OPatch/opatch napply -oh $GRID_HOME -local /u01/software/psuoct2016/12cGI/24412235/238547354. As Grid Infrastructure Owner (oracle), apply the DB PSU patch on the Grid Home:
$GRID_HOME/OPatch/opatch napply -oh $GRID_HOME -local /u01/software/psuoct2016/12cGI/24412235/24006101
5. As RDBMS Owner (oracle), apply the OCW PSU patch on the RDBMS Home:
$ cd /u01/software/psuoct2016/12cGI/24412235/23854735/custom/scripts
$ ./prepatch.sh
$ $ORACLE_HOME/OPatch/opatch napply -oh $RDBMS_HOME -local /u01/software/psuoct2016/12cGI/24412235/23854735
6. As RDBMS Owner (oracle), apply the DB PSU patch on the RDBMS_HOME and run ‘postpatch’:
$ORACLE_HOME/OPatch/opatch napply -oh $RDBMS_HOME -local /u01/software/psuoct2016/12cGI/24412235/24006101
cd /u01/software/psuoct2016/12cGI/24412235/23854735/custom/scripts
./postpatch.sh
7. As root:
/u01/app/12.1.0/grid/rdbms/install/rootadd_rdbms.sh
$GRID_HOME/crs/install/rootcrs.pl -postpatch
Executing the final command "rootcrs.pl -postpatch" with lock the crs files and start the cluster services
Wait for 2-3 minutes – till all CRS components are started and DB is in OPEN state
/u01/app/12.1.0/grid/bin/crsctl stat res -t
8. As ‘oracle’:
$ORACLE_HOME/bin/srvctl start home -o $RDBMS_HOME -s /tmp/status1 -n node1
(No Output)
9. As ‘oracle’:
ps -ef | grep pmon
10. Verify the Patches on both GI and RDBMS HOMES:
$ORACLE_HOME/OPatch/opatch lsinventory -oh $RDBMS_HOME
$ORACLE_HOME/OPatch/opatch lsinventory -oh $RDBMS_HOME | grep 24007012
$ORACLE_HOME/OPatch/opatch lsinventory -oh $RDBMS_HOME | grep 23854735
$ORACLE_HOME/OPatch/opatch lsinventory -oh $GRID_HOME
$ORACLE_HOME/OPatch/opatch lsinventory -oh $GRID_HOME | grep 24007012
$ORACLE_HOME/OPatch/opatch lsinventory -oh $GRID_HOME | grep 23854735
11. Check the status of CRS components:
$ crs_stat -t
Node 2:
1. As RDBMS owner (oracle), shutdown the instance on node 1 and stop all services on the RDBMS_HOME
$ srvctl stop instance -d testdb -i testdb2
# NOTE: Make sure the shutdown database was clean by verifying the message "Instance shutdown complete" in the alert log.
$ $ORACLE_HOME/bin/srvctl stop home -o $RDBMS_HOME -s /tmp/status -n node2
Follow steps 2-7 from the Node 1 section
8. As ‘oracle’:
$ORACLE_HOME/bin/srvctl start home -o $RDBMS_HOME -s /tmp/status1 -n node2
(No Output)
9. As ‘oracle’:
ps -ef | grep pmon
10. Verify the Patches on both GI and RDBMS HOMES:
$ORACLE_HOME/OPatch/opatch lsinventory -oh $RDBMS_HOME
$ORACLE_HOME/OPatch/opatch lsinventory -oh $RDBMS_HOME | grep 24007012
$ORACLE_HOME/OPatch/opatch lsinventory -oh $RDBMS_HOME | grep 23854735
$ORACLE_HOME/OPatch/opatch lsinventory -oh $GRID_HOME
$ORACLE_HOME/OPatch/opatch lsinventory -oh $GRID_HOME | grep 24007012
$ORACLE_HOME/OPatch/opatch lsinventory -oh $GRID_HOME | grep 23854735
11. Check the status of CRS components:
$ crs_stat -t
Post -Patch Instructions:
On Node 1:
cd $RDBMS_HOME/OPatch
./datapatch -verbose
Hope this has helped you in some way...
If yes, please don't forget to add a comment!