OPatch is an Oracle-supplied utility that assists you with the process of applying interim patches to Oracle's software and rolling back interim patches from Oracle's software. This chapter provides information on using OPatch for these purposes.This chapter includes the following topics:
OPatch is a platform-dependent utility that requires installation of the Oracle Universal Installer.
Patches are a small collection of files copied over to an existing installation. They are associated with particular versions of Oracle products. When applied to the correct version of an installed product, patches result in an upgraded version of the product.
Interim patches are bug fixes available to customers in response to specific bugs. They require a particular base release or patchset to be installed before you can apply them. They generally address specific bugs for a particular customer. These patches are not versioned and are generally available in a future patchset as well as the next product release.
The OPatch 11.2 utility has the following features:
Scalability — OPatch is scalable to support a large number of patches.
Reliability — OPatch is reliable and protects the Oracle home and inventory. It can bring back the Oracle home to a stable state from patch application failures. It can also easily detect patch conflicts.
Availability — Opatch's online patching improves system availability by enabling database patches to be applied without needing to shut down databases.
Portability — OPatch is compatible with all operating systems for which Oracle releases software.
Robust — OPatch is very robust. It is very easy to apply a patch as well as remove it.
Easy to maintain — OPatch is easy to maintain and is also extensible.
Support for Silent Operation — OPatch supports silent operation. This mode enables you to run the software without any user interaction.
Support for Oracle Real Application Clusters — OPatch supports Oracle Real Application Clusters and works well in that setup. It is easy to extend it to Enterprise Manager Grid Control.
Easy to debug — OPatch has various levels of logging and tracing mechanisms. It also has a debug option that helps to easily diagnose software problems.
OPatch supports the following tasks:
Applying an interim patch.
Rolling back the application of an interim patch.
Detecting a 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 patches.
Oracle releases interim patches frequently to fix a bug or a set of bugs. You can get the interim patches by doing the following:
Access and log into My Oracle Support at the following location:
http://support.oracle.com
Click the Patches & Updates link.
Enter the Patch or ID Number, then click Search. A Patch Search Results table appears.
Using the Release and Platform columns, find the desired patch, then click the associated Patch ID.
In the page that now appears, click the Download button in the right-hand column.
The OPatch utility requires the following environment:
The Oracle home environment variable (ORACLE_HOME
) must point to a valid Oracle home directory and match the value used during installation of the Oracle home directory.
JRE version 1.4 or higher, Java commands for Windows, and ar
, cp
, fuser
, and make
commands for UNIX must be made available.
The library path must be set correctly for Oracle Real Application Clusters environments. OPatch uses some APIs to detect if the system is an Oracle Real Application Clusters system. Ensure that the library path is set correctly as follows:
For Solaris: LD_LIBRARY_PATH = $ORACLE_HOME/lib32:$ORACLE_HOME/lib For HP-UX: SHLIB_PATH=$ORACLE_HOME/lib32:/usr/lib
See Also:
For the latest information about the OPatch utility, to check for updates, and to get the latest versions, go to OracleMetaLink at:http://www.oracle.com/support/metalink/index.html
You must have write permission to the files in the Oracle home before running the OPatch utility. Otherwise, OPatch fails.
Before you invoke OPatch, perform the prerequisite checks described in the following sections.
Check ORACLE_HOME and Environment Variable
OPatch verifies if the Oracle home is present. You must ensure that the ORACLE_HOME
environment variable is set to the Oracle home of the product you are trying to patch. Check the respective vendor documentation for details to set the environment variable.
OPatch requires JRE version 1.4 or higher to work properly.
When OPatch processes the script for the installation of a patch, it simultaneously generates a Rollback script and saves a copy of every file edited or deleted during the patching. OPatch also backs up the inventory information. Consequently, Oracle recommends that you have sufficient system space to accommodate the patch and the backup information.
Check for Oracle Universal Installer and OPatch Version Compatibility
OPatch 11.2 requires Oracle Universal Installer 11.2 or higher to work properly. If the Oracle Universal Installer version is less than what OPatch requires, OPatch errors out.
Check for Patch Applicable on Operating System
OPatch detects if a particular patch is applicable for an operating system. If it is not applicable, OPatch displays an error message.
OPatch supports a set of properties used for various software operations. You can use these properties to control the internal operations of OPatch. By default, OPatch uses the standard Java property format to specify the properties. The following list shows the default properties and their values:
fuser=/sbin:/usr/sbin ar=/usr/ccs/bin/ make=/usr/bin
You can specify OPatch properties in the following ways:
By using the default OPatch properties.
By specifying the location of the user-defined properties file.
By using the command line. The syntax is as follows:
PROPERTY_NAME=VALUE
Example: fuser=/sbin:/usr/sbin
For Oracle Real Application Clusters, ensure that you perform the following prerequisite checks besides the other checks listed in the preceding section.
You must ensure that the cluster machines have user equivalence set for the user installing Oracle Clusterware/ Oracle Real Application Clusters. On UNIX, this means rsh
or ssh
or both should be set up on the cluster machines. On Windows, this means the same <domain>\<user>
should have administrative privileges on all the cluster machines, and the machines should be a member of the <domain>
.
If the user equivalence is set properly, the following command will work properly:
$ rsh <nodename> date
Ensure that you are able to invoke the opatch lsinventory -detail
command and are able to see the node information being printed out. If you do not find the node information correctly printed out, you need to update the node list. For more information on updating the node list, see "Updating the Nodes of a Cluster".The following example shows the command output for the 134 installed products:
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 : /scratch/usernameusername/11.2db Central Inventory : /home/username/newDB/oraInventory from : /etc/oraInst.loc OPatch version : 11.1.0.6.6 OUI version : 11.2.0.1.0 OUI location : /scratch/username/11.2db/oui Log file location : /scratch/username/11.2db/cfgtoollogs/opatch/opatch2009-07-27_10-18-36AM.log Patch history file: /scratch/username/11.2db/cfgtoollogs/opatch/opatch_history.txt Lsinventory Output file location : /scratch/username/11.2db/cfgtoollogs/opatch/lsinv/lsinventory2009-07-27_10-18-36AM.txt -------------------------------------------------------------------------------- Installed Top-level Products (1): Oracle Database 11g 11.2.0.1.0 There are 1 products installed in this Oracle Home. Installed Products (134): Agent Required Support Files 10.2.0.4.2 Assistant Common Files 11.2.0.1.0 Bali Share 1.1.18.0.0 Buildtools Common Files 11.2.0.1.0 Character Set Migration Utility 11.2.0.1.0 Cluster Verification Utility Common Files 11.2.0.1.0 Database Configuration and Upgrade Assistants 11.2.0.1.0 Database SQL Scripts 11.2.0.1.0 Database Workspace Manager 11.2.0.1.0 Deinstallation Tool 11.2.0.1.0 Enterprise Edition Options 11.2.0.1.0 Enterprise Manager Agent 10.2.0.4.2 Enterprise Manager Agent Core Files 10.2.0.4.2 Enterprise Manager Common Core Files 10.2.0.4.2 Enterprise Manager Common Files 10.2.0.4.2 Enterprise Manager Database Plugin -- Agent Support 11.2.0.1.0 Enterprise Manager Database Plugin -- Repository Support 11.2.0.1.0 Enterprise Manager Grid Control Core Files 10.2.0.4.2 Enterprise Manager Minimal Integration 11.2.0.1.0 Enterprise Manager plugin Common Files 11.2.0.1.0 Enterprise Manager Repository Core Files 10.2.0.4.2 Exadata Storage Server 11.2.0.1.0 Expat libraries 2.0.1.0.1 Generic Connectivity Common Files 11.2.0.1.0 HAS Common Files 11.2.0.1.0 HAS Files for DB 11.2.0.1.0 Installation Common Files 11.2.0.1.0 Installation Plugin Files 11.2.0.1.0 Installer SDK Component 11.2.0.1.0 JAccelerator (COMPANION) 11.2.0.1.0 LDAP Required Support Files 11.2.0.1.0 OLAP SQL Scripts 11.2.0.1.0 Oracle 11g Warehouse Builder Required Files 11.2.0.1.0 Oracle Advanced Security 11.2.0.1.0 Oracle Application Express 11.2.0.1.0 Oracle Call Interface (OCI) 11.2.0.1.0 Oracle Clusterware RDBMS Files 11.2.0.1.0 Oracle Code Editor 1.2.1.0.0I Oracle Configuration Manager 10.3.1.1.0 Oracle Configuration Manager Deconfiguration 10.3.1.0.0 Oracle Containers for Java 11.2.0.1.0 Oracle Core Required Support Files 11.2.0.1.0 Oracle Data Mining RDBMS Files 11.2.0.1.0 Oracle Database 11g 11.2.0.1.0 Oracle Database 11g 11.2.0.1.0 Oracle Database 11g Multimedia Files 11.2.0.1.0 Oracle Database Deconfiguration 11.2.0.1.0 Oracle Database Gateway for ODBC 11.2.0.1.0 Oracle Database User Interface 2.2.13.0.0 Oracle Database Utilities 11.2.0.1.0 Oracle Database Vault J2EE Application 11.2.0.1.0 Oracle Database Vault option 11.2.0.1.0 Oracle DBCA Deconfiguration 11.2.0.1.0 Oracle Display Fonts 9.0.2.0.0 Oracle Enterprise Manager Console DB 11.2.0.1.0 Oracle Extended Windowing Toolkit 3.4.47.0.0 Oracle Globalization Support 11.2.0.1.0 Oracle Globalization Support 11.2.0.1.0 Oracle Help For Java 4.2.9.0.0 Oracle Help for the Web 2.0.14.0.0 Oracle Ice Browser 5.2.3.6.0 Oracle Internet Directory Client 11.2.0.1.0 Oracle Java Client 11.2.0.1.0 Oracle JDBC Server Support Package 11.2.0.1.0 Oracle JDBC/OCI Instant Client 11.2.0.1.0 Oracle JDBC/THIN Interfaces 11.2.0.1.0 Oracle JFC Extended Windowing Toolkit 4.2.36.0.0 Oracle JVM 11.2.0.1.0 Oracle Label Security 11.2.0.1.0 Oracle LDAP administration 11.2.0.1.0 Oracle Locale Builder 11.2.0.1.0 Oracle Message Gateway Common Files 11.2.0.1.0 Oracle Multimedia 11.2.0.1.0 Oracle Multimedia Annotator 11.2.0.1.0 Oracle Multimedia Client Option 11.2.0.1.0 Oracle Multimedia Java Advanced Imaging 11.2.0.1.0 Oracle Multimedia Locator 11.2.0.1.0 Oracle Multimedia Locator RDBMS Files 11.2.0.1.0 Oracle Net 11.2.0.1.0 Oracle Net Listener 11.2.0.1.0 Oracle Net Required Support Files 11.2.0.1.0 Oracle Net Services 11.2.0.1.0 Oracle Netca Client 11.2.0.1.0 Oracle Notification Service 11.2.0.0.0 Oracle Notification Service (eONS) 11.2.0.1.0 Oracle ODBC Driver 11.2.0.1.0 Oracle ODBC Driverfor Instant Client 11.2.0.1.0 Oracle OLAP 11.2.0.1.0 Oracle OLAP API 11.2.0.1.0
Oracle OLAP RDBMS Files 11.2.0.1.0 Oracle One-Off Patch Installer 11.2.0.0.2 Oracle Partitioning 11.2.0.1.0 Oracle Programmer 11.2.0.1.0 Oracle Quality of Service Management (Client) 11.2.0.1.0 Oracle RAC Deconfiguration 11.2.0.1.0 Oracle RAC Required Support Files-HAS 11.2.0.1.0 Oracle Real Application Testing 11.2.0.1.0 Oracle Recovery Manager 11.2.0.1.0 Oracle Security Developer Tools 11.2.0.1.0 Oracle Spatial 11.2.0.1.0 Oracle SQL Developer 11.2.0.1.0 Oracle Starter Database 11.2.0.1.0 Oracle Text 11.2.0.1.0 Oracle Text Required Support Files 11.2.0.1.0 Oracle UIX 2.2.24.5.0 Oracle Universal Connection Pool 11.2.0.1.0 Oracle Universal Installer 11.2.0.1.0 Oracle Wallet Manager 11.2.0.1.0 Oracle XML Development Kit 11.2.0.1.0 Oracle XML Query 11.2.0.1.0 Parser Generator Required Support Files 11.2.0.1.0 Perl Interpreter 5.10.0.0.1 Perl Modules 5.10.0.0.1 PL/SQL 11.2.0.1.0 PL/SQL Embedded Gateway 11.2.0.1.0 Platform Required Support Files 11.2.0.1.0 Precompiler Common Files 11.2.0.1.0 Precompiler Required Support Files 11.2.0.1.0 Provisioning Advisor Framework 10.2.0.4.2 RDBMS Required Support Files 11.2.0.1.0 RDBMS Required Support Files for Instant Client 11.2.0.1.0 regexp 2.1.9.0.0 Required Support Files 11.2.0.1.0 Sample Schema Data 11.2.0.1.0 Secure Socket Layer 11.2.0.1.0 SQL*Plus 11.2.0.1.0 SQL*Plus Files for Instant Client 11.2.0.1.0 SQL*Plus Required Support Files 11.2.0.1.0 SQLJ Runtime 11.2.0.1.0 SSL Required Support Files for InstantClient 11.2.0.1.0 Sun JDK 1.5.0.17.0 XDK Required Support Files 11.2.0.1.0 XML Parser for Java 11.2.0.1.0 XML Parser for Oracle JVM 11.2.0.1.0 There are 134 products installed in this Oracle Home. There are no Interim patches installed in this Oracle Home. -------------------------------------------------------------------------------- OPatch succeeded.
Note:
It is highly recommended that you back up theORACLE_HOME
before any patch operation. You can back up the ORACLE_HOME
using your preferred method. You can use any method such as zip, cp -r, tar,
and cpio
to compress the ORACLE_HOME.
If the ORACLE_HOME
does not appear when you execute the opatch lsinventory -detail
command, the ORACLE_HOME
might be missing from the Central Inventory, or the Central Inventory itself could be missing or corrupted.
If the ORACLE_HOME
is listed when you execute the opatch lsinventory -detail
command, but the products and components within the ORACLE_HOME
are not listed, the inventory within the ORACLE_HOME
(local inventory) might be missing or corrupted.
If the local inventory is corrupted or lost for some reason, you can simply restore the ORACLE_HOME/inventory
if it was backed up. If a backup does not exist, you may have to reinstall the software.
You can run the OPatch utility, located in the <Path_to_Oracle_Home>/OPatch
directory, with various commands and options. The following string shows the syntax for the OPatch utility:
<Path_to_OPatch>/opatch [-help] [-r[eport]] [command] [-option]
where:
help — Displays the help message for the command.
report — Prints the actions without executing.
command — One of the OPatch commands, described in Table 7-1.
option — One of the OPatch command options, described starting with Table 7-2.
Table 7-1 OPatch OUI-based Commands
Command | Description |
---|---|
apply |
Installs an interim patch. See "Apply Command for OUI-based Oracle Homes" for more information. |
napply |
Applies Oracle Clusterware patches. See the "Auto Command for OUI-based Oracle Homes" for more information. |
auto |
Applies Oracle Clusterware patches. See the "Auto Command for OUI-based Oracle Homes" for more information. |
lsinventory |
Lists what is currently installed on the system. See "Lsinventory Command for OUI-based Oracle Homes" for more information. |
query |
Queries a given patch for specific details. See "Query Command for OUI-based Oracle Homes" for more information. |
rollback |
Removes an interim patch. See "Rollback Command for OUI-based Oracle Homes" for more information. |
nrollback |
Removes n number of patches (hence nrollback). See "Nrollback Command for OUI-based Oracle Homes" for more information. |
version |
Prints the current version of the patch tool. See "Version Command for OUI-based Oracle Homes" for more information. |
To view additional information for any command, use the following command:
<Path_to_OPatch>/opatch command -help
If using Perl, use the following command:
perl opatch.pl command -help
To show the full syntax of the -help option, enter opatch -h to view the following display:
Usage: opatch [ -help ] [ -r[eport] ] [ command ] command := auto apply lsinventory napply nrollback rollback query version prereq util <global_arguments> := -help Displays the help message for the command. -report Print the actions without executing. example: 'opatch -help' 'opatch auto -help' 'opatch apply -help' 'opatch lsinventory -help' 'opatch napply -help' 'opatch nrollback -help' 'opatch rollback -help' 'opatch prereq -help' 'opatch util -help'
This command applies an interim patch to an Oracle home from the current directory. The ORACLE_HOME
environment variable must be set to the Oracle home to be patched.
Note:
You must have write permission to the files in the Oracle home before using this command. Otherwise, OPatch fails.Use the following syntax for this command:
opatch apply [-delay <value> ] [ -force ] [-invPtrLoc <Path to oraInst.loc> ] [-jre <LOC> ] [-local ] [-minimize_downtime ] [-no_bug_superset ] [-no_inventory ] [-oh <ORACLE_HOME> ] [-retry <value> ] [-silent ] [-verbose ] [-no_relink] [-pre <parameters for the pre script in escaped double quotes> [-opatch_pre_end] ] [-post <parameters for the post script in escaped quotes> [-opatch_post_end] ] [-no_sysmod] [-property_file <Path to property file>] [-local_node <Local node name>] [-remote_nodes <List of remote nodes (node1,node2)>] [-connectString <List of connect strings>] [-runSql] [-sqlScript <path of the sql file>] [-ptlSchema <portal schema>] [-ptlPassword <portal password>] [-ptlConnect <portal connect string>] [-init <parameters for the init script in escaped double quotes> [-opatch_init_end] ] [-report] [<Patch Location>]
Table 7-2 lists the options available for this command.
Table 7-2 Apply Options for OUI Patches
Option | Description |
---|---|
connectString |
Specifies the list of database instances on which the patch needs to be applied. Specify the value for this option using the following syntax:
Example:
The SID is required, but you can disregard the other parameters if desired, because OPatch provides default values for them. Note: If the system is not part of an Oracle RAC setup and you want to patch just the local node, provide the node name as an empty string. |
delay |
Specifies how many seconds to wait before attempting to lock the inventory again for a previous failure. You can use this option only if you specify the |
force |
Removes conflicting patches from the system. If a conflict exists that prevents the patch from being applied, you can use this option to apply the patch. OPatch removes all the conflicting patches before applying the current patch. |
init |
Passes parameters to the |
invPtrLoc |
Specifies the location of the |
jre |
Instructs OPatch to use JRE (Java) from the specified location instead of the default location under the Oracle home directory. |
local |
Specifies that OPatch should patch the local node and update the inventory of the local node. It does not propagate the patch or inventory update to other nodes. You can use this option on Oracle Real Application Clusters environments and non-clustered environments. If an entire cluster is shut down before patching, you can use this option for non-rolling patches. |
local_node |
Tells OPatch the local node for this cluster. You can use this option on Oracle Real Application Clusters environments. |
minimize_downtime |
Specifies the order of nodes that OPatch should patch. This option only applies to Oracle Real Application Clusters environments. You cannot use it with the |
no_bug_superset |
Specifies to error out if the current patch's bugs-to-fix is a superset (or same set) of an installed patch's bugs-fixed in the Oracle home directory. |
no_inventory |
Bypasses the inventory for reading and updates. You cannot use this option with the |
no_relink |
This option does not perform any |
no_sysmod |
Specifies that OPatch does not need to update the files in the system. It only updates the inventory. It also does not execute the pre and post scripts. |
oh |
Specifies the Oracle home directory to use instead of the default. This takes precedence over the environment variable |
opatch_init_end |
Marks the end of the init options. You use this option with the |
opatch_post_end |
Marks the end of the |
opatch_pre_end |
Marks the end of the |
Patch Location |
Indicates the path to the patch location. If you do not specify the location, OPatch assumes the current directory is the patch location. |
post |
Specifies the parameters to be passed to the |
pre |
Specifies the parameters to be passed to the |
property_file |
Specifies the user-defined property file for OPatch to use. The path to the property file should be absolute. This property file takes precedence over the one that OPatch supplies. |
ptlConnect |
Specifies the connection string credentials of the portal schema. |
ptlPassword |
Specifies the password of the portal schema. |
ptlSchema |
Specifies the schema of the portal repository. |
remote_nodes |
Tells OPatch the list of remote nodes. You can use this option on Oracle Real Application Clusters environments. The node names must be separated with commas, but without spaces. |
report |
Prints the action to the screen without executing it. |
retry |
Tells OPatch how many times it should retry when there is an inventory lock failure. |
runSql |
Tells OPatch to run the SQL script and SQL procedures if they exist in the given patch. For information on SQL and PL/SQL patching, see "Schema Patching". |
silent |
Suppresses user interaction, and defaults any answers to "yes." |
sqlScript |
Specifies the custom SQL script that OPatch should run after patching completes. For information on SQL and PL/SQL patching, see "Schema Patching". |
verbose |
Prints additional OPatch output to the screen as well as to the log file. |
Note:
If a patch consists of SQL changes, follow the instructions in the patch readme, which is included with the patch to apply the SQL scripts.This command applies interim patches to several Oracle homes at the same time.
Note:
You must have write permission to the files in the Oracle home before using this command. Otherwise, OPatch fails.Use the following syntax for this command:
opatch napply [patch_location] [-id comma-separated list of patch IDs] [-delay <value> ] [ -force ] [-invPtrLoc <Path to oraInst.loc> ] [-jdk <LOC> ] [-jre <LOC> ] [ -local ] [-minimize_downtime ] [-no_bug_superset ] [-no_inventory ] [-oh <ORACLE_HOME> ] [-retry <value> ] [-silent ] [-verbose ] [-no_relink] [-pre <parameters for the pre script in escaped double quotes> [-opatch_pre_end] ] [-post <parameters for the post script in escaped double quotes> [-opatch_post_end] ] [-no_sysmod] [ -property_file <Path to property file> ] [ -local_node <Local node name> ] [ -remote_nodes <List of remote nodes (node1,node2)> ] [ -all_nodes ] [ -phBaseFile <Path to the file containing the location of the patches to be applied> ] [-skip_subset] [-skip_duplicate] [-report]
The following example applies all patches under the <patch_location>
directory:
opatch napply <patch_location>
The following example applies patches 1, 2, and 3 that are under the <patch_location>
directory:
opatch napply <patch_location> -id 1,2,3
The following example applies all patches under the <patch_location>
directory. OPatch skips duplicate patches and subset patches (patches under <patch_location>
that are subsets of patches installed in the Oracle home).
opatch napply <patch_location> -skip_subset -skip_duplicate
See the description for the skip_subset
option in Table 7-3 for more information.
The following example applies patches 1, 2, and 3 that are under the <patch_location>
directory. OPatch skips duplicate patches and subset patches (patches under <patch_location>
that are subsets of patches installed in the Oracle home).
opatch napply <patch_location> -id 1,2,3 -skip_subset -skip_duplicate
See the description for the skip_subset
option in Table 7-3 for more information.
Table 7-3 lists the options available for this command.
Table 7-3 Napply Options for OUI Patches
Option | Description |
---|---|
all_nodes |
Applies the patch using the all-node mode. |
delay |
Specifies how many seconds to wait before attempting to lock the inventory again for a previous failure. You can use this option only if you specify the |
force |
Removes conflicting patches from the system. If a conflict exists that prevents the patch from being applied, you can use this option to apply the patch. OPatch removes all the conflicting patches before applying the current patch. |
invPtrLoc |
Specifies the location of the |
jdk |
Instructs OPatch to use JDK (jar) from the specified location instead of the default location under the Oracle home directory. If you do not specify the |
jre |
Instructs OPatch to use JRE (Java) from the specified location instead of the default location under the Oracle home directory. You cannot specify the |
local |
Specifies that OPatch should patch the local node and update the inventory of the local node. It does not propagate the patch or inventory update to other nodes. You can use this option on Oracle Real Application Clusters environments and non-clustered environments. If an entire cluster is shut down before patching, you can use this option for non-rolling patches. |
local_node |
Tells OPatch the local node for this cluster. You can use this option on Oracle Real Application Clusters environments. |
minimize_downtime |
Specifies the order of nodes that OPatch should patch. This option only applies to Oracle Real Application Clusters environments. You cannot use it with the |
no_bug_superset |
Specifies to error out if the current patch's bugs-to-fix is a superset (or same set) of an installed patch's bugs-fixed in the Oracle home directory. |
no_inventory |
Bypasses the inventory for reading and updates. You cannot use this option with the |
no_relink |
This option does not perform any |
no_sysmod |
Specifies that OPatch does not need to update the files in the system. It only updates the inventory. It also does not execute the pre and post scripts. |
oh |
Specifies the Oracle home directory to use instead of the default. This takes precedence over the environment variable |
opatch_post_end |
Marks the end of the |
opatch_pre_end |
Marks the end of the |
Patch Location |
Indicates the path to the patch location. If you do not specify the location, OPatch assumes the current directory is the patch location. |
phBaseFile |
If you do not specify |
post |
Specifies the parameters to be passed to the |
pre |
Specifies the parameters to be passed to the |
property_file |
Specifies the user-defined property file for OPatch to use. The path to the property file should be absolute. This property file takes precedence over the one that OPatch supplies. |
remote_nodes |
Tells OPatch the list of remote nodes. You can use this option on Oracle Real Application Clusters environments. The node names must be separated with commas, but without spaces. |
report |
Prints the action to the screen without executing it. |
retry |
Tells OPatch how many times it should retry when there is an inventory lock failure. |
silent |
Suppresses user interaction, and defaults any answers to "yes." |
skip_duplicate |
Skips patches to be applied that are duplicates of other patches installed in the Oracle home. Two patches are duplicates if they fix the same set of bugs. |
skip_subset |
Skips patches to be applied that are subsets of other patches installed in the Oracle home. One patch is a subset of another patch if the former fixes a subset of bugs fixed by the latter. For example, if you used |
verbose |
Prints additional OPatch output to the screen as well as to the log file. |
Ordinarily, an Oracle Clusterware patch requires several manual steps before and after you apply the patch, such as:
Stopping all dependent databases
Stopping Oracle Clusterware resources
Running pre-patch scripts
Shutting down Oracle Clusterware
Running post-patch scripts
Starting Oracle Clusterware and dependent databases
The opatch auto command automates all of these tasks for patching the grid infrastructure home and all other applicable RDBMS homes.
Note:
You must have write permission to the files in the Oracle home before using this command. Otherwise, OPatch fails.Use the following syntax for this command:
<path_to_Opatch>/opatch auto [-rollback [patch_location]] [[patch_location]-oh <path_to_oracle_home1>,<path_to_oracle_home2>...] | [[patch_location]-och <path_to_crs_home>]
... where patch_location is path to the location for the patch. If you do not specify the patch location, the current directory is considered the patch location.
Table 7–4 lists the options available for this command.
Table 7-4 Auto Options for OUI Patches
Option | Description |
---|---|
rollback |
Rolls back the patch rather than applying it. |
oh |
Comma-separated Oracle homes to patch. The default is all applicable Oracle homes. Use this option to patch RDBMS homes where no database is registered. |
och |
Path of the Oracle Clusterware home. Use this option to patch only Oracle Clusterware homes where Oracle Clusterware has been stopped already. Do not use this option for Oracle Clusterware with a CRS stack that is up. |
The following example applies a patch with an unzipped patch location to all applicable Oracle homes on the system:
opatch auto <patch_location>
The following example rolls back the patch from all the applicable Oracle homes on the system:
opatch auto -rollback <patch_location>
The following example patches a selective list of Oracle homes:
opatch auto <patch_location> -oh /tmp/oh1,/tmp/oh2,/tmp/oh3
The following example only patches the CRS home when the Oracle Clusterware stack is down.
opatch auto <patch_location> -och /tmp/ora_crs_home
This command lists the inventory for a particular Oracle home, or displays all installations that can be found. This command does not have any required options.
Note:
You must have write permission to the files in the Oracle home before using this command. Otherwise, OPatch fails.Use the following syntax for this command:
opatch lsinventory [-all ] [-all_nodes] [-bugs_fixed <asc | desc> ] [-delay <value> ] [-detail ] [-group_by_date ] [-inactive] [-invPtrLoc <Path to oraInst.loc> ] [-jre <LOC> ] [-local ] [-oh <ORACLE_HOME> ] [-patch <asc | desc> ] [-ptlPassword <portal password> ] [-ptlSchema <portal schema> ] [-property_file <path to property file>] [-retry <value> ] [-retry <value> ] [-translation_patch ]
The following sections provide examples for the detail, bugs_fixed, and patch desc options. See Table 7–5 for descriptions of the command options.
The following example shows the output of opatch lsinventory -detail
for 134 products and one interim patch:
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 : /scratch/username/11.2db Central Inventory : /home/username/newDB/oraInventory from : /etc/oraInst.loc OPatch version : 11.1.0.6.6 OUI version : 11.2.0.1.0 OUI location : /scratch/username/11.2db/oui Log file location : /scratch/username/11.2db/cfgtoollogs/opatch/opatch2009-07-27_10-28-06AM.log Patch history file: /scratch/username/11.2db/cfgtoollogs/opatch/opatch_history.txt Lsinventory Output file location : /scratch/username/11.2db/cfgtoollogs/opatch/lsinv/lsinventory2009-07-27_10-28-06AM.txt -------------------------------------------------------------------------------- Installed Top-level Products (1): Oracle Database 11g 11.2.0.1.0 There are 1 products installed in this Oracle Home. Installed Products (134): Agent Required Support Files 10.2.0.4.2 Assistant Common Files 11.2.0.1.0 Bali Share 1.1.18.0.0 Buildtools Common Files 11.2.0.1.0 Character Set Migration Utility 11.2.0.1.0 Cluster Verification Utility Common Files 11.2.0.1.0 Database Configuration and Upgrade Assistants 11.2.0.1.0 Database SQL Scripts 11.2.0.1.0 Database Workspace Manager 11.2.0.1.0 Deinstallation Tool 11.2.0.1.0 Enterprise Edition Options 11.2.0.1.0 Enterprise Manager Agent 10.2.0.4.2 Enterprise Manager Agent Core Files 10.2.0.4.2 Enterprise Manager Common Core Files 10.2.0.4.2 Enterprise Manager Common Files 10.2.0.4.2 Enterprise Manager Database Plugin -- Agent Support 11.2.0.1.0 Enterprise Manager Database Plugin -- Repository Support 11.2.0.1.0 Enterprise Manager Grid Control Core Files 10.2.0.4.2 Enterprise Manager Minimal Integration 11.2.0.1.0 Enterprise Manager plugin Common Files 11.2.0.1.0 Enterprise Manager Repository Core Files 10.2.0.4.2 Exadata Storage Server 11.2.0.1.0 Expat libraries 2.0.1.0.1 Generic Connectivity Common Files 11.2.0.1.0 HAS Common Files 11.2.0.1.0 HAS Files for DB 11.2.0.1.0 Installation Common Files 11.2.0.1.0 Installation Plugin Files 11.2.0.1.0 Installer SDK Component 11.2.0.1.0 JAccelerator (COMPANION) 11.2.0.1.0 LDAP Required Support Files 11.2.0.1.0 OLAP SQL Scripts 11.2.0.1.0 Oracle 11g Warehouse Builder Required Files 11.2.0.1.0 Oracle Advanced Security 11.2.0.1.0 Oracle Application Express 11.2.0.1.0 Oracle Call Interface (OCI) 11.2.0.1.0 Oracle Clusterware RDBMS Files 11.2.0.1.0 Oracle Code Editor 1.2.1.0.0I Oracle Configuration Manager 10.3.1.1.0 Oracle Configuration Manager Deconfiguration 10.3.1.0.0 Oracle Containers for Java 11.2.0.1.0 Oracle Core Required Support Files 11.2.0.1.0 Oracle Data Mining RDBMS Files 11.2.0.1.0 Oracle Database 11g 11.2.0.1.0 Oracle Database 11g 11.2.0.1.0 Oracle Database 11g Multimedia Files 11.2.0.1.0 Oracle Database Deconfiguration 11.2.0.1.0 Oracle Database Gateway for ODBC 11.2.0.1.0 Oracle Database User Interface 2.2.13.0.0 Oracle Database Utilities 11.2.0.1.0 Oracle Database Vault J2EE Application 11.2.0.1.0 Oracle Database Vault option 11.2.0.1.0 Oracle DBCA Deconfiguration 11.2.0.1.0 Oracle Display Fonts 9.0.2.0.0 Oracle Enterprise Manager Console DB 11.2.0.1.0 Oracle Extended Windowing Toolkit 3.4.47.0.0 Oracle Globalization Support 11.2.0.1.0 Oracle Globalization Support 11.2.0.1.0 Oracle Help For Java 4.2.9.0.0 Oracle Help for the Web 2.0.14.0.0 Oracle Ice Browser 5.2.3.6.0 Oracle Internet Directory Client 11.2.0.1.0 Oracle Java Client 11.2.0.1.0 Oracle JDBC Server Support Package 11.2.0.1.0 Oracle JDBC/OCI Instant Client 11.2.0.1.0 Oracle JDBC/THIN Interfaces 11.2.0.1.0 Oracle JFC Extended Windowing Toolkit 4.2.36.0.0 Oracle JVM 11.2.0.1.0
Oracle Label Security 11.2.0.1.0 Oracle LDAP administration 11.2.0.1.0 Oracle Locale Builder 11.2.0.1.0 Oracle Message Gateway Common Files 11.2.0.1.0 Oracle Multimedia 11.2.0.1.0 Oracle Multimedia Annotator 11.2.0.1.0 Oracle Multimedia Client Option 11.2.0.1.0 Oracle Multimedia Java Advanced Imaging 11.2.0.1.0 Oracle Multimedia Locator 11.2.0.1.0 Oracle Multimedia Locator RDBMS Files 11.2.0.1.0 Oracle Net 11.2.0.1.0 Oracle Net Listener 11.2.0.1.0 Oracle Net Required Support Files 11.2.0.1.0 Oracle Net Services 11.2.0.1.0 Oracle Netca Client 11.2.0.1.0 Oracle Notification Service 11.2.0.0.0 Oracle Notification Service (eONS) 11.2.0.1.0 Oracle ODBC Driver 11.2.0.1.0 Oracle ODBC Driverfor Instant Client 11.2.0.1.0 Oracle OLAP 11.2.0.1.0 Oracle OLAP API 11.2.0.1.0 Oracle OLAP RDBMS Files 11.2.0.1.0 Oracle One-Off Patch Installer 11.2.0.0.2 Oracle Partitioning 11.2.0.1.0 Oracle Programmer 11.2.0.1.0 Oracle Quality of Service Management (Client) 11.2.0.1.0 Oracle RAC Deconfiguration 11.2.0.1.0 Oracle RAC Required Support Files-HAS 11.2.0.1.0 Oracle Real Application Testing 11.2.0.1.0 Oracle Recovery Manager 11.2.0.1.0 Oracle Security Developer Tools 11.2.0.1.0 Oracle Spatial 11.2.0.1.0 Oracle SQL Developer 11.2.0.1.0 Oracle Starter Database 11.2.0.1.0 Oracle Text 11.2.0.1.0 Oracle Text Required Support Files 11.2.0.1.0 Oracle UIX 2.2.24.5.0 Oracle Universal Connection Pool 11.2.0.1.0 Oracle Universal Installer 11.2.0.1.0 Oracle Wallet Manager 11.2.0.1.0 Oracle XML Development Kit 11.2.0.1.0 Oracle XML Query 11.2.0.1.0
Parser Generator Required Support Files 11.2.0.1.0 Perl Interpreter 5.10.0.0.1 Perl Modules 5.10.0.0.1 PL/SQL 11.2.0.1.0 PL/SQL Embedded Gateway 11.2.0.1.0 Platform Required Support Files 11.2.0.1.0 Precompiler Common Files 11.2.0.1.0 Precompiler Required Support Files 11.2.0.1.0 Provisioning Advisor Framework 10.2.0.4.2 RDBMS Required Support Files 11.2.0.1.0 RDBMS Required Support Files for Instant Client 11.2.0.1.0 regexp 2.1.9.0.0 Required Support Files 11.2.0.1.0 Sample Schema Data 11.2.0.1.0 Secure Socket Layer 11.2.0.1.0 SQL*Plus 11.2.0.1.0 SQL*Plus Files for Instant Client 11.2.0.1.0 SQL*Plus Required Support Files 11.2.0.1.0 SQLJ Runtime 11.2.0.1.0 SSL Required Support Files for InstantClient 11.2.0.1.0 Sun JDK 1.5.0.17.0 XDK Required Support Files 11.2.0.1.0 XML Parser for Java 11.2.0.1.0 XML Parser for Oracle JVM 11.2.0.1.0 There are 134 products installed in this Oracle Home. Interim patches (1) : Patch 103 : applied on Mon Jul 27 10:25:16 PDT 2009 Created on 07 Nov 2007, 04:57:14 hrs US/Eastern Bugs fixed: 103, 104, 105 Files Touched: routeserver.ear --> ORACLE_HOME/md/jlib/routeserver.ear Patch Location in Inventory: /scratch/username/11.2db/inventory/oneoffs/103 Patch Location in Storage area: /scratch/username/11.2db/.patch_storage/103_Nov_07_2007_04_57_14 -------------------------------------------------------------------------------- OPatch succeeded.
The following example shows the output of opatch lsinventory -bugs_fixed asc
:
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 : /scratch/username/11.2db Central Inventory : /home/username/newDB/oraInventory from : /etc/oraInst.loc OPatch version : 11.1.0.6.6 OUI version : 11.2.0.1.0 OUI location : /scratch/username/11.2db/oui Log file location : /scratch/username/11.2db/cfgtoollogs/opatch/opatch2009-07-27_10-25-33AM.log Patch history file: /scratch/username/11.2db/cfgtoollogs/opatch/opatch_history.txt Lsinventory Output file location : /scratch/username/11.2db/cfgtoollogs/opatch/lsinv/lsinventory2009-07-27_10-25-33AM.txt ---------------------------------------------------------------------------------- Installed Top-level Products (1): Oracle Database 11g 11.2.0.1.0 There are 1 products installed in this Oracle Home. List of Bugs fixed by Installed Patches: Bug Fixed by Installed at Description Patch --- -------- ------------ ----------- 103 103 Mon Jul 27 10:25:16 PDT 2009 Try to Patch an ear 104 103 Mon Jul 27 10:25:16 PDT 2009 Dummy1 105 103 Mon Jul 27 10:25:16 PDT 2009 Dummy2 OPatch succeeded.
The following example shows the output of opatch lsinventory -patch desc
:
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 : /scratch/username/11.2db Central Inventory : /home/username/newDB/oraInventory from : /etc/oraInst.loc OPatch version : 11.1.0.6.6 OUI version : 11.2.0.1.0 OUI location : /scratch/username/11.2db/oui Log file location : /scratch/username/11.2db/cfgtoollogs/opatch/opatch2009-07-27_10-39-03AM.log Patch history file: /scratch/username/11.2db/cfgtoollogs/opatch/opatch_history.txt Lsinventory Output file location : /scratch/username/11.2db/cfgtoollogs/opatch/lsinv/lsinventory2009-07-27_10-39-03AM.txt -------------------------------------------------------------------------------- Interim patches (2) : Patch 101 : applied on Mon Jul 27 10:38:00 PDT 2009 Created on 07 Nov 2007, 04:57:14 hrs US/Eastern Bugs fixed: 101 This patch overlays patches: 103 Patch 103 : applied on Mon Jul 27 10:25:16 PDT 2009 Created on 07 Nov 2007, 04:57:14 hrs US/Eastern Bugs fixed: 103, 104, 105 -------------------------------------------------------------------------------- OPatch succeeded.
Table 7–5 describes the options available for the lsinventory command.
Table 7-5 Lsinventory Options for OUI Patches
Option | Description |
---|---|
all |
Reports the name and installation directory for each Oracle home directory found. |
all_nodes |
Reports the patches installed on the given Oracle home in all nodes of the Oracle RAC system. It also prints the Oracle binary's size and checksum on all nodes. You cannot use this option with the |
bugs_fixed |
Reports bugs fixed by installed patches in a tabular format. Besides the bugs fixed, the report also displays the installed patches, installed times, and bug descriptions. The fixed bugs are sorted per installed patch. Default display is patches in descending order based on installed time and ascending order of bugs within each patch. You can use 'asc' (or) 'desc' with this option to enforce sort order on bugs within each patch. You can use this option with the patch or patch option to obtain sort orders with installed patches. |
delay |
If you specify retry, this option tells OPatch how many seconds it should wait before attempting to lock the inventory again in case of a previous failure. |
detail |
Reports the installed products and other details. You cannot use this option with the |
group_by_date |
Specifies that OPatch should group all installed patches by the date they were installed in the Oracle home. |
inactive |
Lists all the inactive patches that have been superseded by other superset patch(es) installed in the Oracle home. |
invPtrLoc |
Specifies the location of the |
jre |
Specifies the location of a particular JRE (Java) to use instead of the default location under the Oracle home directory. |
local |
Instructs OPatch to only display inventory information for the local node. |
oh |
Specifies the Oracle home directory to use instead of the default directory. This takes precedence over the ORACLE_HOME environment variable. |
patch |
Lists the patch IDs installed in the Oracle home in ascending (asc) or descending (desc) order, which is the default, based on installed time. |
ptlPassword |
Enables you to specify the password of the portal schema. |
ptlSchema |
Enables you to specify the schema of the portal repository. |
property_file |
Indicates the user-defined property file that OPatch should use. The path to the property should be absolute. This property file takes precedence over the property file that OPatch supplies. |
retry |
Specifies how many times OPatch should retry when there is an inventory lock failure. |
translation_patch |
Displays the translation patch, language code, installed time of the translation patch, and base patch for any single row in the table. |
This command queries a specific patch for specific details. It provides information about the patch and the system being patched.
Note:
You must have write permission to the files in the Oracle home before using this command. Otherwise, OPatch fails.Use the following syntax for this command:
opatch query [-all] [-is_auto_patch] [-is_translatable_patch] [-get_base_bugs] [-get_component] [-get_os] [-get_date] [-get_patch_language] [-get_patch_type] [-get_patch_model] [-get_product_family] [-get_update_components] [-has_sql] [-is_online_patch] [-is_patchset_update] [-is_portal_patch] [-is_rolling_patch]
Table 7-6 lists the options available for the Query command.
Option | Description |
---|---|
all |
Retrieves all information about a patch. This is equivalent to setting all available options. |
get_base_bugs |
Retrieves bugs fixed by the patch. |
get_component |
Retrieves components the patch affects. |
get_date |
Retrieves the patch creation date and time. |
get_patch_language |
Gets the language that the patch supports. |
get_patch_model |
Gets the patching model. |
get_patch_type |
Gets the patch type specified in the patch metadata. |
get_product_family |
Gets the product family specified in the patch metadata to which the patch belongs. |
get_update_components |
Gets all components to be upgraded in a patchset update. |
has_sql |
Indicates true if the patch has SQL-related actions. Otherwise, the option is false. For information on SQL and PL/SQL patching, see "Schema Patching". |
is_auto_patch |
Indicates true if the patch is auto-enabled. Otherwise, the option is false. |
is_online_patch |
Indicates true if the patch is an online patch. Otherwise, the option is false. |
is_patchset_update |
Indicates true if the patch is a patchset upate. Otherwise, the option is false. |
is_portal_patch |
Indicates true if the patch has portal actions. Otherwise, the option is false. |
is_rolling_patch |
Indicates true if the patch is a rolling patch. Otherwise, the option is false. |
is_translatable_patch |
Indicates true if the patch is translatable. Otherwise, the option is false. |
oh |
Specifies the Oracle home directory to use instead of the default directory. This takes precedence over the |
Patch Location |
Indicates the path to the patch location. If you do not specify the location, OPatch assumes the current directory is the patch location. |
This command removes an existing one-off patch from the appropriate Oracle home directory indicated by the reference ID.
Note:
You must have write permission to the files in the Oracle home before using this command. Otherwise, OPatch fails.Use the following syntax for this command:
opatch rollback -id <ID> [-ph <Patch Location>] [-delay <value>] [-invPtrLoc <Path to oraInst.loc> ] [-jre <LOC> ] [-local] [-oh <ORACLE_HOME>] [-retry <value>] [-silent] [-verbose] [-no_relink] [-pre <parameters for the pre script in escaped double quotes> [-opatch_pre_end] ] [-post <parameters for the post script in escaped double quotes>[ -opatch_post_end] ] [-no_sysmod] [-property_file <path to property file>] [-local_node <Local node name>] [-remote_nodes <List of remote nodes (node1,node2)>] [-connectString <List of connect strings>] [-ptlSchema <portal schema>] [-ptlPassword <portal password>] [-ptlConnect <portal connect string>] [-runSql] [-sqlScript <path of the sql file>] [-init <parameters for the init script in escaped double quotes> [-opatch_init_end] ] [-report]
Table 7-7 lists the options available for the Rollback command.
Table 7-7 Rollback Options for OUI Patches
Option | Description |
---|---|
all_nodes |
Rolls back the patch using the all-nodes mode. |
connectString |
Specifies the list of database instances on which the patch needs to be applied. Specify the value for this option using the following syntax:
Example:
The SID is required, but you can disregard the other parameters if desired, because OPatch provides default values for them. Note: If the system is not part of an Oracle RAC setup and you want to patch just the local node, provide the node name as an empty string. |
delay |
If you use the |
id |
Indicates the patch to be rolled back. Use the |
init |
Passes parameters to the init script, which executes before prerequisite checks are run. The values for this option must be enclosed in double-quotes. |
invPtrLoc |
Specifies the location of the |
jre |
Specifies the location of a particular JRE (Java) for OPatch to use instead of the default location under the Oracle home directory. |
local |
Specifies that OPatch roll back the local node, then update the inventory of the local node. It does not propagate the patch or inventory update to other nodes. You can use this option on Oracle Real Application Clusters environments and non-clustered environments. If an entire cluster is shut down before patching, you can use this option for non-rolling patches. |
local_node |
Specifies to OPatch that this is the local node for the cluster to be used for rollback. You can use this option for Oracle Real Application Clusters environments. |
no_sysmod |
Specifies that OPatch need not update the files in the system, only the inventory. It also does not execute the pre and post scripts. |
no_relink |
This option does not perform any |
oh |
Specifies the Oracle home directory to use instead of the default directory. This takes precedence over the |
opatch_init_end |
Marks the end of the |
opatch_post_end |
Marks the end of the |
opatch_pre_end |
Marks the end of the |
Patch Location |
Indicates the path to the patch location. If you do not specify the location, OPatch assumes the current directory is the patch location. |
ph |
Specifies the valid patch directory area. Rollback uses the command types found in the patch directory to identify which commands are used for the current operating system. |
post |
Specifies the parameters to be passed inside the |
pre |
Specifies the parameters to be passed inside the |
property_file |
Specifies the user-defined property file for OPatch to use. The path to the property file should be absolute. This property file takes precedence over the one that OPatch supplies. |
ptlConnect |
Specifies the connection string credentials of the portal schema. |
ptlSchema |
Specifies the schema of the portal repository. |
ptlPassword |
Specifies the password of the portal schema. |
remote_nodes |
Specifies to OPatch the list of remote nodes to be used for rollback of the patch. The node names must be separated with commas, but without spaces. You can use this option on Oracle Real Application Clusters environments. |
report |
Prints the actions to the screen without executing them. |
retry |
Instructs OPatch how many times it should retry when there is an inventory lock failure. |
runSql |
Instructs OPatch to run the SQL script and SQL procedures if they exist in the given patch. For information on SQL and PL/SQL patching, see "Schema Patching". |
sqlScript |
Specifies the custom SQL script that OPatch should run after patching completes. For information on SQL and PL/SQL patching, see "Schema Patching". |
silent |
Suppresses user interaction, and defaults any yes|no questions to "yes". An Oracle Real Application Clusters setup does not support this option. |
verbose |
Prints additional OPatch output to the screen as well as to the log file. |
This command rolls back interim patches from several Oracle homes at the same time.
Note:
You must have write permission to the files in the Oracle home before using this command. Otherwise, OPatch fails.Use the following syntax for this command:
opatch nrollback -id <comma-separated list of patch IDs> [-delay <value>] [-invPtrLoc <Path to oraInst.loc> ] [-jdk <LOC> ] [-jre <LOC> ] [-local] [-minimize_downtime] [-no_relink] [-oh <ORACLE_HOME> ] [-retry <value>] [-silent] [-verbose] [-pre <parameters for the pre script in escaped double quotes> [-opatch_pre_end] ] [-post <parameters for the post script in escaped double quotes>[ -opatch_post_end] ] [-no_sysmod] [-property_file <Path to property file>] [-local_node <Local node name>] [-remote_nodes <List of remote nodes (node1,node2)>] [ -all_nodes ] [-report]
The following example rolls back patches 1, 2, and 3 that have been installed in the Oracle home:
opatch nrollback -id 1,2,3
Table 7-8 lists the options available for this command.
Table 7-8 Nrollback Options for OUI Patches
Option | Description |
---|---|
all_nodes |
Rolls back the patch using the all-nodes mode. |
delay |
If you use the |
id |
Indicates the patch to be rolled back. Use the |
invPtrLoc |
Specifies the location of the |
jdk |
Instructs OPatch to use JDK (jar) from the specified location instead of the default location under the Oracle home directory. If you do not specify the |
jre |
Specifies the location of a particular JRE (Java) for OPatch to use instead of the default location under the Oracle home directory. |
local |
Specifies that OPatch roll back the local node, then update the inventory of the local node. It does not propagate the patch or inventory update to other nodes. You can use this option on Oracle Real Application Clusters environments and non-clustered environments. If an entire cluster is shut down before patching, you can use this option for non-rolling patches. |
local_node |
Specifies to OPatch that this is the local node for the cluster to be used for rollback. You can use this option for Oracle Real Application Clusters environments. |
minimize_downtime |
Specifies the order of nodes that OPatch should patch. This option only applies to Oracle Real Application Clusters environments. You cannot use it with the |
no_sysmod |
Specifies that OPatch need not update the files in the system, only the inventory. It also does not execute the pre and post scripts. |
no_relink |
This option does not perform any |
oh |
Specifies the Oracle home directory to use instead of the default directory. This takes precedence over the |
opatch_post_end |
Marks the end of the |
opatch_pre_end |
Marks the end of the |
Patch Location |
Indicates the path to the patch location. If you do not specify the location, OPatch assumes the current directory is the patch location. |
property_file |
Specifies the user-defined property file for OPatch to use. The path to the property file should be absolute. This property file takes precedence over the one that OPatch supplies. |
remote_nodes |
Specifies to OPatch the list of remote nodes to be used for rollback of the patch. The node names must be separated with commas, but without spaces. You can use this option on Oracle Real Application Clusters environments. |
report |
Prints the actions to the screen without executing them. |
retry |
Instructs OPatch how many times it should retry when there is an inventory lock failure. |
silent |
Suppresses user interaction, and defaults any yes|no questions to "yes". A Real Application Clusters setup does not support this option. |
verbose |
Prints additional OPatch output to the screen as well as to the log file. |
Standalone patching is available for Oracle homes that have not been installed using the Oracle Universal Installer. Standalone patching does not have Central Inventory registration, but still generates inventory files for the one-off inventory and future conflict checking. OPatch uses the presence of the OUI directory under ORACLE_HOME
to determine whether it should operate in OUI-based or standalone mode.
The following sections discuss these standalone patching topics:
Unsupported services for standalone patching
Standalone patching requirements
OPatch commands for standalone patching
Use cases
Standalone patching provides most of the services that OUI-based patching provides. However, standalone patching does not provide the following services that OUI-based patching provides.
Looking up the component inventory
Standalone OPatch enables you to look up which patches have been applied to a standalone Oracle home, but it does not support looking up product components. For example, if you run opatch lsinventory
on a JDeveloper Oracle Home, OPatch shows a list of patches applied on the home. It does not show which components the home has, however.
Looking up the Central Inventory
You cannot run opatch lsinventory –all
to list all Oracle homes registered on the host (through the Central Inventory repository).
Migrating from standalone to OUI-based patching and vice versa
The assumption is that after you have installed a product as standalone without OUI, it remains standalone. For example, after having installed JDeveloper, you cannot put OUI (through copying or proper installation) onto the Oracle home and expect OPatch to treat the home as an OUI-based Oracle home.
Conversely, the assumption is that after you have installed a product with OUI, it remains OUI-based. For example, after you install Oracle RDBMS, you cannot remove OUI (either by removing or proper deinstallation) and expect OPatch to treat the home as a standalone Oracle home. OPatch will not work properly in this case and will corrupt the home.
Interoperating between standalone and OUI-based patches
Since you cannot migrate a home from standalone to OUI-based and vice versa, OPatch does not support interoperability between standalone and OUI-based Oracle homes.
Seamlessly working on a cloned standalone Oracle home
If you clone a standalone Oracle home S1 to another Oracle home OH2, Opatch will not function properly on the new cloned OH2.
OPatch relies on OUI to detect Oracle RAC and propagate files. Hence, standalone OPatch does not support RAC; it does not attempt to detect RAC, and its utility will not work. That is, OPatch always runs as opatch apply –local
. OPatch does not support any patch propagation from one node to another node. Also, standalone OPatch does not support RAC-related utilities such as opatch util runRemoteMake
(invokes relink on remote node).
Performing patch set operations
OPatch does not support patch set operations in either standalone or OUI modes. You need to use OUI for patch set operations.
Standalone patching requires the following environment:
JRE version 1.4 or later
Oracle home without OUI
OPatch that supports standalone patching
All of the required files and directories must exist for OPatch to function correctly. If any of the files are missing, OPatch perceives that the patch has not been applied. You would then have to take corrective action, returning the standalone inventory to a stable state.
As with OUI-based patching, you can run the OPatch utility, located in the <Path_to_Oracle_Home>/OPatch
directory, with various commands and options. The following string shows the syntax for the OPatch utility:
<Path_to_OPatch>/opatch [-help] [-r[eport]] [command] [-option]
where:
help — Displays the help message for the command.
report — Prints the actions without executing.
command — One of the OPatch commands.
option — One of the OPatch command options.
Table 7-9 lists the commands available for standalone patching.
Table 7-9 OPatch Standalone Commands
Command | Description |
---|---|
apply |
Installs an interim patch. See "Apply Command for Standalone OPatch" for more information. |
lsinventory |
Lists what is currently installed on the system. See "Lsinventory Command for Standalone OPatch" for more information. |
query |
Queries a given patch for specific details. See "Query Command for Standalone OPatch" for more information. |
rollback |
Removes an interim patch. See "Rollback Command for Standalone OPatch" for more information. |
version |
Prints the current version of the patch tool. See "Version Command for Standalone OPatch" for more information. |
The following sections provide the syntax and options for each of these commands.
The Apply command applies an interim patch to a standalone home from the current directory.
Use the following syntax for this command:
opatch apply [ -force ] [-jre <LOC> ] [-no_bug_superset ] [-no_inventory ] [-oh <ORACLE_HOME> ][-silent ][-verbose ] [-no_relink] [-pre <parameters for the pre script in escaped double quotes> [-opatch_pre_end] ] [-post <parameters for the post script in escaped quotes> [-opatch_post_end] ] [-no_sysmod] [-property_file <Path to property file>] [-init <parameters for the init script in escaped double quotes> [-opatch_init_end] ] [-report] [<Patch Location>]
Table 7-10 lists the options available for the Apply command.
Table 7-10 Apply Options for Standalone Patches
Option | Description |
---|---|
force |
Removes conflicting patches from the system by enabling you to change the product and version number of the standalone Oracle home. OPatch removes all the conflicting patches before applying the current patch. |
init |
Passes parameters to the |
jre |
Instructs OPatch to use JRE (Java) from the specified location instead of the default location under the Oracle home directory. |
no_bug_superset |
Specifies to error out if the current patch's bugs-to-fix is a superset (or same set) of an installed patch's bugs-fixed in the Oracle home directory. |
no_inventory |
Bypasses the inventory for reading and updates. You cannot use this option with the |
no_relink |
This option does not perform any |
no_sysmod |
Specifies that OPatch does not need to update the files in the system. It only updates the inventory. It also does not execute the pre and post scripts. |
oh |
Specifies the Oracle home directory to use instead of the default. This takes precedence over the environment variable |
opatch_init_end |
Marks the end of the init options. You use this option with the |
opatch_post_end |
Marks the end of the |
opatch_pre_end |
Marks the end of the |
Patch Location |
Indicates the path to the patch location. If you do not specify the location, OPatch assumes the current directory is the patch location. |
post |
Specifies the parameters to be passed to the |
pre |
Specifies the parameters to be passed to the |
property_file |
Specifies the user-defined property file for OPatch to use. The path to the property file should be absolute. This property file takes precedence over the one that OPatch supplies. |
silent |
Suppresses user interaction, and defaults any answers to "yes." |
verbose |
Prints additional OPatch output to the screen as well as to the log file. |
The Lsinventory command lists the inventory for a particular Oracle home, or displays all installations that can be found. This command does not have any required options.
Use the following syntax for this command:
opatch lsinventory [-all ] [-detail ] [-jre <LOC> ] [-oh <ORACLE_HOME> ] [-patch] [-oh] [-property_file <path to property file>]
Table 7-12 lists the options available for the Lsinventory command.
Table 7-11 Lsinventory Options for Standalone Patches
Option | Description |
---|---|
all |
Reports the name and installation directory for each Oracle home directory found. |
detail |
Reports the installed products and other details. You cannot use this option with the |
jre |
Specifies the location of a particular JRE (Java) for OPatch to use instead of the default location under the Oracle home directory. |
oh |
Specifies the Oracle home directory to use instead of the default directory. This takes precedence over the |
patch |
Specifies the patches installed in the Oracle home. |
property_file |
Indicates the user-defined property file that OPatch should use. The path to the property should be absolute. This property file takes precedence over the property file that OPatch supplies. |
This command queries a specific patch for specific details. It provides information about the patch and the system being patched.
Use the following syntax for this command:
opatch query [-all] [-jre <LOC> ] [-oh <LOC> ] [-get_component] [-get_os] [-get_date] [-get_base_bug] [-is_portal_patch] [-is_rolling_patch] [-is_online_patch] [-has_sql] [ <Patch Location> ]
Table 7-12 lists the options available for the Query command.
Option | Description |
---|---|
all |
Retrieves all information about a patch. This is equivalent to setting all available options. |
get_base_bug |
Retrieves bugs fixed by the patch. |
get_component |
Retrieves components the patch affects. |
get_date |
Retrieves the patch creation date and time. |
has_sql |
Indicates true if the patch has SQL-related actions. Otherwise, the option is false. For information on SQL and PL/SQL patching, see "Schema Patching". |
is_online_patch |
Indicates true if the patch is an online patch. Otherwise, the option is false. |
is_portal_patch |
Indicates true if the patch has portal actions. Otherwise, the option is false. |
is_rolling_patch |
Indicates true if the patch is a rolling patch. Otherwise, the option is false. |
oh |
Specifies the Oracle home directory to use instead of the default directory. This takes precedence over the |
Patch Location |
Indicates the path to the patch location. If you do not specify the location, OPatch assumes the current directory is the patch location. |
The Rollback command removes an existing one-off patch from the appropriate Oracle home directory indicated by the reference ID.
Use the following syntax for this command:
opatch rollback -id <ID> [-ph <Patch Location>] [-jre <LOC> ] [-oh <ORACLE_HOME>] [-silent] [-verbose] [-no_relink] [-pre <parameters for the pre script in escaped double quotes> [-opatch_pre_end] ] [-post <parameters for the post script in escaped double quotes>[ -opatch_post_end] ] [-no_sysmod] [-property_file <path to property file>] [-init <parameters for the init script in escaped double quotes> [-opatch_init_end] ] [-report]
Table 7-13 lists the options available for the Rollback command.
Table 7-13 Rollback Options for Standalone Patches
Option | Description |
---|---|
id |
Indicates the patch to be rolled back. Use the |
init |
Passes parameters to the init script, which executes before prerequisite checks are run. The values for this option must be enclosed in double-quotes. |
jre |
Specifies the location of a particular JRE (Java) for OPatch to use instead of the default location under the Oracle home directory. |
no_sysmod |
Specifies that OPatch need not update the files in the system, only the inventory. It also does not execute the pre and post scripts. |
no_relink |
This option does not perform any |
oh |
Specifies the Oracle home directory to use instead of the default directory. This takes precedence over the |
opatch_init_end |
Marks the end of the |
opatch_post_end |
Marks the end of the |
opatch_pre_end |
Marks the end of the |
Patch Location |
Indicates the path to the patch location. If you do not specify the location, OPatch assumes the current directory is the patch location. |
ph |
Specifies the valid patch directory area. Rollback uses the command types found in the patch directory to identify which commands are used for the current operating system. |
post |
Specifies the parameters to be passed inside the |
pre |
Specifies the parameters to be passed inside the |
property_file |
Specifies the user-defined property file for OPatch to use. The path to the property file should be absolute. This property file takes precedence over the one that OPatch supplies. |
report |
Prints the actions to the screen without executing them. |
silent |
Suppresses user interaction, and defaults any yes|no questions to "yes". An Oracle Real Application Clusters setup does not support this option. |
verbose |
Prints additional OPatch output to the screen as well as to the log file. |
The following sections provide scenarios that administrators can encounter when implementing standalone patching for the following types of operations:
Inventory
Patching
Utility
The following tables explain the purpose of the use case along with preconditions and the process that occurs during the patching process.
Table 7-14 Getting Patch Information
Use Case Category | Description |
---|---|
Purpose |
Show a list of interim patches installed on a standalone Oracle home. |
Preconditions |
|
User Input |
Enter the following command:
|
OPatch Response |
|
Table 7-15 Getting Detailed Patch Information
Use Case Category | Description |
---|---|
Purpose |
Show a detailed list of interim patches installed on a standalone Oracle home. |
Preconditions |
|
User Input |
Enter the following command:
|
OPatch Response |
|
The following tables explain the purpose of the use case along with preconditions and the process that occurs during the patching process.
Table 7-16 Applying an Interim Patch - Case 1
Use Case Category | Description |
---|---|
Purpose |
Apply an interim patch on a standalone Oracle home. |
Preconditions |
|
User Input |
Enter the following command:
|
OPatch Response |
|
Table 7-17 Applying an Interim Patch - Case 2
Use Case Category | Description |
---|---|
Purpose |
Apply an interim patch on a standalone Oracle home that exists within another OUI-based Oracle home. |
Preconditions |
The standalone Oracle home has a different directory patch than the OUI-based Oracle home. For example, the OUI-based Oracle home path is |
User Input |
Enter the following command:
|
OPatch Response |
|
Table 7-18 Applying an Interim Patch - Case 3
Use Case Category | Description |
---|---|
Purpose |
Apply an interim patch on a standalone Oracle. It seems to be a standalone Oracle home, but OPatch detects it as OUI-based. |
Preconditions |
|
User Input |
Enter the following command:
|
OPatch Response |
|
Table 7-19 Rolling Back an Applied Interim Patch
Use Case Category | Description |
---|---|
Purpose |
Roll back an interim patch applied earlier on a standalone Oracle home. |
Preconditions |
|
User Input |
Enter the following command:
|
OPatch Response |
|
The following tables explain the purpose of the use case along with preconditions and the process that occurs during the patching process.
Table 7-20 Loading an Arbitrary XML File
Use Case Category | Description |
---|---|
Purpose |
Load an XML file, making sure it is XML-parsable. |
Preconditions |
|
User Input |
Enter the following command:
Note that the loadXML utility is often used as a debugging and troubleshooting tool. |
OPatch Response |
|
Table 7-21 Verifying that the Patch is Applied
Use Case Category | Description |
---|---|
Purpose |
Ensure that the patch was applied to the Oracle home. |
Preconditions |
|
User Input |
Enter the following command:
Note that patch verification is automatically invoked when OPatch applies a patch to an Oracle home. You do not need to rerun |
OPatch Response |
|
There are two types of schema patches:
SQL patch — This patches the Oracle database with updated procedures and schema changes.
PL/SQL patch — This also patches the Oracle database with updated procedures and schema changes, as for the SQL patch. However, a PL/SQL patch also mentions the procedure names in its patch metadata so that these procedures can be backed up for rollback.
The following sections discuss these topics:
Schema patching options
Standalone SQL execution
Table 7-22 shows the schema patching options that OPatch supports for Apply and Rollback:
Table 7-22 Schema Patching Options
Option | Description |
---|---|
-runSql |
Instructs OPatch to read the SQL script from the patch and run it on the specified SIDs. You must specify this option for the |
-sqlScript |
Specifies OPatch to run this custom SQL script. This is an optional parameter. |
-connectString |
Provides a list of database instance SIDs, user, and password to be patched. Each entry is separated by a comma ( , ). The value for this option has the following format:
|
OPatch provides a utility to run only the SQL scripts to patch specified database instances. Use this utility only when you cannot apply or roll back SQL procedure actions using normal Apply or Rollback sessions.
The syntax for Apply is as follows:
opatch util applySql –id <patchIDs> -connectString <SID1:USER1:PASSWORD1:NODE1>
The syntax for Rollback is as follows:
opatch util rollbackSql –ph <patchLocation> (or) –phBaseFile <filename> (or) –phBaseDir <dirname> -connectString <SID1:USER1:PASSWORD1:NODE1>
Regular patches typically contain .o
(object) files and/or .a
(archive) libraries, and therefore require a relink of the RDBMS binary. Online patches, however, contain .so
files, which are dynamic/shared libraries, and do not require a relink of the RDBMS binary. Consequently, since a relink is not needed, you can apply or roll back online patches while the RDBMS instance is running. This simplifies administration, because no downtime is needed, and also results in a much quicker turnaround time for installing or de-installing Online Patches.
A regular RDBMS patch can require many minutes to install, since it requires instance shutdown, a relink, and instance startup. On the other hand, you can install an online patch in just a few seconds.
Online patches are only applicable for Oracle RDBMS and not any other products. Online patches are currently supported on the following Windows and UNIX platforms for version 11.2.0.1.0 and later:
Linux x86
Linux x86_64
HP-UX Itanium
Solaris SPARC 64-bit
Solaris AMD 64-bit
AIX (AIX 6.1 and later)
An Oracle Real Application Clusters environment enables active instances to concurrently execute transactions on a shared database. Patching in an Oracle Real Application Clusters environment is slightly different compared to patching a single node.
Interim Patching using OPatch follows a similar approach as that performed by Oracle Universal Installer to detect Oracle home and nodes of a cluster. OPatch interacts with the Oracle Universal Installer inventory through the Oracle Universal Installer Java SDK. If OPatch detects a cluster, it queries the inventory through Oracle Universal Installer to find the local node name and node list. If your node list is not updated, you can update it by using the -updateNodeList
flag of Oracle Universal Installer. You can bypass remote actions using the -local
flag, as shown below:
$ORACLE_HOME/oui/bin/<runInstaller or setup.exe> -updateNodeList ORACLE_ HOME=<oracle home location> "CLUSTER_NODES={node1,node2,node3}" -noClusterEnabled -local
If you want to specify the local node or remote nodes of an Oracle Real Application Clusters setup to OPatch, you can use the LOCAL_NODE
or REMOTE_NODES
session variable and specify the node name(s), as shown below:
$ORACLE_HOME/oui/bin/<runInstaller or setup.exe> ORACLE_HOME=<oracle home location> "REMOTE_NODES={node1,node2,node3}" LOCAL_NODE=<nodelist for example:node1>
If OPatch does not automatically detect Oracle Real Application Clusters or its nodes, you need to investigate the contents of the inventory and ensure that it is complete.
You can patch Oracle Real Application Clusters in three different ways:
The following sections provide detailed information for these types of Oracle Real Application Clusters patching.
Figure 7–1 shows a basic example of All Node Patching.
Systems A, B, and C are nodes in this cluster. When you perform All Node Patching in this cluster, you bring down systems A, B, and C, apply patches to all these nodes, then bring systems A, B, and C back up again.
In Rolling Patching, you shut down each node, apply the patch, then bring up each node again. You do this separately for each node until you patch all nodes in the cluster. This is the most efficient method of applying an interim patch to an Oracle Real Application Clusters setup, because there is absolutely no downtime during the application of patches, as only one system is brought down at any given time. Only some patches can be applied in this mode. The type is generally specified in the patch metadata.
Figure 7–2 shows a basic example of Rolling Patching.
When you perform Rolling Patching in this cluster, the patches are applied in a rolling fashion. You initially bring down system A, apply a patch to it, then bring it back up. You do the same thing for systems B and C.
In Minimum Downtime Patching, the nodes are divided into sets. Initially, you shut down the first set and apply a patch to it. After this, you shut down the second set. You then bring up the first set and apply a patch to the second set. You now bring up the second set. All the nodes in the cluster are now patched. This method leads to less downtime for Oracle Real Application Clusters when both sets are brought down. This mode is executed by using -minimize_downtime
command line option. You can also activate this option from the response file.
Figure 7–3 shows a basic example of Minimum Downtime Patching.
Systems A, B, and C are nodes in this cluster. It is divided into two sets: Set 1 contains systems A and B, and Set 2 contains system C. When you perform Minimum Downtime Patching in this cluster, you shut down Set 1 and apply a patch to it. You now shut down Set 2. Then, you bring up Set 1 and apply a patch to Set 2. After you apply the patch, you bring up Set 2 again. Now both Sets 1 and 2 are patched.
All patches may not be compatible with one another. For example, if you apply a patch, all the bugs the patch fixes could reappear after you apply another patch. This is called a conflict situation. OPatch detects such situations and raises an error when it detects a conflict.
OPatch can detect the following types of conflicts.
If all the bugs fixed by a patch in the system are also fixed by the patch to be applied, this patch (the patch to be applied) is considered a superset of the patch already applied. If a bug superset condition is detected, it is not considered an error situation. All the subset patches are removed from the system and the new patch is applied.
Example
Consider the following scenario:
Patch A, installed in the Oracle home, fixed bugs 1, 2, and 3.
Patch B, installed in the Oracle home, fixed bugs 10, 11, and 12.
Patch C, to be installed, fixes bugs 1, 2, 3, and 4.
Patch C is considered a superset of Patch A.
Using the -no_bug_superset Flag
If you want OPatch to error out if the current patch bugs-to-fix is a superset or the same as an installed patch bugs-fixed in the Oracle home directory, you can use the -no_bug_superset
flag:
$ OPatch/opatch apply -no_bug_superset <Path_To_Patch>
The following example output shows the message you would see when you use the -no_bug_superset
flag:
Oracle interim Patch Installer version 11.2.0.0.1 Copyright (c) 2009, Oracle Corporation. All rights reserved. Oracle Home : /home/oracle_TEST/product/11.1.0/db_1 Central Inventory : /home/OUIHome_Opatch from : /home/oracle_TEST/product/11.2.0/db_1/oraInst.loc OPatch version : 11.1.0.6.6 OUI version : 11.1.0.6.6 OUI location : /home/oracle_TEST/product/11.1.0/db_1/oui Log file location : /home/oracle_TEST/product/11.1.0/db _1/cfgtoollogs/opatch/opatch-2008_May_25_14-03-33-IST_Wed.log ApplySession applying interim patch '111000' to OH '/home/oracle _TEST/product/11.1.0/db_1' Apply Session failed: ApplySession failed to prepare the system. Interim patch 111000 is a superset of the patch(es) [ 111000 ] in OH /home/oracle _TEST/product/11.1.0/db_1 System intact, OPatch will not attempt to restore the system OPatch failed with error code 73
Patches to be applied can be subsets of other patches installed in the Oracle home.
Example
Consider the following scenario:
Patch A, installed in the Oracle home, fixed bugs 1, 2, and 3.
Patch B, installed in the Oracle home, fixed bugs 10, 11, and 12.
Patch D, to be installed, fixes bugs 1 and 2.
Patch D is a subset of Patch A.
Using the skip_subset Option
When you want to skip patches formerly applied in the Oracle home that are now subsets of other patches you want to apply now, you can use the skip_subset
option of napply
. For example, if you used napply
yesterday for patch A that fixed bugs 1 and 2, then you use napply
today with the skip_subset
option for patch B that fixes bug 1 and patch C that fixes bugs 1, 2, and 3, then subset patch A is skipped, and patch C then becomes a superset of patch A.
Example 7-1 applies all patches under the <patch_location>
directory. OPatch skips duplicate patches and subset patches (patches under <patch_location>
that are subsets of patches installed in the Oracle home).
Example 7-2 applies patches 1, 2, and 3 that are under the <patch_location>
directory. OPatch skips duplicate patches and subset patches (patches under <patch_location>
that are subsets of patches installed in the Oracle home).
See the description for the skip_subset
option in Table 7-3 for more information.
A duplicate patch fixes the same set of bugs fixed by another patch. For example, if you applied Patch A that fixed bugs 1, 2 and 3, and now apply Patch B that also fixes bugs 1, 2 and 3, then Patch B is a duplicate of Patch A. A patch is always a duplicate of itself.
Using the skip_duplicate Option
If you specify this option, OPatch removes duplicate patches from the list of patches to be applied. For example, if you used napply
yesterday for Patch A discussed above, then use napply
today with the -skip_duplicate
option for Patch A and other patches, duplicate Patch A is skipped.
A bug conflict occurs if a set of bugs to be fixed by the current interim patch intersects with some bugs already fixed by one or more previously installed interim patches. You must remove the bug conflict before you proceed with the patching by using the apply
command with the -force
flag, which rolls back the conflicting patches before applying the new one.
Example
Consider the following scenario:
Patch A, installed in the Oracle home, fixed bugs 1, 2, and 3.
Patch B, installed in the Oracle home, fixed bugs 10, 11, and 12.
Patch E, to be installed, fixes bugs 3 and 4.
Patch E conflicts with Patch A.
A file conflict occurs if a set of files to be patched by the current interim patch includes files already patched by one or more previously installed interim patches, and it is not a bug superset.
Example
Consider the following scenario:
Patch A, installed in the Oracle home, fixed bugs 1, 2, and 3, which modified files a, b, and c.
Patch F, to be installed, fixes bugs 1, 2, 3 and 4, and modifies files a, d, and f.
Patch F conflicts with Patch A.
The expected behavior for the Apply and Napply commands is listed in Table 7-23.
Table 7-23 Expected Behavior for Apply and Napply Commands
Command | Superset | Subset | Duplicate | File Conflict or Bug Conflict Patch |
---|---|---|---|---|
Apply |
OPatch performs an automatic rollback, then an apply. |
After the merge request, OPatch performs an automatic rollback, then performs an apply. |
OPatch performs an automatic rollback, then performs a reapply. |
OPatch reports the conflict. After the merge request, OPatch performs an automatic rollback, then an apply. |
Napply |
OPatch performs an automatic rollback, then an apply. |
OPatch reports the subset and skips the subset patch. It then continues and applies the other patches. |
OPatch performs an automatic rollback, then a reapply. |
OPatch reports the conflict, then asks you to run again without applying a bug conflict patch. You can use the -force option to instruct OPatch to automatically roll back the conflicting patch, then apply the new patch. |
OPatch detects and reports any conflicts encountered when applying an Interim patch with a previously applied patch. The patch application fails in case of conflicts. You can use the -force
option of OPatch to override this failure. If you use this option, the installer first rolls back any conflicting patches and then proceeds with the installation of the desired interim patch.
You may encounter a bug conflict and might want to remove the conflicting patch. This process is known as patch rollback. During patch installation, OPatch saves copies of all the files the new patch replaced before the new versions of these files are loaded and stores them in $ORACLE_HOME/.patch_storage
. These saved files are called Rollback files and are the key to making patch rollback possible. When you roll back a patch, these Rollback files are restored to the system. You should only override the default behavior by using the -force
flag if you completely understand the patch Rollback process. To roll back a patch, execute the following command:
$ OPatch/opatch rollback -id <Patch_ID>
The following sections provide information and instructions on the following tasks to resolve problems:
Using logs and traces
Recovering from a failed patching session
Resolving OPatch application errors
Logging and tracing is a common aid for debugging. OPatch maintains logs for all Apply, Rollback, and Lsinventory operations. Each time you execute OPatch, a new log file is created. The log files are located in the <ORACLE_HOME>/cfgtoollogs/opatch
directory. Each log file is tagged with the timestamp of the operation. Log files are named as opatch_<date mm-dd-yyyy>_<time hh-mm-ss>.log
.
For example, if a log file is created on May 17th, 2008 at 11.55 PM, it will be named as follows:
opatch_05-17-2008_23-55-00.log
Note:
You can set OPatch to debug mode by setting the environment variableOPATCH_DEBUG
to TRUE
.OPatch also maintains an index of the commands executed with OPatch and the log files associated with it in the history.txt
file located in the <ORACLE_HOME>/cfgtoollogs/opatch
directory. An example of the history.txt
file is as follows:
Date & Time : Tue Apr 26 23:00:55 PDT 2009 Oracle Home : /private/oracle/product/11.2.0/db_1/ OPatch Ver. : 11.2.0.0.0 Current Dir : /scratch/oui/OPatch Command : lsinventory Log File : /private/oracle/product/11.2.0/db_1/cfgtoollogs/opatch/opatch-2009_Apr_26_23-00-55-PDT_Tue.log
OPatch follows the Oracle Diagnostic Logging (ODL) guidelines. You can set the log level by using the -logLevel <level>
option available. This controls the amount of logging OPatch performs, according to the ODL guidelines.
OPatch supports the following log levels:
SEVERE
WARNING
INFO
CONFIG
FINE
FINER
FINEST
During patching, updates can occur in two phases:
System Update — In this phase, the files are replaced in the Oracle home.
Inventory Update — In this phase, the details of the patch applied is recorded in the inventory.
The following scenarios for single instance setups and Oracle Real Application Clusters setups explain how you can recover from a failed patching session.
Ensure that the environment variable ORACLE_HOME
is set properly.
Navigate to the $ORACLE_HOME/.patch_storage/<patch-id_timestamp>
directory and execute the Restore command.
For UNIX: $ORACLE_HOME/.patch_storage/<patch-id_timestamp>/restore.sh For Windows: $ORACLE_HOME/.patch_storage/<patch-id_timestamp>/restore.bat
On UNIX, source $ORACLE_HOME/.patch_storage/<patch-id_timestamp>/make.txt
file (if available) as follows:
/bin/sh make.txt
Ensure that the environment variable ORACLE_HOME
is set properly.
Navigate to the $ORACLE_HOME/.patch_storage/<patch-id_timestamp>
directory and execute the Restore command.
For UNIX: $ORACLE_HOME/.patch_storage/<patch-id_timestamp>/restore.sh For Windows: $ORACLE_HOME/.patch_storage/<patch-id_timestamp>/restore.bat
On UNIX, source $ORACLE_HOME/.patch_storage/<patch-id_timestamp>/make.txt
file (if available) as follows:
/bin/sh make.txt
Navigate to the $ORACLE_HOME/.patch_storage/<patch-id_timestamp>
directory and execute the Restore command:
For UNIX: $ORACLE_HOME/.patch_storage/<patch-id_timestamp>/restore.sh For Windows: $ORACLE_HOME/.patch_storage/<patch-id_timestamp>/restore.bat
On UNIX, source $ORACLE_HOME/.patch_storage/<patch-id_timestamp>/make.txt
file (if available) as follows:
/bin/sh make.txt
If the files are properly patched, but the information is not updated in the inventory, execute the following command:
$ORACLE_HOME/OPatch/opatch apply -no_sysmod <Path_To_Patch>
Ensure that the patch has been applied and recorded properly in the inventory by executing the following command:
$ORACLE_HOME/OPatch/opatch lsinventory -detail
If the files are still not patched properly, but you are able to see the patch in the lsinventory
flag, you need to reapply the patch using the no_inventory
flag:
$ORACLE_HOME/OPatch/opatch apply -no_inventory <Path_To_Patch>
Navigate to the $ORACLE_HOME/.patch_storage/<patch-id_timestamp>
directory and execute the Restore command:
For UNIX: $ORACLE_HOME/.patch_storage/<patch-id_timestamp>/restore.sh For Windows: $ORACLE_HOME/.patch_storage/<patch-id_timestamp>/restore.bat
On UNIX, source $ORACLE_HOME/.patch_storage/<patch-id_timestamp>/make.txt
file (if available) as follows:
/bin/sh make.txt
If the files are properly patched, but the information is not updated in the inventory, execute the following command:
$ORACLE_HOME/OPatch/opatch apply -no_sysmod <Path_To_Patch>
Ensure that the patch has been applied and recorded properly in the inventory by executing the following command:
$ORACLE_HOME/OPatch/opatch lsinventory -detail
Ensure that the environment variable ORACLE_HOME
is set properly.
Navigate to the $ORACLE_HOME/.patch_storage/<patch-id_timestamp>
directory and execute the Restore command if it is available.
For UNIX: $ORACLE_HOME/.patch_storage/<patch-id_timestamp>/restore.sh For Windows: $ORACLE_HOME/.patch_storage/<patch-id_timestamp>/restore.bat
On UNIX, source $ORACLE_HOME/.patch_storage/<patch-id_timestamp>/make.txt
file (if available) as follows:
/bin/sh make.txt
Ensure that the environment variable ORACLE_HOME
is set properly.
Navigate to the $ORACLE_HOME/.patch_storage/<patch-id_timestamp>
directory and execute the Restore command.
For UNIX: $ORACLE_HOME/.patch_storage/<patch-id_timestamp>/restore.sh For Windows: $ORACLE_HOME/.patch_storage/<patch-id_timestamp>/restore.bat
Resolve the relink failure issue by ensuring that you are able to invoke make
manually on a UNIX shell. After this, apply the patch again.
Ensure that the environment variable ORACLE_HOME
is set properly in all the nodes of the cluster.
Navigate to the $ORACLE_HOME/.patch_storage/<patch-id_timestamp>
directory of each node in the cluster and execute the Restore command as follows:
For UNIX: $ORACLE_HOME/.patch_storage/<patch-id_timestamp>/restore.sh For Windows: $ORACLE_HOME/.patch_storage/<patch-id_timestamp>/restore.bat
On UNIX, source $ORACLE_HOME/.patch_storage/<patch-id_timestamp>/make.txt
file (if available) in each node of the cluster as follows:
/bin/sh make.txt
Apply the patch in each node in the cluster using the local flag:
$ORACLE_HOME/OPatch/opatch apply -local <Path_To_Patch>
Note:
Ensure that all the nodes use the same OPatch version.Ensure that the environment variable ORACLE_HOME
is set properly in each node in the cluster.
Navigate to the $ORACLE_HOME/.patch_storage/<patch-id_timestamp>
directory and execute the Restore command in each node in the cluster.
For UNIX: $ORACLE_HOME/.patch_storage/<patch-id_timestamp>/restore.sh For Windows: $ORACLE_HOME/.patch_storage/<patch-id_timestamp>/restore.bat
On UNIX, source $ORACLE_HOME/.patch_storage/<patch-id_timestamp>/make.txt
file (if available) in each node as follows:
/bin/sh make.txt
Apply the patch in each node using the local flag:
$ORACLE_HOME/OPatch/opatch apply -local <Path_To_Patch>
Note:
Ensure that all the nodes use the same OPatch version.Ensure that the environment variable ORACLE_HOME
is set properly in each node in the cluster.
Navigate to the $ORACLE_HOME/.patch_storage/<patch-id_timestamp>
directory in each node in the cluster and execute the restore command as follows:
For UNIX: $ORACLE_HOME/.patch_storage/<patch-id_timestamp>/restore.sh For Windows: $ORACLE_HOME/.patch_storage/<patch-id_timestamp>/restore.bat
On UNIX, source $ORACLE_HOME/.patch_storage/<patch-id_timestamp>/make.txt
file (if available) in each node in the cluster as follows:
/bin/sh make.txt
Roll back the patch in all the nodes in the cluster using the local flag:
$ORACLE_HOME/OPatch/opatch rollback -local -id <Patch_ID>
Note:
Ensure that all the nodes use the same OPatch version.Ensure that the environment variable ORACLE_HOME
is set properly in each node in the cluster.
Navigate to the $ORACLE_HOME/.patch_storage/<patch-id_timestamp>
directory and execute the Restore command in each node in the cluster:
For UNIX: $ORACLE_HOME/.patch_storage/<patch-id_timestamp>/restore.sh For Windows: $ORACLE_HOME/.patch_storage/<patch-id_timestamp>/restore.bat
On UNIX, source $ORACLE_HOME/.patch_storage/<patch-id_timestamp>/make.txt
file (if available) as follows:
/bin/sh make.txt
Roll back the patch in the local node using the local
flag:
$ORACLE_HOME/OPatch/opatch rollback -local -id <Patch_ID>
Roll back the patch on the other nodes also using the local
flag.
Note:
Ensure that all the nodes use the same OPatch version.Copy the Oracle home from the node that is fine to the other nodes.
After copying the Oracle home, make sure that the ORACLE_HOME/inventory/ContentsXML/comps.xml
file has the latest timestamp.
Note:
On Unix, usetouch
to change the timestamp.Update the nodes of the cluster. For more information on updating the nodes of the cluster, see "Updating the Nodes of a Cluster".
Ensure that all the prerequisite checks pass that are listed in the section "Prerequisite Checks for OPatch".
Copy the ORACLE_HOME /inventory
directory from the node that is fine to the other nodes.
After copying the ORACLE_HOME /inventory
directory, make sure that the ORACLE_HOME/inventory/ContentsXML/comps.xml
file has the latest timestamp.
Note:
On Unix, usetouch
to change the timestamp.Update the nodes of the cluster. For more information on updating the nodes of the cluster, see "Updating the Nodes of a Cluster".
Ensure that all the prerequisite checks pass that are listed in the section "Prerequisite Checks for OPatch".
Ensure that all the nodes in the cluster are up-to-date. If they are not, update the nodes of the cluster. For more information on updating the nodes of the cluster, see "Updating the Nodes of a Cluster".
Execute the appropriate command on all nodes of the cluster as follows:
opatch apply -local [patch_location] opatch rollback -local [patch_location]
Execute the appropriate command on the local node of the cluster as follows:
opatch apply [-local_node (node_name)] [-remote_nodes (comma separated node_names)] opatch rollback [-local_node (node_name)] [-remote_nodes (comma separated node_names)]
This section provides solutions to the following errors that may occur during patch application:
Not a valid patch area
Opatch cannot find system commands like fuser
, make
Unable to remove a partially-installed interim patch
/etc
directory that has the metadata files.
/files
directory that has the payload files.
/etc/config/inventory
file and the actions file under the same directory.
If you did not start the OPatch utility from the patch_id
directory, you can use the following command:
opatch apply /<Patch_Shiphome>
fuser
, make
fuser
on UNIX systems to check for active Oracle instances. On certain hp-ux systems, only a super-user can run fuser
.Set /tmp
in your PATH.
For more information, see "Checks for Single Instances and Oracle Real Application Clusters".
Create an empty file named fuser
.
Shut down the Oracle instances.
Run the OPatch utility.
Caution:
Another way to resolve this problem is to give executable permission to other users forfuser
. However, this exposes a potential security issue in the system, and is not recommended.Ensure that the environment variable ORACLE_HOME
is set properly.
Navigate to the $ORACLE_HOME/.patch_storage/<patch-id_timestamp>
directory and execute the Restore command as follows:
For UNIX: $ORACLE_HOME/.patch_storage/<patch-id_timestamp>/restore.sh For Windows: $ORACLE_HOME/.patch_storage/<patch-id_timestamp>/restore.bat
On UNIX, source $ORACLE_HOME/.patch_storage/<patch-id_timestamp>/make.txt
file (if available) as follows:
/bin/sh make.txt