Social Icons

Pages

2.20.2012

Applying Oracle Patches

Applying Patches on Oracle Database:

1.Download the CPU patch from Metalink.

2.Change the owner of the patch file to oracle user.
# chown –R oracle: install p14841437_112020_SOLARIS64.zip

3.Set the PATH variable to locate the opatch utility.

$ export PATH=$PATH: $ORACLE_HOME/OPatch

4.unzip the patch and go the unzipped directory
$unzip pp14841437_112020_SOLARIS64.zip


------------------------------------------------------------------------

1. Login to the database server using Oracle ID and create the backup folder

2. To create backup folder where the backup file can be created.
example:  $ cd /oradata/dba/backup


3. Issue the tar command to backup the Oracle home
example: $tar –cvf orahome.tar /u01/app/oracle/product/11.2.0/dbhome_1


4. Issue the tar command to backup the Oracle OraInventory
example:  $tar –cvf Inventory.tar /u01/app/OraInventory


To backup the Grid home follow the steps below:

1. Login to the database server using Grid ID
2. Go to the folder where the backup file can be created.
example:  $ cd /oradata/dba/backup


3. Issue the tar command to backup the Grid Home
example:  $ tar –cvf gridhome.tar /u01/app/11.2.0/grid


------------------------------------------------------------------------

1 - Shut down the db instances,ASM instance and Nodeapps services on APPDBSVR01.

1.a. Login with o
racle id
srvctl stop instance -d APPDB -i APPDB1

1.b. Login with grid id

srvctl stop asm –n APPDBSVR01
srvctl stop nodeapps –n APPDBSVR01

If the asm/nodeapps cannot be shut down, then force option can be used.
i.e.
srvctl stop asm -f -n APPDBSVR01

srvctl stop nodeapps -f -n APPDBSVR01

2 - Apply the patch to the RAC home
APPDBSVR01-> cd 14841437
APPDBSVR01-> opatch apply

3. Verify Patches are applied
$opatch lsinventory -detail -oh $ORACLE_HOME              
4 - Start the Nodeapps,ASM instance and db instances on APPDBSVR01,
4.a. Login with grid id
srvctl start nodeapps –n APPDBSVR01
srvctl start asm -n APPDBSVR01
srvctl start instance -d APPDB -i APPDB1

5. On the second node, the post installation steps can be done.

6. Post Installation Steps

For each database instance running on the Oracle home being patched, connect to the database using SQL*Plus.
Connect as SYSDBA and run the catbundle.sql script as follows:


cd $ORACLE_HOME/rdbms/admin
sqlplus /nolog
SQL> CONNECT / AS SYSDBA
SQL> STARTUP
SQL> @catbundle.sql cpu apply
SQL> QUIT

Check the following log files in $ORACLE_HOME/cfgtoollogs/catbundle for anyerrors:

catbundle_PSU_<database SID>_APPLY_<TIMESTAMP>.log


catbundle_PSU_<database SID>_GENERATE_<TIMESTAMP>.log

Recompile all invalid PL/SQL packages
SQL> @?/rdbms/admin/utlrp.sql



Meanwhile, the below might be helpful if you encounter any issues in bringinng up the cluster.

Check the resources status:

Login with grid id:
 $crsctl stat res -t

The output will show you whether cluster and related resources are online or offline.

$cd $ORA_CRS_HOME
$crsctl check crs


If any resource is offline or the below error is encountered while starting up the nodeapps, then crsctl can be used to start the cluster.$ srvctl start nodeapps -n appdbsvr01
PRCR-1070 : Failed to check if resource ora.gsd is registered
Cannot communicate with crsd
PRCR-1070 : Failed to check if resource ora.net1.network is registered
Cannot communicate with crsd
PRCR-1035 : Failed to look up CRS resource appdbsvr01 for ora.cluster_vip.type
PRCR-1068 : Failed to query resources
Cannot communicate with crsd
PRCR-1070 : Failed to check if resource ora.ons is registered
Cannot communicate with crsd


For the above error, execute the below command.
$crsctl start cluster

This will start the resources and bring up the asm.