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:

Topics:

1.1 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:

Topics:

1.1.1 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.

1.1.2 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.

1.2 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:

Topics:

1.2.1 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.

Topics:

1.2.1.1 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

1.2.1.2 Identifying the Version of OPatch Included with Oracle Fusion Middleware 12c

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

In general, there is a version of OPatch available for each version of the Oracle Universal Installer software.

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.1.0.0
    
    OPatch succeeded.
    

1.2.2 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.

1.2.3 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.

1.2.4 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.

1.3 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:

Topics:

1.3.1 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

1.3.2 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

1.3.3 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:

Topics:

1.3.3.1 Verifying the Prerequisites for a Patch

To verify that a patch can be applied to a specific Oracle home, use the —report argument to the opatch apply command.

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.

1.3.3.2 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/15941858
> opatch apply
Oracle Interim Patch Installer version 13.9.1.0.0
Copyright (c) 2016, 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.1.0.0
OUI version       : 13.9.1.0.0
Log file location : /opt/Oracle/products/fmw12c/cfgtoollogs/opatch/opatch2016-09-19_08-09-15AM_1.log

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

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

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 '15941858' to OH '/opt/Oracle/products/fmw12c'

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

Patching component oracle.wls.core.app.server 12.2.1.3.0...
Patch 15941858 successfully applied
Log file location: /opt/Oracle/products/fmw12c/cfgtoollogs/opatch/opatch2016-09-19_08-09-15AM_1.log

OPatch succeeded.

1.3.3.3 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/15941858
/opt/patches/15955138

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 15941858,15955138
Oracle Interim Patch Installer version 13.9.1.0.0
Copyright (c) 2016, 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.1.0.0
OUI version       : 13.9.1.0.0
Log file location : /opt/Oracle/products/fmw12c/cfgtoollogs/opatch/opatch2013-06-11_07-36-40AM_1.log

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

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

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 '15941858' to OH '/opt/Oracle/products/fmw12c'

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

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

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

Patching component oracle.wls.core.app.server,12.2.1.3.0...
Patches 15941858,15955138 successfully applied.
Log file location: /opt/Oracle/products/fmw12c/cfgtoollogs/opatch/opatch2013-06-11_07-36-40AM_1.log

OPatch succeeded.

1.3.3.4 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 15941858
Oracle Interim Patch Installer version 13.9.1.0.0
Copyright (c) 2016, 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.1.0.0
OUI version       : 13.9.1.0.0
Log file location : /opt/Oracle/products/fmw12c/cfgtoollogs/opatch/opatch2016-09-19_08-31-35AM_1.log

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

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

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 15941858...

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

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

Patching component oracle.wls.core.app.server, 12.2.1.3.0...
RollbackSession removing interim patch '15941858' from inventory
Log file location: /opt/Oracle/products/fmw12c/cfgtoollogs/opatch/opatch2016-09-19_08-31-35AM_1.log

OPatch succeeded.

1.3.3.5 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 15941858 and 15955138.

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

> /opt/Oracle/products/fmw12c/OPatch/opatch nrollback -id 15941858,15955138
Oracle Interim Patch Installer version 13.9.1.0.0
Copyright (c) 2016, 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.1.0.0
OUI version       : 13.9.1.0.0
Log file location : /opt/Oracle/products/fmw12c/cfgtoollogs/opatch/opatch2013-06-10_14-24-54PM_1.log

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

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

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 15941858...

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

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

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

Rolling back patch 15955138...

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

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

Patching component oracle.wls.core.app.server, 12.2.1.3.0...
RollbackSession removing interim patch '15955138' from inventory
Log file location: /opt/Oracle/products/fmw12c/cfgtoollogs/opatch/opatch2013-06-10_14-24-54PM_1.log

OPatch succeeded.

1.3.4 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

1.3.5 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.1.0.0
Copyright (c) 2017, 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.1.0.0
OUI version       : 13.9.1.0.0
Log file location : /opt/Oracle/products/fmw12c/cfgtoollogs/opatch/opatch2013-06-10_12-32-37PM_1.log

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

Lsinventory Output file location :
/opt/Oracle/products/fmw12c/cfgtoollogs/opatch/lsinv/lsinventory2013-06-10_12-32-37PM.txt

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

Interim patches (1) :

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

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

OPatch succeeded.

1.3.6 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.