Monday, November 14, 2016

How to applyCPU Patch on RAC

S/N
Steps
Command
Remarks
1.     
Download Latest CPU Patch from Metalink after every three months. Also download the opatch utility with version the latest version

2.     
SCP CPU Patch to the destination, Where it has to be applied.
scp –rporadb@:

3.     
Shutdown the oracle database and listener on both nodes
SQL>shutdown immediate
ps –ef |greptns
Kill -9

4.     
Take backup of $ORACLE_HOME and Ora Inventory on both nodes
cp –rp $ORACLE_HOME /backup/OraHome_bkp_

5.     
Run /usr/sbin/slibclean if on AIX Based Systems before applying the patch.
/usr/sbin/slibclean

6.     
Unzip the patch file.
Use unzip or gunzip to uncompress the files.

7.     
After unzip, Go to the patch directory on 1st node e.g. /oracle10g/cpu_apr_2007/5901891
cd /oracle10g/cpu_apr_2007/5901891

8.     
Set ORACLE_HOME env value
On Unix Systems use export ORACLE_HOME= and on windows use set ORACLE_HOME=

9.     
Add Opatch utility to PATH env
Export PATH=$PATH:$ORACLE_HOME/OPatch
For running opatch from patch number directory.
10.  
Apply the CPU Patch on 1st node
$opatchnapply –local
Make sure that you are using opatch version 10.2.0.4 napply only works with this version. Check opatch version with $opatch version cmd
11.  
If you want to apply patch on both nodes in a single attempts then use global
$opatchnapply –global

This command will apply the patch on both nodes simultaneously. Please make sure that database and listener are down on both nodes
12.  
If applying with –local
If you are applying the patch one by one on each node then follow the steps 2nd to 10thon each node.



Post installation steps

S/N
Steps
Command
Remarks
1.     
After installing the patch, go to $ORACLE_HOME/cpu directory on any of the node
cd $ORACLE_HOME/cpu
This activity is required on only one node.
2.     
Run catcpu.sql script as SYSDBA
sqlplus /nolog
SQL> CONNECT / AS SYSDBA
SQL> @catcpu.sql
This script should be run on one node only. It is not required on other nodes of RAC
3.     
Check for invalid objects of SYS and SYSTEM Schema
SQL>select count(*),status,owner from dba_objects where owner in (‘SYS’,’SYSTEM’) and status <>’VALID’ group by status,owner
This script should be run on one node only. It is not required on other nodes of RAC
4.     
If above SQL return any rows then, Run utlrp.sql
SQL> @?/rdbms/admin/utlrp.sql
This script should be run on one node only. It is not required on other nodes of RAC
5.     
Re-Check invalid objects of SYS and SYSTEM Schema.



Output

Check with opatch utility that patch has been installed.

1.    $ opatchlsinventory
2.    Repeat this command on all nodes and check the patch number and date.

3.    SQL> select owner,status,count(*) from dba_objects where owner in (‘SYS’,’SYSTEM’) and status<>’VALID’ group by owner,status

4.    Release the system to application team and ask them to check the functionality.



2 comments:

  1. This comment has been removed by a blog administrator.

    ReplyDelete
  2. This comment has been removed by a blog administrator.

    ReplyDelete