1 Patching Your Environment Using OPatch

The OPatch utility provides several commands that you can use to apply and roll back patches to Oracle software in your Oracle Fusion Middleware environment.

For more information about using OPatch commands in an Oracle Fusion Middleware environment, see the following topics:

About OPatch

OPatch is a Java-based utility that runs on all supported operating systems and requires installation of the Oracle Universal Installer. It is used to apply patches to Oracle software.

The following topics provide more information about OPatch for Oracle Fusion Middleware:

Type of Patches Used with OPatch

Oracle provides several types of patches that you can use to patch your Oracle software with OPatch.

Note:

Oracle has recently implemented a new patch nomenclature for Oracle products. The new patch names, as well as the previous Oracle Fusion Middleware 11g names, are provided for reference.

Table 1-1 Patches that can be used with OPatch

New Name Previously Used Name(s) Description

Interim patch

PSE

MLR

Exception release

One-Off

x-fix

Hotfix

Security One-Off

A patch that contains one or more fixes made available to customers who cannot wait until the next patch set or new product release to get a fix.

Bundle patch

Maintenance pack

Service pack

MLRs

Cumulative patch

Update release

Bundle patch

An iterative, cumulative patch that is issued between patch sets. Bundle patches usually include only fixes, but some products may include minor enhancements. Examples are the Database Windows bundles and SOA bundle patches.

Security Patch Update (SPU)

Critical Patch Updates (CPUs)

An iterative, cumulative patch that consists of security fixes. Formerly known as CPU.

Note: The program name which delivers SPUs will still be referred to as Critical Patch Update, as defined below:

Critical Patch Update: Oracle's program for quarterly release of security fixes. Patches released as part of this program may be Patch Set Updates, Security Patch Updates, and Bundle Patches. Regardless of the patch type, the patches are cumulative.

Patch Set Updates (PSU)

Patch Set Updates are used to patch Oracle WebLogic Server only. Patch Set Updates are released on a quarterly basis, following the same schedule as the CPUs. These CPUs are released on a Tuesday closest to the 15th of the month, during the months of January, April, July, and October. Patch Set Update content is intended to address the top fifty critical bugs that affects the broad customer base.

Information for Oracle WebLogic Server Smart Update Users

Smart Update is a standalone Java application through which you upgrade the software installations quickly and easily with maintenance patches and maintenance packs. For Oracle Fusion Middleware 12c, Smart Update is no longer supported.

In the previous releases of Oracle WebLogic Server, you could patch your Oracle WebLogic Server software by using a utility called Smart Update. In Oracle Fusion Middleware 12c, Oracle WebLogic Server users can use OPatch to apply patches for both Oracle WebLogic Server and for Oracle Fusion Middleware.

OPatch offers few similar features as Smart Update, but it has a different set of commands and command options. Use this guide to get familiar with OPatch.

Preparing to Use OPatch

To ensure successful patching, complete these prerequisites to prepare your environment to run OPatch, such as obtaining the latest version of OPatch, obtaining required patches from My Oracle Support, and backing up the Oracle home.

For more information on preparing your environment, see the following topics:

Locating and Obtaining the Latest Version of OPatch

Before you run OPatch, find the OPatch utility in the Oracle home, and verify that you have the latest version.

Locating and Running OPatch in the Oracle Fusion Middleware Oracle Home

You can find and run the OPatch utility in the ORACLE_HOME/OPatch directory after you install any Oracle Fusion Middleware product.

To run OPatch, run the opatch command in this directory.

For example, to view the list of commands available for OPatch on a Unix system, enter the following:

./opatch -help

On Windows systems, run the following command:

opatch.bat -help
Identifying the Version of OPatch Included with Oracle Fusion Middleware 12c

Oracle Fusion Middleware 12c (12.2.1.4.0) includes OPatch version 13.9.4.2.1. This version includes new features and capabilities that are designed to improve the experience of patching an Oracle Fusion Middleware 12c Oracle Home.

Note:

