Apply Opatch on Oracle 10g for PSU patches.

####PSU patching, interim patches #####
Sometimes before moving to a new 10.2.0.* version there are CPU patches released on a regular basis. Here I would illustrate how to use opatch utility in a simple way.
*Before you proceed with PSU patches backup the entire file system of
$ORACLE_HOME and take cold backup of database
*Check environment variable PATH
echo $PATH
if not set..set using command
export PATH=$PATH:/usr/ccs/bin
opatch lsinventory
1. Download the interim patch from Metalink like p9119284_10204_Solaris-64.zip
2. goto $ORACLE_HOME/Opatch
3. create folder ‘patches’
4. FTP file p9119284_10204_Solaris-64.zip to $ORACLE_HOME/Opatch/patches
5. opatch prereq CheckConflictAgainstOHWithDetail -phBaseDir /u2/oracle/product/10.1.0/db/oradb10g_home/OPatch/patches/p9119284_10204_Solaris-64.zip
Please Note: when using phBaseDir the directory pointed to can only contain Oracle patches and no other directories or files.
6. If the above command fails download the latest Opatch utility for 10.2.0.4 from metalink and unzip it in $ORACLE_HOME and overwrite the current Opatch. LINK BELOW
https://updates.oracle.com/Orion/PatchDetails/handle_plat_lang_change?release=80102000&plat_lang=46P&patch_file=&file_id=&password_required=&password_required_readme=&merged_trans=&aru=12030130&patch_num=6880880&patch_num_id=979663&default_release=80102000&default_plat_lang=23P&default_compatible_with=&patch_password=&orderby=&direction=&no_header=0&sortcolpressed=&tab_number=
This normally happens You are trying to apply a Patchset Update (PSU), patch with Overlays or patch with Prerequisites.And your current version of opatch does no support Overlays. So install the latest version of Opatch
7. stop listener and database and close SQL session
lsnrctl stop
SQL> shutdown immediate
8. unzip p9119284_10204_Solaris-64.zip
cd 9119284
opatch apply
# this will take a while, maybe half an hour.
9.   login as root and go to ‘9119284’ directory
export ORACLE_HOME=$ORACLE_HOME:/u2/oracle/product/10.1.0/db/oradb10g_home
run like >>>   sh psu_root.sh
10. login back as oracle user
sqlplus “/as sysdba”
SQL> STARTUP
SQL> @?/rdbms/admin/catbundle.sql
check cat bundle log for errors..if nothing proceed…
11. Recompile Views in database
If you want to check whether view recompilation has already been performed for the database, execute the following statement.
SELECT * FROM registry$history where ID = ‘6452863’;
If the view recompilation has been performed, this statement returns one or more rows. If the view recompilation has not been performed, this statement returns no rows.
check for recompilation for objects needed. by doing below steps
cd $ORACLE_HOME/cpu/view_recompile
sqlplus /nolog
SQL> CONNECT / AS SYSDBA
SQL> @recompile_precheck_jan2008cpu.sql
SQL> QUIT
The purpose of this step is to help you determine whether view recompilation should be done at the same time as the PSU install, or scheduled later.
12. If the database is not in a RAC environment, perform this step.
cd $ORACLE_HOME/cpu/view_recompile
sqlplus /nolog
SQL> CONNECT / AS SYSDBA
SQL> SHUTDOWN IMMEDIATE
SQL> STARTUP UPGRADE
SQL> @view_recompile_jan2008cpu.sql
SQL> SHUTDOWN;
SQL> STARTUP;
SQL> QUIT
If any invalid objects were reported, run the utlrp.sql script as follows:
cd $ORACLE_HOME/rdbms/admin
sqlplus /nolog
SQL> CONNECT / AS SYSDBA
SQL> @utlrp.sql
Shut down and restart the database in normal mode and run utlrp.sql to
recompile invalid objects
Then, manually recompile any invalid objects. For example:
SQL> alter package schemaname.packagename compile;

Category: Database

Tags:

Leave a Reply

Article by: Shadab Mohammad