Summary

Symptom

 

Oracle patch installation using OPatch

This note describes how to install Oracle database patches using the Oracle patch tool OPatch for Oracle Release 10.2 in the SAP environment. For Oracle Release 9i, see Note 306408.

For information about installing Oracle database patches using the Oracle tool MOPatch, see Note 1027012. This tool supports the collective installation and the delta installation of patches on UNIX platforms as of Oracle Release 10.2.

This note also describes the procedure for installing a new version of OPatch for Oracle Release 10.2.0.2 or 10.2.0.4 (see below).

Other terms


Patch 2617419
Patch 4898608
Patch 6880880

p2617419_10102_GENERIC.zip
p4898608_10202_GENERIC_v5.zip
Opatch_10204_Generic_v3.zip

Reason and Prerequisites


Oracle patch installation for Oracle Release 10.2 in the SAP environment.

Solution

 

Patches, patch sets, merge patches, critical patch updates, bug fixes

This section describes the differences between Oracle database patch sets, Oracle database patches, merge patches, Critical Patch Updates (CPUs), and so on.

Oracle Database Patch Sets

Oracle database patch sets are installed using the Oracle Universal Installer (OUI) (UNIX: runInstaller, Windows: setup.exe). Generally, Oracle patch sets cannot be uninstalled. Before you install a new patch set, you should always create a backup of the relevant Oracle software (ORACLE_HOME), including the current Oracle inventory (except when you first install an Oracle Home). You must install a patch set in accordance with the instructions that come with it (patchnote.htm, readme.htm).

Oracle Database Patches

As of Oracle9i, you can install and uninstall Oracle database patches with the Oracle patch tool (Unix: opatch, Windows: opatch.bat).  As of Oracle Database Release 10g, OPatch is contained in ORACLE_HOME in the directory OPatch by default.

An Oracle database patch is sometimes also called 'interim patch' (temporary correction), 'one-off' (individual correction), or simply 'bug fix' (error correction) because it corrects only an individual error. If several error corrections are combined in one patch, this is known as a 'merge patch' (see below).

Each Oracle database patch contains instructions for installing and uninstalling the patch (README.txt). In addition to the general statements, these instructions may also contain patch-specific statements that you must also execute before or after installing or uninstalling the patch.

Patch collections and Critical Patch Updates (CPUs) for Windows

For reasons relating to the software, there are patch collections (known as 'bundle patch', 'patch collection', or sometimes also 'mini patch') for Windows platforms, which combine the corrections of several individual patches in a patch collection.

Individual patches, like the ones for UNIX platforms, are not available for Windows. For this reason, MOPatch is available only for UNIX platforms. MOPatch automates the installation of several individual patches.

Patch collections that are relevant for the SAP environment are available on SAP Service Marketplace (see Note 871735). Some of these patch collections are Critical Patch Updates (CPUs), which are provided within the critical patch update program (see Note 850306). On Windows platforms, there is no difference between a CPU and a patch collection with regard to the technical installation. Both are installed using OPatch.

Merge patches

A merge patch contains several error corrections in one patch. Merge patches are required if the correction of an error is contained in the same program module as the correction of another error. After you install a merge patch, the OPatch inventory log lists the number of the 'Merge bug' and the relevant numbers (bug IDs) of the individual errors, which have been corrected in the merge patch, under 'Bugs fixed'.

Technical differences between OPatch 9.2/10.1 and OPatch 10.2


OPatch Release 9.2/10.1

Release: 9.2.0/10.1.0
Oracle patch ID: 2617419 (Oracle MetaLink 602334.1)
Runtime environment: Pearl (installed in ORACLE_HOME)
Patch storage     (UNIX): $ORACLE_HOME/.patch_storage
OPatch log files (UNIX): $ORACLE_HOME/.patch_storage
Download link: http://service.sap.com/swcenter-3pmain
Oracle->Oracle other->Tools
Download zip file: p2617419_10102_GENERIC.zip
OCM support: No
MOPatch support: No

As of June 9, 2008, you can no longer use the OPatch version that is available in patch 2617419 on Oracle MetaLink to install patches (see Oracle MetaLink Note 602334.1). Therefore, continue to use the OPatch version that is available on SAP Service Marketplace for the patch installation for Oracle Release 9.2/10.1 in the SAP environment.

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.

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.

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 logs and documentation


