Apply Rolling Patch on RAC Environment
OPATCH UTILITY
Opatch is java based utility. It is used for applying the
interim patches to oracle software and used for rolling back if needed.
Check list before patching
SET the oracle_home variable
Backup of the directory like tar of oracle home and database
Update PATH variable for opatch or export in Linux terminal
Steps for apply rolling patch on two Node RAC Environment
1. Set the oracle Environment / Directly mention in opatch command:
In windows:
Set oracle_home=d:\oracle\11204\dbhome_1
echo %ORACLE_HOME%
In linux
export ORACLE_HOME=/u01/app/oracle/12.1.0/dbhome_1
echo $ORACLE_HOME
SET in opatch command
OPATCH command -oh d:\oracle\11204\dbhome_1
2. Check the Oracle database Status on RAC Environment.3. Check readme file for minimum version needed of opatch otherwise download latest version.
srvctl status database -db orcl4. Check the inventory of Oracle home.
OPATCH version
opatch lsinventory -oh /u01/app/oracle/12.1.0/dbhome_1
opatch lsinventory
5. Download the patch & unzip it and check readme file.
6. Check the patch is rolling patch7. Stop the first instance.
opatch query -is_rolling_patch
Message:
Patch is a rolling patch:true
Note: We can patch one Node and bring it up and down second node2 for patching.8. Check the status is NODE1 stopped.
srvctl stop instance -db orcl -node node1
srvctl status database -db orcl
9. Go to NODE1 terminal and set environment variable as in step 1.
Go to patch directory and apply the patch
opatch apply
Note: Following message show first node is completed you can move to another node:
Patching in Rolling mode.
The node 'NODE2' will be patched next.
Please shutdown oracle instance running out of this oracle_home on 'NODE2'.
(ORACLE_HOME='/u01/app/oracle/12101/dbhome_1')
IS the node ready for patching(y/n)
10. After apply patch on first NODE1 then Start the NODE1 instance.
srvctl start instance -db orcl -node node1
11. Check the application is connecting with node1 & working fine.
12. Stop the NODE2 for patch apply
srvctl stop instance -db orcl -node node2
13. Then press y on another terminal for continue apply the patch on NODE2.
14. Then Readme according to post installation steps.