To get post-release information about OPatch, including newer versions supported with 12.2.1.4, see the MyOracle Support document 1587524.1.
In general, there is a version of OPatch available for each version of the Oracle Universal Installer software.

Note:

The Oracle Fusion Middleware customers must use the OPatch version in Oracle Home, and must move to a different version only when stated by the support team.

To identify the version of OPatch:

  1. Change directory to the following directory:
    cd ORACLE_HOME/OPatch/
    
  2. Run the following command:
    ./opatch version
    

    For example:

    ./opatch version
    OPatch Version: 13.9.4.2.1
    
    OPatch succeeded.

Obtaining Patches Required for Your Installation

You can search for and download the patches required for your installation from My Oracle Support.

My Oracle Support:
http://support.oracle.com

After you sign in to My Oracle Support, click the Patches & Updates tab, which provides various tools that allow you to quickly locate the patches important to your Oracle software installation.

Note:

Review the README file that is included with each patch. The README file includes important information about the requirements and procedures for applying the patch.

OPatch Environment Variables for Fusion Middleware

Before you run OPatch, ensure that you set the ORACLE_HOME environment variable.

OPatch uses the ORACLE_HOME environment variable to identify the Oracle home that you are planning to patch.

Backup and Recovery Considerations for Patching

It is highly recommended that you back up the Oracle 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 Oracle home is backed up and the local inventory is corrupted or lost for some reason, you must restore the entire Oracle home. If a backup does not exist, you may have to reinstall the software.

Using OPatch to Patch Oracle Fusion Middleware

Use OPatch to perform the necessary steps for applying a patch to an Oracle home.

The following topics describe how to use OPatch to patch Oracle Fusion Middleware:

Summary of the Steps For Using OPatch in a Fusion Middleware Environment

Applying a patch with OPatch involves a series of steps that must be performed to ensure successful patching.

The following table summarizes the typical steps required to patch your existing Fusion Middleware environment using OPatch.

Table 1-2 Using OPatch with Oracle Fusion Middleware

Task Description Documentation

Acquire patches required for your installation.

Log in, search for, and download the patches required for your specific installation.

Obtaining Patches Required for Your Installation

Review the README.txt file for the patch.

Each patch archive includes a README file that contains important information and instructions that must be followed prior to applying your patch. It is important to review the README file because it provides any unique steps or other information specific to the patch.

The README.txt file that is packaged within the patch archive

Check for patch prerequisites.

The OPatch apply -report command identifies that the prerequisites for the patch have been met.

Verifying the Prerequisites for a Patch

Apply the patch.

After you determine the Oracle home to which you need to apply the patch, and you have read the README file, then you can apply the patch with the opatch apply command.

Examples of Applying and Rolling Back Patches Using OPatch

Verify that the patch was applied to the Oracle home successfully.

The OPatch lsinventory command shows what patches have been applied to the Oracle home. Use this command to verify the application of the patch.

Using the OPatch lsinventory Command to Verify the Patches Applied to an Oracle Home

Verify that your software runs properly after you apply the patch.

After the patching is complete and your servers are restarted, check your product software to verify that the issue has been resolved.

Verifying the Installation after Applying a Patch

Troubleshoot the application of a patch.

If there are problems applying a patch, your first troubleshooting task is to review the log file for the OPatch session.

Troubleshooting a Patch by Viewing the OPatch Log File

Roll back the application of a patch.

If for some reason the result is not satisfactory, you can use the opatch rollback command to remove the patch from the Oracle home.

If additional assistance is required, go to My Oracle Support (formerly OracleMetaLink).

Rolling Back a Patch You Have Applied

Common OPatch Commands When Patching an Oracle Fusion Middleware Oracle Home

OPatch provides several commands that you can use to apply, roll back, and verify a patch for an Oracle home. You can use OPatch to apply and roll back a single patch or multiple patches.

Table 1-3 Common OPatch Commands Used When Patching an Oracle Fusion Middleware Environment

Command Description Example

