You are on page 1of 10

SAP Note 839182 Note Language: English

Installing patches using OPatch


Version: 62 Validity:
Valid Since 17.06.2010

Summary
Symptom OPatch
This note describes how to install Oracle database patches using the Oracle tool "OPatch" in the SAP environment. This note applies to Oracle Releases 10.2 and 11.2. For Oracle Release 9.2, see Note 306408.

General information about OPatch


OPatch is used for the installation of Oracle database patches both on UNIX/Linux platforms and on Windows platforms. There are different patch variants (generic, merge, bundle, and so on). For more information about these, see Note 839187. The complete documentation for OPatch is available in the " Universal Installer and OPatch User's Guide for Windows and UNIX" in the Oracle online documentation.

Other terms Reason and Prerequisites


You use OPatch in the SAP environment with Oracle Release 10.2 and 11.2.

Solution Contents
General information and prerequisites for OPatch Overview of OPatch commands Displaying installed patches SAP-specific OPatch version Installing a new OPatch version Installing patches on UNIX/Linux Installing patches on Windows Installation of several patches with "napply" Appendix A: Descriptions and abbreviations Appendix B: Technical overview of OPatch versions

General information and prerequisites for OPatch


o OPatch is in the Oracle Home in the directory OPatch.
Page 1 of 10

26.08.2010

SAP Note 839182 -

Installing patches using OPatch

The same operating system user that was used to install the Oracle software is also used for installing or uninstalling patches using OPatch. For UNIX/Linux, this is the user ora<dbsid>; for Windows, this is the user <sapsid>adm. OPatch requires that the environment variable ORACLE_HOME is set. Without extending the search path, you can call OPatch in the following way: UNIX : OS> $ORACLE_HOME/OPatch/opatch [command] [options] Windows: OS> %ORACLE_HOME%\OPatch\opatch [command] [options] Note the information specified in the patch README.txt, especially: Pre-installation steps Post-installation steps For generic patches, you generally have to execute SQL scripts or SQL commands after installing the relevant patch to ensure that it becomes effective.

o o

Before you install or uninstall patches, you must stop all of the instances and processes that were started from the ORACLE_HOME. On Windows, you must also stop the database services (listener, agent, and DB service). You can install several Oracle database patches in direct succession without having to restart the Oracle instance after each patch, provided that the patch description does not contain other instructions (for UNIX, see Note 1027012 about MOPatch). You can use both OPatch (see below, lsinventory) and the Universal Installer to determine the patches that are currently installed. After you install or uninstall one or more patches, execute 'opatch Isinventory' to log the new patch status in an OPatch log. The OPatch log files are stored in the directory ORACLE_HOME/cfgtoollogs/opatch. In addition to these action logs for each individual OPatch action, OPatch also logs all the OPatch activities in a summary log opatch_history.txt in the same directory. OPatch inventory listings are also stored in the directory ORACLE_HOME/cfgtoollogs/opatch/lsinv.

Overview of OPatch commands


o Displaying the OPatch version OS> opatch version Displaying the online help OS> opatch -help Displaying the online help for a certain command OS> opatch <command> -help <command> = apply, rollback, lsinventory, util
Page 2 of 10

26.08.2010

SAP Note 839182 -

Installing patches using OPatch

Displaying the Oracle inventory (see below) OS> opatch lsinventory [-all][-detail] Installing a patch (see below) OS> opatch apply Installing several patches (see below) OS> opatch napply Uninstalling a patch (see below) OS> opatch rollback -id <patchid> Special functions of OPatch OS> opatch util Cleanup of the patch storage directory OS> opatch util cleanup When you install patches using MOPatch (UNIX/Linux), the patch storage directory is automatically cleaned up by default using this option.

You can use the option -silent to suppress the user query 'Is the local system ready for patching?' and the command (for example, opatch apply) is executed without further query. You should use the option -silent only if you are certain that the Oracle instance and all of the processes from the affected ORACLE_HOME have been stopped. You can also specify the option -verbose for each OPatch command to obtain detailed information about the patch process.

