Database Journal
MS SQL Oracle DB2 Access MySQL PostgreSQL Sybase PHP SQL Etc SQL Scripts & Samples Links Database Forum

» Database Journal Home
» Database Articles
» Database Tutorials
MS SQL
Oracle
DB2
MS Access
MySQL
» RESOURCES
Database Tools
SQL Scripts & Samples
Links
» Database Forum
» Sitemap
Free Newsletters:
DatabaseDaily  
News Via RSS Feed


follow us on Twitter
Database Journal |DBA Support |SQLCourse |SQLCourse2
 

Featured Database Articles

Oracle

Posted Dec 23, 2005

Database Security and Oracle Patches - Part 4

By Steve Callan

At the end of Part 3, a patch for an Oracle 10.2.0.1 database was obtained from MetaLink and cached in a cache repository. During the installation, the patch was not applied (although it could have been at that time). In this part of the series, Oracle's OPatch utility will be used to actually apply the cached patch.

What is OPatch?

Detailed information about OPatch is available in Chapter 8 (Oracle Software Patching Using OPatch) of Oracle® Universal Installer and OPatch User's Guide
10g Release 2 (10.2) for Windows and UNIX
. From the documentation:

OPatch is an Oracle supplied utility to assist you with the process of applying interim patches to Oracle's software. OPatch is a Java-based utility which requires the Oracle Universal Installer to be installed. It is platform independent and runs on all supported operating systems. OPatch supports the following:

  • Applying an interim patch.
  • Rolling back the application of an interim patch.
  • Detecting conflict when applying an interim patch after previous interim patches have been applied. It also suggests the best options to resolve a conflict.
  • Reporting on installed products and interim patch.

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.

A question frequently seen on Oracle-related Web sites is "how do I find out what version or patch am I using?" One of OPatch's features - the last bulleted item in the list above – is its ability to report on installed products.

Putting OPatch to work

Although "opatch" is an Oracle executable, it is not located in the bin directory. Under the OPatch directory in ORACLE_HOME, there exists a Perl (for UNIX) and a batch (for Windows) opatch file. Running "opatch" by itself produces the following output. The log file location was edited where "<>" appears (and yes, there really are two periods after "All rights reserved," but that is from Oracle, not me).

C:\>%ORACLE_HOME%\Opatch\opatch
Invoking OPatch 10.2.0.1.0
Oracle interim Patch Installer version 10.2.0.1.0
Copyright (c) 2005, Oracle Corporation.  All rights reserved..

Oracle Home       : C:\oracle\product\10.2.0\db_1
Central Inventory : n/a
   from           : C:\Program Files\Oracle\Inventory
OPatch version    : 10.2.0.1.0
OUI version       : 10.2.0.1.0
OUI location      : C:\oracle\product\10.2.0\db_1\oui
Log file location : C:<$OH>\cfgtoollogs\opatch\opatch-<date_info>.log

 Usage: opatch [ -help ] [ -r[eport] ] [ command ]
            command := apply
                       lsinventory
                       query
                       rollback
                       version
 <global_arguments> := -help       Displays the help message for the command.
                       -report     Print the actions without executing (deprecated).
 example:
   'opatch -help'
   'opatch apply -help'
   'opatch lsinventory -help'
   'opatch rollback -help'

OPatch succeeded.
C:\>
Output from using "opatch" by itself
Adding the lsinventory option to opatch produces output like so:

C:\>%ORACLE_HOME%\opatch\opatch lsinventory
Invoking OPatch 10.2.0.1.0
Oracle interim Patch Installer version 10.2.0.1.0
Copyright (c) 2005, Oracle Corporation.  All rights reserved..

Oracle Home       : C:\oracle\product\10.2.0\db_1
Central Inventory : n/a
   from           : C:\Program Files\Oracle\Inventory