opatch apply

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.

Verifying the Prerequisites for a Patch

Applying a Single Patch Using the Apply Command

opatch napply

This command applies multiple patches.

Applying Multiple Patches Using the OPatch napply Command

opatch lsinventory

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.

Using the OPatch lsinventory Command to Verify the Patches Applied to an Oracle Home

opatch rollback

This command removes an existing one-off patch from the appropriate Oracle home directory indicated by the reference ID.

Rolling Back a Patch You Have Applied

opatch nrollback

This command rolls back multiple interim patches at the same time.

Rolling Back Multiple Patches You Have Applied

Examples of Applying and Rolling Back Patches Using OPatch

After you obtain the patches required for your installation, use the appropriate OPatch commands to verify any patch prerequisites, apply a patch to an Oracle home, and if necessary, roll back the application of a patch.

The following topics provide some examples of using OPatch to patch an Oracle Fusion Middleware installation:

Verifying the Prerequisites for a Patch

You can use the checkApplicable command as a prerequisite check before applying a patch. This command will check whether a given patch is applicable to one or more Oracle homes.

For a Fusion Middleware installation, OPatch will look for Product directories present under the Oracle home and registered with a single defined central inventory.

If the environment variable MW_HOME (or) 'mw_home' option is not defined and the ORACLE_HOME environment variable or 'oh' option is also not defined, OPatch will run the checkApplicable command on the applicable Oracle home.

If the ORACLE_HOME environment variable is defined or the 'oh' option is given, OPatch will run the command on the referenced Oracle home with precedence given to the 'oh' option.

The following are examples of patches not applicable:

  • Patches requiring components that are not installed in the Oracle home (or) installed but not of the same version.
  • Files mentioned by patch metadata that could not be patched.
The syntax for the checkApplicable command is shown below:
opatch checkApplicable [-ph patch_location]
        [-allhomes ]
        [-invPtrLoc <Path to oraInst.loc file> ]
        [-mw_home <Path of the Oracle home> ]
        [-oh <Path of the reference Oracle home> ]
   

Table 1-4 Options for the OPatch checkApplicable Command:

Options Description

-allhomes

This option will overide all other options involved in the logic of getting the homes for the test of 'checkApplicable'.

This option ensures that the check is applied only to all the registered homes in central inventory.

-invPtrLoc

This option is used to locate the oraInst.loc file during an installation, see Installing Software with the Oracle Universal Installer.

If this option is used during installation, then you must also use this option for other Installer actions, including an OPatch Upgrade (Patch 28186730). When applying interim patches with OPatch, for example: opatch apply, the Central Inventory location is found using the ORACLE_HOME/oraInst.loc configuration, and you do not have to supply the -invPtrLoc parameter.

-mw_home

Indicates the path of the Oracle home. This value takes precedence over MW_HOME environment variable.

-oh

Indicates the oracle home to work on. This value takes precedence over the environment variable ORACLE_HOME. This option also ensures that the command runs only on this Oracle home.

-ph

Indicates the location of the patch for which you want to run the checkApplicable command. If not specified, the patch in the current directory is used.

Using the -report option

To verify that a patch can be applied to a specific Oracle home, you can also use the -report option with the opatch apply command. This option will execute all the prerequisite checks including checkApplicable.

For example:

opatch apply path_to_patch_directory -report

This command displays the actions that are taken by the patch, but does not actually apply the patch. As a result, it allows you to verify that the prerequisites for the patch have been met.

Applying a Single Patch Using the Apply Command

To apply a single patch to an Oracle Fusion Middleware Oracle home, use the opatch apply command.

Example 1-1 shows how to use the opatch apply command to apply a patch to an Oracle Fusion Middleware Oracle home.

This example assumes that:

  • The patch you have downloaded has been saved to a directory that is named for the patch number in My Oracle Support. In this case, the patch number is 15941858.

  • Change the directory to the patch directory and then run the OPatch apply command. Alternatively, you can run the OPatch command from the ORACLE_HOME/OPatch directory and include the location of the patch as an argument to the command. For example:

    opatch apply /opt/patches/15941858/
    
  • The OPatch directory is already included in the PATH variable on the host computer.

