When applying a needed patch to the grid infrastructure home for ASM or CRS the opatch utility may error out with the messages:
ApplySession failed: ApplySession failed to prepare the system. ApplySession was not able to create the patch_storage area: /oragrid/rdb_v112/.patch_storage/<patch#_date>
System intact, OPatch will not attempt to restore the system
OPatch failed with error code 73
These errors can be found in the opatch <date_time>. Log File in grid_home/export toollogs/opatch directory.
The reason for these messages are the permissions of the grid infrastructure home.
The grid home needs to be unlocked before a patch can be applied.
Solution
The needed command to unlock the grid home is described in
Oracle grid infrastructure installation guide
11g Release 2 (11.2) for Linux (or other platform)
Part number E10812-03
Chapter 5.4 modifying Oracle clusterware binaries after installation
After installation, if you need to modify the Oracle clusterware configuration, then you must unlock the grid home. Please check this chapter for more detailed instructions.
The basic steps needed are:
Unzip the patch file into a patch location on all nodes. This is becuase we will do a Rolling Patch
Stopping processes patching the homes and starting processes one node at a time using the-local flag.
1. Stop the CRS managed resources running from DB homes (as the db_home owner) using
$DB_HOME/bin/srvctl stop home -o <DB_HOME> -s <status file location> -n
<node name>
Note the status file is created by the process
2. As root user change directory to the pathGrid_home/CRS/install, Where grid_home is the path to the grid home, and unlock the grid home using the commandRootcrs. pl-Unlock-crshome grid_home, Where grid_home is the path to your grid infrastructure home. For example, with the grid home/u01/APP/11.2.0/GRID, enter the following command:
# cd /u01/app/11.2.0/grid/crs/install
# perl rootcrs.pl -unlock -crshome /u01/app/11.2.0/grid
3. Change User to grid software owner and apply the patch according its readme
/u01/app/11.2.0/grid/OPatch/opatch napply -oh <CRS_HOME> -local <path to patch>
4. If requested in readme file of patch run the pre script for DB Component of the patch using (As DB home privilige user)
patch location/custom/server/patch id/custom/scripts/prepatch.sh -dbhome <DB_HOME>
5. Apply the DB patch using (As DB home privilige user) (if needed and stated in readme file. This example is for a bundle patch containing a CRS portion and a RDBMS portion)
<DB_HOME>/OPatch/opatch napply -oh <DB_HOME> -local <path to bundle patch>/custom/server/<patch_id>
Note here the sub-directory of the patch.
6. Run the Post Script For DB Component of the patch using (As DB home privilige user) (if requested in readme file)
patch location/custom/server/patch id/custom/scripts/postpatch.sh -dbhome <DB_HOME>
7. Run the Post Script (as root privilege user)
# cd /u01/app/11.2.0/grid/crs/install
# perl rootcrs.pl -patch
8. Start the CRS managed resources that were earlier running from DB homes using
<DB_HOME>/bin/srvctl start home -o <DB_HOME> -s <status file location> -n <node name>
9. Repeat steps 1 through 8 on each cluster member node.
These are the general commands to apply a patch to grid home. Make sure to read the README file of the patch you are going to apply as additional steps may be needed.
The rootcrs. pl script to unlock and patch grid home may not be mentioned in the participating readme.
From Oracle
Bytes -------------------------------------------------------------------------------------------------------
Blog: http://blog.csdn.net/tianlesoftware
Email: dvd.dba@gmail.com
Dba1 group: 62697716 (full); dba2 group: 62697977 (full) dba3 group: 62697850 (full)
Super DBA group: 63306533 (full); dba4 group: 83829929 dba5 group: 142216823
Chat group: 40132017 chat 2 group: 69087192
-- Add the group to describe the relationship between Oracle tablespace and data files in the remarks section. Otherwise, the application is rejected.