OPatch logs are saved in the directory $ORACLE_HOME/cfgtoollogs/opatch (UNIX) or %ORACLE_HOME%\cfgtoollogs\opatch (Windows). In addition to these 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 saved in the directory $ORACLE_HOME/cfgtoollogs/opatch/lsinv.

The documentation for OPatch Release 10.2 is available in the Oracle online documentation 'Universal Installer and OPatch User's Guide for Windows and UNIX' and under $ORACLE_HOME/OPatch/docs.

Patch number <patchid>, bug number <bugid>, and patch directory <patch_dir>


Each Oracle bug has a bug number (bug ID) that uniquely identifies the bug.  In the same way, each Oracle patch also has a patch number (patch ID) that uniquely identifies the patch. When you display the Oracle inventory, the system displays the patch number for each patch that was installed and the numbers of the bugs that were corrected by the patch.

The patch directory of a patch <patch_dir> is the directory that contains the unpacked patch files for this patch. Up to OPatch Version 10.2.0.4, the absolute path for this directory must not contain any blank characters (Oracle Bug #5406580).

In most cases, the patch number corresponds to the bug number for individual patches, and the patch number corresponds to the number of the merge bug for merge patches.

The bug number always corresponds to the number in the file name of the packed patch, which means that the file p1234567_10202_SOLARIS64.zip contains the patch for bug 1234567 for Solaris 64-bit.  In addition, the patch number always corresponds to the name of the patch directory, which means that the patch directory is created with the name 7654321 when unpacking patch 7654321.

Using OPatch

The same operating system user that was used to install the Oracle software is also used when you install or uninstall patches using OPatch. For UNIX, this is the user ora<dbsid>; for Windows, this is the user <sapsid>adm.

OPatch requires that the environment variable ORACLE_HOME is set. As a result, you can call OPatch anytime as follows, without having to enhance the search path:

UNIX: $ORACLE_HOME/OPatch/opatch [command] [options]
Windows: %ORACLE_HOME%\OPatch\opatch [command] [options]

Important: When you install a patch, read the delivered README.txt of the patch to determine whether you have to carry out any additional steps (and, if this is the case, which steps you have to carry out) before or after you install the patch.

Before you install or uninstall patches, you must first stop all instances and processes that were started in ORACLE_HOME (Oracle instance(s), listener, Oracle CSS service ocssd.bin (see Note 839574), and so on).

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 (see MOPatch, Note 1027012).

Before you install a patch set, you are not required to manually uninstall patches.

When you install patches and patch sets, the status of the installed software is stored in the Oracle inventory. Both OPatch and the Oracle Universal Installer display the installed patches and patch sets from the Oracle inventory.

After you install or uninstall one or more patches, you should execute 'opatch lsinventory' to log the new patch status in an OPatch log.

Overview of OPatch commands

Displaying the OPatch version
% opatch version

Displaying the online help
% opatch -help

Displaying the online help for a certain command
% opatch <command> -help
<command> = apply, rollback, lsinventory, util

Displaying the Oracle inventory (see below)
% opatch lsinventory [-all][-detail]

Installing a patch (see below)
% opatch apply

Uninstalling a patch (see below)
% opatch rollback -id <patchid>

Special functions of OPatch (see below)
% opatch util

Cleanup of the patch storage directory
% opatch util cleanup
When you install patches using MOPatch, the patch storage directory is automatically cleaned up by default using this option at the end.

For OPatch, there are two general options that you can specify in addition using the command apply when you install a patch, and using the command rollback when you uninstall a patch: -verbose or -silent

You can use the option -silent to suppress the user query 'Is the local system ready for patching?', and the command is executed immediately. This command is used by MOPatch during the collective installation of patches. You should use the option -silent only if you are absolutely sure that the Oracle instance and all of the processes have been stopped.

You can specify the option -verbose for each OPatch command in addition. It is used to obtain more detailed information about the patch process.

Displaying the Oracle inventory

UNIX: $ORACLE_HOME/OPatch/opatch lsinventory
Windows: %ORACLE_HOME%\OPatch\opatch.bat lsinventory

When you use 'lsinventory', OPatch displays which patch sets and patches are installed in your system.

UNIX: $ORACLE_HOME/OPatch/opatch lsinventory -all
Windows: %ORACLE_HOME%\OPatch\opatch.bat lsinventory -all

When you use 'lsinventory -all', OPatch displays all of the Oracle Homes. This only provides significant information if several Oracle Homes are registered in a central inventory.

UNIX: $ORACLE_HOME/OPatch/opatch lsinventory -details
Windows: %ORACLE_HOME%\OPatch\opatch.bat lsinventory -details
When you use 'lsinventory -details', OPatch displays detailed information for each individual patch (modules, make objects, and so on).

UNIX: $ORACLE_HOME/OPatch/opatch lsinventory -group_by_date
Windows: %ORACLE_HOME%\OPatch\opatch.bat lsinventory -group_by_date
When you use '-group_by_date', OPatch displays which patches were installed and when (grouped by days).

Patch installation using OPatch on UNIX platforms

    1. For each Oracle patch set release, create a separate OPatch base directory <opatch_base_dir> .

              For example: for Release 10.2.0.2
UNIX: %mkdir /oracle/<DBSID>/opatch_base_dir_10202

For example: for Release 10.2.0.4
UNIX: %mkdir /oracle/<DBSID>/opatch_base_dir_10204

    2. Copy the patches that are to be installed to the base directory and unpack them there. In this case, an individual patch directory <patch_dir> is created for each patch under the base directory.

              Example for UNIX:
opatch_base_dir = /oracle/<DBSID>/opatch_base_dir_10202
% cp p1234567_10202_SOLARIS64.zip <opatch_base_dir>
% cd <opatch_base_dir>
% unzip p1234567_10202_SOLARIS64.zip

    3. Stop the instance and all of the Oracle processes of the relevant ORACLE_HOME.
    UNIX: % sqlplus / as sysoper
            SQL> shutdown immediate
             % lsnrctl stop
    4. We recommend that you create a backup of the ORACLE_HOME and the Oracle inventory BEFORE you install the patch.
    5. Install the patch by calling OPatch as follows:

              Option 1: Calling OPatch specifying the patch directory
UNIX: % $ORACLE_HOME/OPatch/opatch apply <patch_dir> [-verbose]

Option 2: Calling OPatch directly from the patch directory
UNIX: % cd <patch_dir>
        % $ORACLE_HOME/OPatch/opatch apply [-verbose]

    6. Optional: Cleanup of the patch storage directory




Patch installation using OPatch on Windows platforms

In general, installing a patch on Windows platforms works in the same way as installing a patch on UNIX platforms. The main difference is that, for reasons relating to the platform, you can install several individual patches and merge patches on UNIX, whereas you can install exactly one patch collection on Windows.

Before you start the installation, take account of the specifications in the patch README.

    1. For each Oracle release, create a separate OPatch base directory <opatch_base_dir> .

              For example: for Release 10.2.0.4
WINDOWS: C:\> mkdir opatch_base_dir_10204

    2. Copy the Windows patch collection that is to be installed to the base directory, and unpack the patch collection there in the directory <patch_dir>.
    3. 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>).
    WINDOWS: C:\> sqlplus / as sysoper
            SQL> shutdown immediate
             C:\> lsnrctl stop
    4. We recommend that you create a backup of the ORACLE_HOME and the Oracle inventory BEFORE you install the patch.
    5. Install the patch by calling OPatch as follows:

              Option 1: Calling OPatch specifying the patch directory