Example 1-1 Using the OPatch apply Command to Apply a Patch to an Oracle Fusion Middleware Oracle Home

> cd /opt/patches/100006
> opatch apply
Oracle Interim Patch Installer version 13.9.4.2.1
Copyright (c) 2019, Oracle Corporation.  All rights reserved.

Oracle Home       : /opt/Oracle/products/fmw12c
Central Inventory : /opt/Oracle/oraInventory
   from           : /var/opt/Oracle/oraInst.loc
OPatch version    : 13.9.4.2.1
OUI version       : 13.9.4.0.0
Log file location : /opt/Oracle/products/fmw12c/cfgtoollogs/opatch/opatch2019-10-13_23-11-47AM.log

OPatch detects the Middleware Home as "/opt/Oracle/products/fmw12c"

Verifying environment and performing prerequisite checks...
OPatch continues with these patches:   100006  

Do you want to proceed? [y|n]
y
User Responded with: Y
All checks passed.

Please shutdown Oracle instances running out of this ORACLE_HOME on the local system.
(Oracle Home = '/opt/Oracle/products/fmw12c')

Is the local system ready for patching? [y|n] 
y
User Responded with: Y
Backing up files...
Applying interim patch '100006' to OH '/opt/Oracle/products/fmw12c'

Patching component oracle.wls.core.app.server 12.2.1.4.0...

Patching component oracle.wls.core.app.server 12.2.1.4.0...
Patch 100006 successfully applied
Log file location: /opt/Oracle/products/fmw12c/cfgtoollogs/opatch/opatch2019-10-13_23-11-47AM.log

OPatch succeeded.
Applying Multiple Patches Using the OPatch napply Command

To apply multiple patches to an Oracle Fusion Middleware Oracle home, use the opatch napply command.

Example 1-2 shows how to use the opatch napply command to apply multiple patches to an Oracle Fusion Middleware Oracle home.

This example assumes that the patches you have downloaded have been saved to a staging directory, such as:

/opt/patches

It also assumes that you have changed directory to the staging directory and the staging directory contains a directory for each patch. For example:

/opt/patches/100006
/opt/patches/100007

Example 1-2 Using the OPatch napply Command to Apply Multiple Patches to an Oracle Fusion Middleware Oracle Home

> /opt/Oracle/products/fmw12c/OPatch/opatch napply -id 100006,100007
Oracle Interim Patch Installer version 13.9.4.2.1
Copyright (c) 2019, Oracle Corporation.  All rights reserved.

Oracle Home       : /opt/Oracle/products/fmw12c
Central Inventory : /opt/Oracle/oraInventory
   from           : /var/opt/Oracle/oraInst.loc
OPatch version    : 13.9.4.2.1
OUI version       : 13.9.4.0.0
Log file location : /opt/Oracle/products/fmw12c/cfgtoollogs/opatch/opatch2019-10-13_23-11-47PM.log

OPatch detects the Middleware Home as "/opt/Oracle/products/fmw12c"

Verifying environment and performing prerequisite checks...
OPatch continues with these patches:   100006  100007  

Do you want to proceed? [y|n]
y
User Responded with: Y
All checks passed.

Please shutdown Oracle instances running out of this ORACLE_HOME on the local system.
(Oracle Home = '/opt/Oracle/products/fmw12c')

Is the local system ready for patching? [y|n]
y
User Responded with: Y
Backing up files...
Applying interim patch '100006' to OH '/opt/Oracle/products/fmw12c'

Patching component oracle.wls.core.app.server,12.2.1.4.0...

Patching component oracle.wls.core.app.server,12.2.1.4.0...
Applying interim patch '100007' to OH '/opt/Oracle/products/fmw12c'

Patching component oracle.wls.core.app.server,12.2.1.4.0...

