Database Version Upgrade Patch | Latest CPU Patch Included In Upgrade Patch |
9.2.0.8 | July 2006 |
10.1.0.5 | October 2005 |
10.2.0.3 | October 2006 |
10.2.0.4 | April 2008 |
11.1.0.6 | October 2007 |
11.1.0.7 | January 2009 |
Prior
to
release 10.2 (OPatch for 10.2 is only compatible with 10.2
and nothing earlier), OPatch was available from MetaLink as
a patch in and of itself (p2617419_10102_GENERIC.zip for
release 10.1.0.2). With 10.2, OPatch is installed as part of
the RDBMS software.
Important
Note
If Opatch is installed, please remember to set your Oracle Home
Directory:
C:\app\product\11.2.0\dbhome_1\OPatch>
set ORACLE_HOME=C:\app\product\11.2.0\dbhome_1
And also to add the Opatch Directory to your path:
set
PATH=C:\app\product\11.2.0\dbhome_1\OPatch;%PATH%
Then you can see what is installed with:
C:\app\product\11.2.0\dbhome_1\OPatch>
cd OPatch
C:\app\product\11.2.0\dbhome_1\OPatch>
opatch version
Invoking OPatch 11.1.0.6.6
OPatch Version: 11.1.0.6.6
OR
C:\app\product\11.2.0\dbhome_1\OPatch>
opatch lsinventory
Invoking OPatch 11.1.0.6.6
Oracle Interim Patch
Installer version 11.1.0.6.6
Copyright (c) 2009, Oracle
Corporation. All rights reserved.
Oracle
Home :
C:\app\product\11.2.0\dbhome_1
Central Inventory :
C:\Program Files\Oracle\Inventory
from
: n/a
OPatch
version : 11.1.0.6.6
OUI
version : 11.2.0.1.0
OUI
location :
C:\app\product\11.2.0\dbhome_1\oui
Log file location :
C:\app\product\11.2.0\dbhome_1\cfgtoollogs\opatch\opatch2012-08-27_14-21-49PM.log
Patch history file:
C:\app\product\11.2.0\dbhome_1\cfgtoollogs\opatch\opatch_history.txt
Lsinventory Output file
location :
C:\app\product\11.2.0\dbhome_1\cfgtoollogs\opatch\lsinv\lsinventory2012-08-27_14-21-49PM.txt
--------------------------------------------------------------------------------
Installed Top-level Products
(1):
Oracle Database
11g
11.2.0.1.0
There are 1 products
installed in this Oracle Home.
There are no Interim patches
installed in this Oracle Home.
--------------------------------------------------------------------------------
Opatch
has
several options to execute it:
Applying a patch is simple as:
Steps
to get Opatch (probably not needed, 1 time only)
From a command prompt:
ftp updates.oracle.com (metalink username
and password)
ftp> bin
## For 9i
R2(9.2.x) and 10GR1(10.1.x)
ftp> cd /2617419
ftp> get p2617419_10102_GENERIC.zip
ftp> quit
## For
10GR2(10.2.x) ftp> cd /4898608
ftp> cd 4898608
ftp> get
p4898608_10202_GENERIC.zip
ftp> quit
Opatch
Installation
(probably
not needed, 1 time only)
## For 9i R2(9.2.x) and 10GR1(10.1.x)
Then upload or move the p2617419_10102_GENERIC.zip to
ORACLE_HOME and uncompress it. Example:
% mv p2617419_10102_GENERIC.zip
$ORACLE_HOME
% cd $ORACLE_HOME
% unzip p2617419_10102_GENERIC.zip
.......
........
% cd OPatch
% opatch version
PERL5LIB=/oracle/V920/Apache/perl/lib/5.00503:./perl_modules;
export PERL5LIB
/oracle/V920/Apache/perl/bin/perl ./opatch.pl version
./opatch.pl version: 1.0.0.0.49
## For 10GR2(10.2.x)
% mv p4898608_10202_GENERIC.zip $ORACLE_HOME
% cd $ORACLE_HOME
% unzip p4898608_10202_GENERIC.zip
.....
.....
% cd OPatch
% opatch version
Invoking OPatch 10.2.0.2.1
OPatch Version: 10.2.0.2.1
Finally, you can set the Opatch directory in your PATH
variable so you can execute the opatchcommand from anywhere.
Example:
For Korn / Bourne shell
% export PATH=$PATH:$ORACLE_HOME/Opatch
For C Shell
% setenv PATH $PATH:$ORACLE_HOME/Opatch
Don't forget to check the readme file for post-installation/deinstallation steps. In general, the post-installation steps require running of the catcpu.sql script, followed by using the utlprp.sql script used to recompile invalid objects. Is that SQL script named utlrp or utlprp? In this case, the README file says utlprp, whose function is essentially the same as that of utlrp. What is the difference between the scripts? As it turns out, utlrp simply calls utlprp. The deinstallation tasks are nearly identical, with the main difference being that you use the catcpu_rollback SQL script.
For
Patch 4667809, the catcpu/catcpu_rollback scripts are
related to applying and unapplying changes related to the
OWA toolkit (OWA = Oracle Web Agent, which uses modplsql,
which uses PL/SQL to generate dynamic Web pages, and that's
why you see modplsql in the patch-related files folders).
Example
Applying
Patch 4751921
After the Patch is Installed:
1.Log in as sys as sysdba.
2. cd $ORACLE_HOME/rdbms/admin
3. spool catpatch_database_name
4. shutdown immediate
5. startup migrate
6. @catpatch.sql ( this takes at least 1 hour ).
After catpatch completed,
7. select object_name,owner from dba_objects where
ststus='INVALID';
( YOU WILL GET BETWEEN 230-3300 INVALID OBJECTS , DON'T
PANIC )
8. @utlrp.sql
9.select object_name,owner from dba_objects where
ststus='INVALID'; ( YOU WILL GET near 0 invalid
objects )
10. shutdown immediate;
11. startup
Listing Patches
Along with the log and inventory files, Opatch output includes a history file, which contains date and action performed information. The history file is named opatch_history.txt and is located in the $OH\cfgtools\opatch directory. As an example of its contents, the "rollback help" action performed earlier was recorded as:
Date & Time : Sun Dec 18 12:00:50 MST 2005
Oracle Home : C:\oracle\product\10.2.0\db_1
OPatch Ver. : 10.2.0.1.0
Current Dir : C:\
Command : rollback -help
Log File :
$OH\cfgtoollogs\opatch\opatch-<date>.log
So,
as yet another way to answer the "what patches are
installed" question, you can use the OPatch history file.
Here is an example of the SQL command to see the status of patches on a database:
select patch_id, patch_uid, version, status, bundle_series, description
from dba_registry_sqlpatch;