WINDOWS: C:\> %ORACLE_HOME%\OPatch\opatch.bat apply <patch_dir>
              [-verbose]

Option 2: Calling OPatch directly from the patch directory
WINDOWS: C:\> cd <patch_dir>
WINDOWS: C:\> %ORACLE_HOME%\OPatch\opatch.bat apply [-verbose]

    6. Then carry out the post-install steps that are prescribed in the patch README.
    7. Optional: Cleanup of the patch storage directory



Uninstalling a patch

To uninstall a patch, proceed as follows:

In the following, <opatch> on Windows platforms refers to %ORACLE_HOME%\OPatch\opatch.bat, and <opatch> on UNIX platforms refers to $ORACLE_HOME/OPatch/opatch.

    1. First, determine the patch IDs of the patches that are currently installed, and check whether the patch to be uninstalled is actually installed in the system.
    <opatch> lsinventory
    2. Take a note of the patch ID <patchid> of the patch you want to uninstall.
    3. Stop all of the Oracle instances, all of the Oracle processes, Oracle services, and so on, of the relevant ORACLE_HOME.
    4. We recommend that you create a backup of the ORACLE_HOME and the Oracle inventory BEFORE you uninstall the patch.
    5. To uninstall the relevant patch, execute the following command:
    <opatch> rollback -id <patchid>
    6. Check the result:
    <opatch> lsinventory
    7. If required, carry out the post-install steps in accordance with the relevant patch README or SAP Note.
    8. Optional: Cleanup of the patch storage directory