Patching component oracle.wls.core.app.server,12.2.1.4.0...
Patches 100006,100007 successfully applied.
Log file location: /opt/Oracle/products/fmw12c/cfgtoollogs/opatch/opatch2019-10-13_23-11-47AM.log

OPatch succeeded.
Rolling Back a Patch You Have Applied

To roll back a patch that was applied to an Oracle Fusion Middleware Oracle home, use the opatch rollback command.

Example 1-3 shows how to use the opatch rollback command to roll back a patch that was applied to an Oracle Fusion Middleware Oracle home.

This example assumes that the OPatch directory is already included in the PATH variable on the host computer.

Example 1-3 Using the OPatch rollback Command to Roll Back a Patch

> opatch rollback -id 100006
Oracle Interim Patch Installer version 13.9.4.2.1
Copyright (c) 2019, Oracle Corporation.  All rights reserved.

Oracle Home       : /opt/Oracle/products/fmw12c
Central Inventory : /opt/Oracle/oraInventory
   from           : /var/opt/Oracle/oraInst.loc
OPatch version    : 13.9.4.2.1
OUI version       : 13.9.4.0.0
Log file location : /opt/Oracle/products/fmw12c/cfgtoollogs/opatch/opatch2019-10-13_23-11-47.log

OPatch detects the Middleware Home as "/opt/Oracle/products/fmw12c"

Patches will be rolled back in the following order: 
   100006
The following patch(es) will be rolled back: 100006 

Please shutdown Oracle instances running out of this ORACLE_HOME on the local system.
(Oracle Home = '/opt/Oracle/products/fmw12c')

Is the local system ready for patching? [y|n]
y
User Responded with: Y

Rolling back patch 100006...

RollbackSession rolling back interim patch '100006' from OH '/opt/Oracle/products/fmw12c'

Patching component oracle.wls.core.app.server, 12.2.1.4.0...

Patching component oracle.wls.core.app.server, 12.2.1.4.0...
RollbackSession removing interim patch '100006' from inventory
Log file location: /opt/Oracle/products/fmw12c/cfgtoollogs/opatch/opatch2019-10-13_23-11-47AM.log

OPatch succeeded.
Rolling Back Multiple Patches You Have Applied

To roll back multiple patches that were previously applied to an Oracle Fusion Middleware Oracle home, use the opatch nrollback command.

Example 1-4 shows how to use the opatch nrollback command to roll back multiple patches that were previously applied to an Oracle Fusion Middleware Oracle home.

This example assumes that the patches you applied were patch numbers 100006 and 100007.

Example 1-4 Using the OPatch nrollback Command to Roll Back Multiple Patches

> /opt/Oracle/products/fmw12c/OPatch/opatch nrollback -id 100006,100007
Oracle Interim Patch Installer version 13.9.4.2.1
Copyright (c) 2019, Oracle Corporation.  All rights reserved.

Oracle Home       : /opt/Oracle/products/fmw12c
Central Inventory : /opt/Oracle/oraInventory
   from           : /var/opt/Oracle/oraInst.loc
OPatch version    : 13.9.4.2.1
OUI version       : 13.9.4.0.0
Log file location : /opt/Oracle/products/fmw12c/cfgtoollogs/opatch/opatch2019-10-13_23-11-47PM.log

OPatch detects the Middleware Home as "/opt/Oracle/products/fmw12c"

Patches will be rolled back in the following order: 
   100006   100007
The following patch(es) will be rolled back: 100006  100007  

Please shutdown Oracle instances running out of this ORACLE_HOME on the local system.
(Oracle Home = '/opt/Oracle/products/fmw12c')

Is the local system ready for patching? [y|n]
y
User Responded with: Y

Rolling back patch 100006...

RollbackSession rolling back interim patch '100006' from OH '/opt/Oracle/products/fmw12c'

Patching component oracle.wls.core.app.server, 12.2.1.4.0..