Displaying installed patches


'opatch lsinventory' shows the patches that are currently installed. UNIX : OS> $ORACLE_HOME/OPatch/opatch lsinventory [-all] [-details] Win : OS> %ORACLE_HOME%\OPatch\opatch lsinventory [-all][-details]

o o

'opatch lsinventory -all' shows all of the registered Oracle Homes. 'opatch lsinventory -details' shows detailed information about each individual patch (module, make objects, and so on). 'opatch lsinventory -group_by_date' shows patches day by day and grouped according to installation date.

SAP-specific OPatch version

An SAP-specific version of OPatch is available on SAP Service Marketplace, which you should install before you begin to install patches. The SAP version of OPatch can be identified from the following message:

26.08.2010

Page 3 of

10

SAP Note 839182 -

Installing patches using OPatch

OS> <opatch> version ======================================================== GENERIC OPATCH VERSION - FOR USE IN SAP ENVIRONMENT ONLY ========================================================

Installing a new OPatch version


From time to time, you will have to install a new version of OPatch, for example, because the patch description requires a specific version or to install the generic SAP version. The OPatch version that corresponds to the relevant Oracle release is then available on SAP Service Marketplace (link: http://service.sap.com/oracle-download)

For Oracle Release 11.2.0.1: --> Oracle -----> Oracle 11.2.0.1 ---------> OPatch For Oracle Release 10.2.0.4: --> Oracle -----> Oracle 10.2.0.4 ---------> OPatch (only for Release 10.2.0.4) For Oracle Release 10.2.0.2: --> Oracle -----> Oracle other ---------> OPatch 10.2 (only for Release 10.2.0.2) For Oracle Release 10.2.0, do not use any old OPatch version from the directory 'Oracle other' -> 'Tools'.

The procedure is as follows:

1.

Download the relevant file with the new OPatch version from SAP Service Marketplace and copy this file to the Oracle Home. Rename the previous, old OPatch directory. UNIX: OS> cd $ORACLE_HOME OS> mv OPatch OPatch.SAVE Proceed accordingly on Windows. Unpack the new version of OPatch: UNIX: OS> cd $ORACLE_HOME OS> unzip -d $ORACLE_HOME OPatch_<release>.zip Proceed accordingly on Windows. After this, the installation is complete and the new OPatch version is ready for use.

2.

3.

4.

Installing patches on UNIX/Linux

26.08.2010

Page 4 of

10

SAP Note 839182 -

Installing patches using OPatch

On Unix/Linux platforms, you should install patches only with MOPatch because of the many advantages. For more information about MOPatch, see Note 1027012. The general procedure for manually installing a patch using OPatch is as follows:

1.

For each Oracle patch set release, you must first create a separate patch base directory <patch_base_dir>. For example: OS> mkdir patches.11201 (for Release 11.2.0.1) OS> mkdir patches.10204 (for Release 10.2.0.4)

2.

Copy the patch file(s) <patchfile> to be installed to the base directory and unpack the file there. In this case, an individual patch directory <patch_dir> is created in the base directory for each individual patch. OS> cp <patchfile> <patch_base_dir> OS> cd <patch_base_dir> OS> unzip <patchfile>

3.

Stop the instance and all of the Oracle processes of the relevant ORACLE_HOME. Before installing the patch, you should save the Oracle Home and the Oracle inventory. Install the patch or the patches as follows: Option 1: Calling OPatch specifying the patch directory OS> $ORACLE_HOME/OPatch/opatch apply <patch_dir> Option 2: Calling OPatch directly from the patch directory OS> cd <patch_dir> OS> $ORACLE_HOME/OPatch/opatch apply

4.

5.

6.

Note the information specified in the patch README with regard to the required post-installation steps. Optional: Clean up the patch storage directory (Cleanup) OS> $ORACLE_HOME/OPatch/opatch util cleanup

7.

Installing patches on Windows


For the installation, note the exact installation instructions from the patch README. 1. For each Oracle patch set release or Patch Set Update (PSU) Release, you must first create a separate patch base directory <patch_base_dir>. For example: OS> mkdir patches.11201 (for Release 11.2.0.1) OS> mkdir patches.10204 (for Release 10.2.0.4)
26.08.2010 Page 5 of 10

SAP Note 839182 -

Installing patches using OPatch

2.

Copy the patch to be installed to the base directory and unpack it there (for example, using zip or winzip) in the directory <patch_dir>. Stop all of the Oracle processes, Oracle services and so on of the relevant Oracle Home ( OracleService<DBSID>, Oracle<ORACLE_HOME_NAME>TNSListener, OracleDBConsole<DBSID>). Before installing the patch, you should save the Oracle Home and the Oracle inventory. Install the patch by calling OPatch as follows: Option 1: Calling OPatch specifying the patch directory OS> %ORACLE_HOME%\OPatch\opatch apply <patch_dir> Option 2: Calling OPatch directly from the patch directory OS> cd <patch_dir> OS> %ORACLE_HOME%\OPatch\opatch apply

3.

4.

5.

6.

Then perform the postprocessing steps Patch Post Install Instructions that are prescribed in the patch README if they can be used. Optional: Clean up the patch storage directory (Cleanup) OS> %ORACLE_HOME%\OPatch\opatch util cleanup

7.

Installation of several patches with "napply"


OPatch also provides the option of installing several patches with an OPatch call. 1. Copy the patch files to be installed to the base directory <patch_base_dir>, but do not unpack them. Install the patches as follows: OS> <opatch> napply <patch_base_dir>

2.

If several patches have been installed, but others have not, you can skip the already installed patches with "-skip_duplicate". OS> 3. <opatch> napply <patch_base_dir> -skip_duplicate

Then perform the postprocessing steps Patch Post Install Instructions if they can be used.

Appendix A: Descriptions and abbreviations


Descriptions and abbreviations used in this note: o <opatch> Generic call of OPatch
Page 6 of 10

26.08.2010

SAP Note 839182 -

Installing patches using OPatch

UNIX : OS> $ORACLE_HOME/OPatch/opatch Windows: OS> %ORACLE_HOME%\OPatch\opatch o <patch_base_dir> Patch base directory <patch_dir> Directory that is created if a <patchfile> is unpacked (see below). <patchfile> Patch file. The name consists of Prefix 'p' <patch_id>: Unique patch ID <release>: Oracle Release: for example, 10204, 11201 <platform>: Unique identifier of the platform or "Generic" for generic patches. .zip: Extension

Appendix B: Technical overview of OPatch versions


OPatch Release 11.2.0.1 Release: 11.2.0.1.X Download link: http://service.sap.com/oracle-download Oracle->Oracle 11.2.0.1->OPatch Download zip file: OPatch_112011_Generic.zip OCM support: See Note 1227404. MOPatch support: See Note 1027012.

OPatch Release 10.2.0.4 Release: 10.2.0.4 Oracle patch ID: 6880880 (Oracle MetaLink 602334.1) Runtime environment: Java (installed in ORACLE_HOME) Patch storage (UNIX): $ORACLE_HOME/.patch_storage OPatch log files (UNIX): $ORACLE_HOME/cfgtoollogs/opatch $ORACLE_HOME/cfgtoollogs/opatch/lsinv OPatch history file: opatch_history.txt Download link: http://service.sap.com/swcenter-3pmain Oracle->Oracle 10.2.0.4->OPatch Download zip file: Opatch_10204_Generic_v<n>.zip OCM support: No, see Note 1227404. MOPatch support: Yes, see Note 1027012. As of June 9, 2008, you can no longer use the OPatch version, which is also available for Release 10.2.0.4 in patch 4898608 on Oracle MetaLink, to install patches (see Oracle MetaLink Note 602334.1). Therefore, use the OPatch version for Release 10.2.0.4 that is available on SAP Service Marketplace for the patch installation for Oracle Release 10.2.0.4 in the SAP environment.

26.08.2010

Page 7 of

10

SAP Note 839182 -

Installing patches using OPatch

The OPatch version for Release 10.2.0.4, which is available on SAP Service Marketplace, is a special version of OPatch that is released only for the use in the SAP environment. It is platform-independent and does not include OCM support, unlike the OPatch version on Oracle MetaLink (patch ID 6880880). The version display of the SAP version of OPatch is as follows: %> $ORACLE_HOME/OPatch/opatch version ======================================================== GENERIC OPATCH VERSION - FOR USE IN SAP ENVIRONMENT ONLY ======================================================== Invoking OPatch 10.2.0.4.3 OPatch Version: 10.2.0.4.3 OPatch succeeded. %> OPatch Release 10.2.0.2 Release: 10.2.0.2 Oracle patch ID: 4898608 (Oracle MetaLink 602334.1) Runtime environment: Java (installed in ORACLE_HOME) Patch storage (UNIX): $ORACLE_HOME/.patch_storage OPatch log files (UNIX): $ORACLE_HOME/cfgtoollogs/opatch $ORACLE_HOME/cfgtoollogs/opatch/lsinv OPatch history file: opatch_history.txt Download link: http://service.sap.com/swcenter-3pmain Oracle->Oracle other->OPatch 10.2 Download zip file: p4898608_10202_GENERIC_v<n>.zip OCM support: No MOPatch support: Yes, see Note 1027012. As of June 9, 2008, you can no longer use the OPatch version that is available in patch 4898608 on Oracle MetaLink to install patches (see Oracle MetaLink Note 602334.1). Therefore, continue to use the OPatch version for Release 10.2.0.2 that is available on SAP Service Marketplace for the patch installation for Oracle Release 10.2.0.2 in the SAP environment.

Header Data
Release Status: Released on: Master Language: Priority: Category: Primary Component: Secondary Components: BC-DB-ORA-DBA Database Administration with
26.08.2010 Page 8 of 10

Released for Customer 17.06.2010 09:42:47 German Correction with high priority Installation information BC-DB-ORA Oracle

SAP Note 839182 -

Installing patches using OPatch

Oracle

The Note is release-independent

Related Notes
Number 1431800 1228643 1227404 1178339 1137346 1027012 1026237 1010217 899070 871735 871096 839574 839187 820062 640910 629588 306408 Short Text Oracle 11.2.0: Central Technical Note Oracle Clusterware: Patches on top of Oracle 10.2.0.4 Oracle Database 10g: Oracle Configuration Manager (OCM) Universal Installer / OPatch tools are Hanging and / or Fail Oracle 10.2.0: Patches/patch collections for Oracle 10.2.0.4 MOPatch - Install Multiple Oracle Patches in One Run FAQ: OPatch and Universal Installer 10.2 Oracle CRS: Patches for RAC enabled SAP Systems ORA-01406 reported on SELECT against SAP Tables (eg.TRDIR) Current patch set for Oracle 10.2.0 Oracle 10.2.0: Patches/patch collections for Oracle 10.2.0.2 Oracle Database 10g: Stopping Oracle CSS Service ocssd.bin Oracle 10.2.0: Applying patch set/patches/patch collection Oracle Database 10g: Patch sets/patches for 10.1.0 Problems when using OPatch Current versions of OPatch and OUI Oracle 9.2.0: Using OPatch to install patches

Attributes
Attribute Database system Database system Database system Database system Value ORACLE Oracle 10 Oracle 10.2 Oracle 11.2

Attachments

26.08.2010

Page 9 of

10

SAP Note 839182 File Type ZIP ZIP ZIP ZIP ZIP File Name

Installing patches using OPatch


Language E E E E E Size 1.029 KB 1.029 KB 733 KB 759 KB 768 KB

p4898608_102025_GENERIC.zip p4898608_10204_Generic_v2.zip p4898608_102022_GENERIC.zip p4898608_102023_GENERIC.zip p4898608_102024_GENERIC.zip

26.08.2010

Page 10 of

10

You might also like