Installing a new OPatch version


An update of the OPatch software is required in the following cases:

  • In general, this is required for the correction of errors in OPatch.
  • This is required if the relevant patch README requests a certain version of OPatch for the installation of a patch, a Windows mini patch, or a CPU.
  • This is required after the installation of Oracle Release 10.2.0.4.


The relevant OPatch version for Oracle Release 10.2 (10.2.0.2 or 10.2.0.4) is available in the SAP Software Distribution Center (on SAP Service Marketplace) at:

http://service.sap.com/swdc
-> Download
---> Database Patches
-----> Oracle
-------> Oracle 10.2.0.4
---------> OPatch (only for Release 10.2.0.4)
-------> Oracle other
---------> OPatch 10.2 (only for Release 10.2.0.2)

Caution: For Oracle Release 10.2, do not use an old OPatch version from the directory 'Oracle other -> Tools'.

Installing OPatch 10.2.0.2.5 for Release 10.2.0.2

Use OPatch Version 10.2.0.2.X only for Oracle Release 10.2.0.2!

    1. Download OPatch 10.2.0.2.5 (p4898608_10202_GENERIC_v5.zip) from SAP Service Marketplace from the directory 'Oracle->Oracle other->OPatch 10.2', and copy this file to the ORACLE_HOME.

              UNIX: % cp p4898608_10202_GENERIC_v5.zip $ORACLE_HOME
Windows: C:\> copy p4898608_10202_GENERIC_v5.zip %ORACLE_HOME%

    2. Rename the previous OPatch directory.

              UNIX: % mv $ORACLE_HOME/OPatch $ORACLE_HOME/OPatch.SAVE
Windows: C:\> rename %ORACLE_HOME%\OPatch %ORACLE_HOME%\OPatch.SAVE

    3. Unpack the new version of OPatch.

              UNIX: % unzip -d $ORACLE_HOME p4898608_10202_GENERIC_v5.zip
Windows: C:\> %ORACLE_HOME%\bin\unzip -d %ORACLE_HOME%
p4898608_10202_GENERIC_v5.zip

    4. Test the new OPatch version, for example, by displaying the inventory.
    5. The installation is complete. The new OPatch version is ready for use.




Installing OPatch 10.2.0.4.3 for Release 10.2.0.4

Use OPatch Version 10.2.0.4.X only for Oracle Release 10.2.0.4!

    1. Download OPatch 10.2.0.4.3 (Opatch_10204_Generic_v3.zip) from SAP Service Marketplace from the directory 'Oracle->Oracle 10.2.0.4->OPatch', and copy this file to the ORACLE_HOME.

              UNIX: % cp Opatch_10204_Generic_v3.zip $ORACLE_HOME
Windows: C:\> copy Opatch_10204_Generic_v3.zip %ORACLE_HOME%

    2. Rename the previous OPatch directory.

              UNIX: % mv $ORACLE_HOME/OPatch \
              $ORACLE_HOME/OPatch.10204.ORIG
Windows: C:\> rename %ORACLE_HOME%\OPatch \
                    %ORACLE_HOME%\OPatch.10204.ORIG

    3. Unpack the new version of OPatch.

              UNIX: % unzip Opatch_10204_Generic_v3.zip -d $ORACLE_HOME
Windows: C:\> %ORACLE_HOME%\bin\unzip -d %ORACLE_HOME%
Opatch_10204_Generic_v3.zip

    4. Test the new OPatch version, for example, by displaying the inventory.
    5. The installation is complete. The new OPatch version is ready for use.
posted on 2008-11-03 15:14  diyang  阅读(2226)  评论(0编辑  收藏  举报