Patching component oracle.wls.core.app.server, 12.2.1.4.0..
RollbackSession removing interim patch '100006' from inventory

Rolling back patch 100007...

RollbackSession rolling back interim patch '100007' from OH '/opt/Oracle/products/fmw12c'

Patching component oracle.wls.core.app.server, 12.2.1.4.0...

Patching component oracle.wls.core.app.server, 12.2.1.4.0...
RollbackSession removing interim patch '100007' from inventory
Log file location: /opt/Oracle/products/fmw12c/cfgtoollogs/opatch/opatch2019-10-13_23-11-47PM.log

OPatch succeeded.

Troubleshooting a Patch by Viewing the OPatch Log File

To understand how a patch is applied and to troubleshoot any problems with the application of a patch, review the log file for the OPatch session.

The log file location is usually saved to the following directory or a subdirectory within this location:

ORACLE_HOME/cfgtoollogs/opatch/

Subdirectories within this location are identified by the patch number or by the command you ran (such as lsinv).

The file name for each log file identifies the date and time it was executed. For example:

opatch2013-06-10_14-24-54PM_1.log

You can also locate the log file by viewing the output of the opatch command. The log file name and location is included in the output of the command. For example:

Log file location: /opt/Oracle/products/fmw12c/cfgtoollogs/opatch/opatch2013-06-10_14-24-54PM_1.log

Using the OPatch lsinventory Command to Verify the Patches Applied to an Oracle Home

To verify what patches have been applied to an Oracle home, or to find out additional information about the Oracle home, use the opatch lsinventory command.

The following example shows sample output of the lsinventory command, which indicates that a specific interim patch has been applied.

Example 1-5 Running the opatch lsinventory Command to Obtain the Oracle Home Information

> opatch lsinventory
Oracle Interim Patch Installer version 13.9.4.2.1
Copyright (c) 2019, Oracle Corporation.  All rights reserved.

Oracle Home       : /opt/Oracle/products/fmw12c
Central Inventory : /opt/Oracle/oraInventory
   from           : /var/opt/Oracle/oraInst.loc
OPatch version    : 13.9.4.2.1
OUI version       : 13.9.4.0.0
Log file location : /opt/Oracle/products/fmw12c/cfgtoollogs/opatch/opatch2019-10-13_23-11-47PM.log

OPatch detects the Middleware Home as "/opt/Oracle/products/fmw12c"

Lsinventory Output file location :
/opt/Oracle/products/fmw12c/cfgtoollogs/opatch/lsinv/lsinventory2019-10-13_23-11-47PM.txt

--------------------------------------------------------------------------------
Local Machine Information::
Hostname:
ARU platform id: 226
ARU platform description:: Linux x86-64

Interim patches (1) :

Patch  100006     : applied on Mon Jun 10 12:39:07 PDT 2019
Unique Patch ID:  150220
Patch description:  "TEST PATCH FOR WLS 12.2.1.4.0 - JAVA CLASSES PATCH"
   Created on 17 May 2019, 11:54:20 hrs PST8PDT
   Bugs fixed:
     783169, 15941850

--------------------------------------------------------------------------------

OPatch succeeded.

Verifying the Installation after Applying a Patch

After you apply one or more patches successfully, use the WebLogic Administration Console, Fusion Middleware Control, and your organization’s application testing to verify that your system is running successfully.

To verify your installations in an Oracle Fusion Middleware 12c environment:

  1. Start the servers in all domains associated with the Oracle home you patched.
  2. Open the WebLogic Server Administration Console for each domain to verify the Administration Server and to view the status of the components in the domain.
    • Also, in any Oracle Fusion Middleware domain (where the Oracle Fusion Middleware Infrastructure is installed), open the Oracle Enterprise Manager Fusion Middleware Control console to view the status of the components in the domain.

    From either console, you can verify that the servers and applications are up and running correctly. See the following topics in the Administering Oracle Fusion Middleware document:

If the software does not work as expected, follow the rollback instructions in Rolling Back a Patch You Have Applied.