OPatch version    : 10.2.0.1.0
OUI version       : 10.2.0.1.0
OUI location      : C:\oracle\product\10.2.0\db_1\oui
Log file location : C:<$OH>\cfgtoollogs\opatch\opatch-<date>.log
Lsinventory Output file location : 
  C:\oracle\product\10.2.0\db_1\cfgtoollogs\opatch\lsinv\lsinventory-2005_Dec
-----------------------------------------------------------------------
Installed Top-level Products (1):
Oracle Database 10g                                                  10.2.0.1.0
There are 1 products installed in this Oracle Home.

There are no Interim patches installed in this Oracle Home.
-----------------------------------------------------------------------
OPatch succeeded.
Output from using "opatch" by itself

Adding the lsinventory option to opatch produces output like so:

C:\>%ORACLE_HOME%\opatch\opatch lsinventory
Invoking OPatch 10.2.0.1.0
Oracle interim Patch Installer version 10.2.0.1.0
Copyright (c) 2005, Oracle Corporation.  All rights reserved..

Oracle Home       : C:\oracle\product\10.2.0\db_1
Central Inventory : n/a
   from           : C:\Program Files\Oracle\Inventory
OPatch version    : 10.2.0.1.0
OUI version       : 10.2.0.1.0
OUI location      : C:\oracle\product\10.2.0\db_1\oui
Log file location : C:<$OH>\cfgtoollogs\opatch\opatch-<date>.log
Lsinventory Output file location : 
  C:\oracle\product\10.2.0\db_1\cfgtoollogs\opatch\lsinv\lsinventory-2005_Dec
-----------------------------------------------------------------------
Installed Top-level Products (1):
Oracle Database 10g                                                  10.2.0.1.0
There are 1 products installed in this Oracle Home.

There are no Interim patches installed in this Oracle Home.
-----------------------------------------------------------------------
OPatch succeeded.
Opatch "lsinventory" report

Going one step further, adding the report parameter (opatch lsinventory –detail) produces an extensive report of installed components. Instead of trying to read everything on the screen, review the log file because it contains what is shown on your monitor (but in a slightly different format). A partial log file is shown below.

SEVERE:OPatch invoked as follows: 'lsinventory -detail '
INFO:Starting LsInventorySession at Sat Dec 17 21:15:32 MST 2005
INFO:Lsinventory Output file location : $OH\cfgtoollogs\opatch\lsinv\lsinventory-<date>.txt 
INFO:------------------------------------------------------------------
INFO:Installed Top-level Products (1): 
INFO:Oracle Database 10g                             10.2.0.1.0
INFO:There are 1 products installed in this Oracle Home.
INFO:
INFO:Installed Products (114): 
INFO:Agent Required Support Files                    10.2.0.1.0
INFO:Assistant Common Files                          10.2.0.1.0
INFO:Bali Share                                      1.1.18.0.0
INFO:Buildtools Common Files                         10.2.0.1.0
INFO:Character Set Migration Utility                 10.2.0.1.0
INFO:Database Configuration and Upgrade Assistants   10.2.0.1.0
INFO:Database SQL Scripts                            10.2.0.1.0
INFO:Database Workspace Manager                      10.2.0.1.0
INFO:DBJAVA Required Support Files                   10.2.0.1.0
INFO:Enterprise Edition Options                      10.2.0.1.0
Detailed reporting from lsinventory

However, a better-looking output file is contained under the lsinv directory (the "INFO:" parts of each line are not displayed). As you can see, a very simple command answers the commonly seen "how do I see what my patch information is" question.



Oracle Archives

Comment and Contribute

 


(Maximum characters: 1200). You have characters left.

 

 




Latest Forum Threads
Oracle Forum
Topic By Replies Updated
Oracle Data Mining: Classification jan.hasller 0 July 5th, 07:19 AM
Find duplicates - Unique IDs Lava 5 July 2nd, 08:30 AM
no matching unique or primary key rcanter 1 April 25th, 12:32 PM
Update values of one table based on condition of values in other table using Trigger Gladiator 3 February 29th, 06:01 PM


















Thanks for your registration, follow us on our social networks to keep up-to-date