Skip Headers
Oracle® OPatch User's Guide
Release 12.1 for Windows and UNIX

E39376-03
Go to Documentation Home
Home
Go to Book List
Book List
Go to Table of Contents
Contents
Go to Index
Index
Go to Feedback page
Contact Us

Go to previous page
Previous
Go to next page
Next
PDF · Mobi · ePub

A OPatch Syntax and Commands

This appendix provides a summary of the syntax and command options to use for the opatch command. Use these command options to develop your own patch plan.

A.1 OPatch Syntax

The OPatch utility is located in the $Oracle_Home/OPatch directory. You can run it 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 opatch command.

  • [-report] prints the actions without executing.

  • [command] is one of the OPatch commands described in Table A-1.

  • [-option] is one of the OPatch command options. See each command listed below for a summary of available options.

Table A-1 OPatch Commands

Command Description

apply

Installs or applies a patch.

compare

Compare two files generated by the opatch lsinventory -xml command.

lsinventory

Lists what is currently installed on the system.

lspatches

Prints a summary of all installed patches.

napply

Installs n number of patches (hence napply).

nrollback

Rolls back patches from several GI/RAC homes at the same time.

query

Queries a given patch for specific details.

rollback

Removes a patch.

version

Prints the current version of the patch tool.

prereq

Runs patching prerequisite checks on an ORACLE_HOME..

util

Invokes specified utilities on an GI/RAC home


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 ] [ -report ] [ command ]

            command := apply
        compare
                        lsinventory
                        lspatches
                        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 -help -fmw'
   'opatch apply -help'
   'opatch compare -help'
   'opatch lsinventory -help'
   'opatch lspatches -help'
   'opatch napply -help'
   'opatch nrollback -help'
   'opatch rollback -help'
   'opatch prereq -help'
   'opatch util -help'

A.2 apply

The apply command applies an interim patch to an ORACLE_HOME from the current directory. The patch location can specified using the parameter patch_location. This command does not support System Patch.

Syntax

Use following syntax for this command:

opatch apply  [-connectString  <List of connect strings>]
              [-delay <value> ] [ -force ] [ -force_conflict ]
              [-init <parameters for the init script in escaped double
               quotes> [-opatch_init_end] ]
              [-invPtrLoc <Path to oraInst.loc> ]
              [-jre <LOC> ] [-local ] [-local_node <Local node name>] 
              [-minimize_downtime ] [-no_bug_superset ] [-no_inventory ] 
              [-no_relink] [-no_sysmod] [-ocmrf <Response file location> ]
              [-oh <ORACLE_HOME> ]
              [-post <parameters for the post script in escaped
               quotes> [-opatch_post_end] ] 
              [-pre <parameters for the pre script
               in escaped double quotes> [-opatch_pre_end] ]
              [-profile_mask <Name of profile>]
              [-property_file <Path to property file>]
              [-ptlConnect <portal connect string>]
              [-ptlPassword <portal password>]
              [-ptlSchema <portal schema>]
              [-remote_nodes <List of remote nodes (node1,node2)>] 
              [-retry <value ] [-runSql ]
              [silent ] [-sqlScript <path of the sql file>] [-verbose ]
              [ <Patch Location> ]

Options

Table A-2 describes the options available for the apply command.

Table A-2 apply Command Options

Option Description

delay

Specifies how many seconds to wait before attempting to lock the inventory in the case of a previous failure. You can use this option only if you specify the -retry option.

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.

force_conflict

If a conflict exists which prevents the patch from being applied, the -force_conflict flag can be used to apply the patch. OPatch will remove all the conflicting patches before applying the current patch. This will override the 'silent' behavior for conflicts and hence is meaningful only when used with the 'silent' option.

invPtrLoc

Specifies the location of the oraInst.loc file. This option is needed when the -invPtrLoc argument was used during installation. Oracle recommends using the default Central Inventory for a platform.

jre

Instructs OPatch to use JRE (Java) from the specified location instead of the default location under the GI/RAC home directory.

local

Specifies that the OPatch utility 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 argument 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 -local option or a rolling patch.

no_bug_superset

Specifies to error out if the current patch bugs-to-fix is a superset (or same set) as an installed patch bugs-fixed in the GI/RAC home directory.

no_relink

This option does not perform any make operations. You can use it during multiple patch applications and to perform the linking step only once. OPatch does not keep track of the make operations it did not perform. You need to make sure to execute OPatch without this option at the end for compilation.

ocmrf

Give OPatch the absolute path to the OCM response file to be used for OCM configuration. -silent must be used in conjunction with -ocmrf if GI/RAC home doesn't have OCM installed and configured.

oh

Specifies the GI/RAC home directory to use instead of the default. This takes precedence over the environment variable ORACLE_HOME.

opatch_post_end

Marks the end of the post option. You use this option with the post option. If you do not use this option, everything after post until the end of the command is passed into post.

opatch_pre_end

Marks the end of the pre options. You use this option with the pre option. If you do not use this argument, everything after pre until the end of the command is passed into pre.

post

Specifies the parameters to be passed to the post script. This script is executed after the patch is applied. You need to enclose the values for this option in double-quotes.

pre

Specifies the parameters to be passed to the pre script. This script is executed before the patch is applied. You need to enclose the values for this option in double-quotes.

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

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.

A.3 compare

The compare command allows you to compare the bugs that have been fixed between two GI/RAC homes.This command allows for comparison between two files generated by the opatch lsinventory -xml command. Currently, this command only accepts two files as input.

Syntax

opatch compare     [<file1> <file2>]

A.4 lsinventory

The lsinventory command lists the inventory for a particular GI/RAC home, or displays all installations that can be found. This command does not have any required options.

Syntax

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> ] 
                   [-patch_id <asc | desc> ]
                   [-ptlConnect  <portal connect string> ]
                   [-ptlPassword <portal password> ]  
                   [-ptlSchema <portal schema> ]
                   [-property_file <path to property file>]
                   [-retry <value> ] [-translation_patch ]
                   [-xml <xmlFile>]

The following sections provide examples for the detail, bugs_fixed, and patch desc options. See Table A-3 for descriptions of the command options.

Options

Table A-3 describes the options available for the lsinventory command.

Table A-3 lsinventory Command Options

Option Description

all

Reports the name and installation directory for each GI/RAC home directory found.

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 -all option.

group_by_date

Specifies that OPatch should group all installed patches by the date they were installed in the GI/RAC home.

invPtrLoc

Specifies the location of the oraInst.loc file. You need this option if you used the invPtrLoc option during the installation. Oracle recommends using the default Central Inventory for a platform.

jre

Specifies the location of a particular JRE (Java) to use instead of the default location under the GI/RAC home directory.

local

Instructs OPatch to display inventory information of the local node only.

oh

Specifies the GI/RAC 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 GI/RAC home in ascending (asc) or descending (desc) order, which is the default, based on installed time.

patch_id

Lists the patch IDs installed in the GI/RAC home in ascending (asc) or descending (desc) order based on patch numbers. The value defaults to ascending (asc).

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.

xml

Generates xml output based on the current GI/RAC home inventory to the specified xml file.


A.5 lspatches

The lspatches command prints a summary of all installed patches.

Syntax

Use the following syntax for the lspatches command:

opatch lspatches   [-bugs] [-id <patch ID> ] 
                   [-invPtrLoc <Path to oraInst.loc> ] [-jre <LOC> ]
                   [-oh <ORACLE_HOME> ] [ <patch location> ]
                   [-qfile <file path> ] [-required ] [-verify]

Options

Table A-4 lists the options available for the lspatches command.

Table A-4 lspatches Command Options

Option Description

bugs

Prints out bugs in addition to the summary

id

This option specifies the patch number. It must be registered in the GI/RAC home inventory. It can be any numeric sequence or combined with language. Example: 11111, 11111/zh_CN. It cannot support multiple patch IDs.

invPtrLoc

Used to locate the oraInst.loc file. When the installation uses the invPtrLoc flag, the value should indicate the path to oraInst.loc file

jre

This option tells OPatch to use JRE (java) from the specified location instead of the default location under GI/RAC home.

oh

The GI/RAC home to work on. This takes precedence over the environment variable ORACLE_HOME.

qfile

Specifies the relative path to GI/RAC home of the file to determine the latest patch that touches this file. Example:

On Linux: admin/rdbms/catcpu.sql On Windows: admin\rdbms\catcpu.sql OPatch can tell which latest patch touches the file catcpu.sql in the GI/RAC home.

required

This option will print key metadata only. This includes the following metadata: required components, prereq patches, executables to shutdown and support platforms.

This option should be accompanied by either option -id <PATCH_ID> or <PATCH_LOCATION>.

verify

This option verifies whether or not the specified patch ID or patch location is registered in the GI/RAC home inventory. In addition, this option validates all patch files in the GI/RAC home. This option should be accompanied by either option -id <PATCH_ID> or <PATCH_LOCATION>.This option doesn't support System Patch. Example: opatch lspatches -id 111 -verify

opatch lspatches /scratch/test/111 -verify


A.6 napply

This command applies patches to several GI/RAC homes at the same time. This command does not support System Patches.

Syntax

Use the following syntax for the napply command:

opatch napply [patch_location] [-id comma-separated list of patch IDs]    
                      [ -all_nodes ]
                      [-connectString  <List of connect strings>]
                      [-delay <value> ] [ -force ] [ -force_conflict ]
                      [-idFile <path of the file that has list of patch IDs ]
                      [-init <parameters for the init script in escaped double
                       quotes> [-opatch_init_end] ]
                      [-invPtrLoc <Path to oraInst.loc> ]
                      [-jre <LOC> ] [ -local ]
                      [ -local_node <Local node name> ]
                      [-minimize_downtime ] [-no_bug_superset ]
                      [-no_inventory ] [-no_relink]
                      [-no_sysmod]  [-ocmrf <Response file location> ]
                      [-oh <ORACLE_HOME> ]
                      [ -phBaseDir <Path to the directory that contains list
                        of patch directories> ]
                      [ -phBaseFile <Path to the file containing the
                        location of the patches to be applied> ]
                      [-post <parameters for the post script in
                       escaped double quotes> [-opatch_post_end] ]
                      [-pre <parameters for the pre script in
                       escaped double quotes> [-opatch_pre_end] ]
                      [-profile_mask <Name of profile>]
                      [ -property_file <Path to property file> ]
                      [-ptlConnect <portal connect string>]
                      [-ptlPassword <portal password>]
                      [-ptlSchema <portal schema>] 
                      [ -remote_nodes <List of remote nodes (node1,node2)> ]                                          [-retry <value> ] [-runSql] [-silent ]  
                      [-skip_subset] 
                      [-skip_duplicate]
                      [-sqlScript <path of the sql file>]
                      [-verbose ]  
 

Options

Table A-5 lists the options available for this command.

Table A-5 napply Command Options

Option Description

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 retry option.

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.

force_conflict

If a conflict exist which prevents the patch from being applied, the -force_conflict flag can be used to apply the patch. OPatch will remove all the conflicting patches before applying the current patch. This will override the 'silent' behavior for conflicts and hence is meaningful only when used with 'silent' option.

id

Use the 'lsinventory' option to display all patch ids. Each one-off patch is indicated by its id. A comma separated list of patches can be given to select the patches to be applied. For translation patches, the patch id should be of the format <Patch ID>/<Language code>.

idFile

The input to be given is a file location that contains a list of apply patch ids separated by commas or white spaces. This option cannot to be in conjunction with 'id' option. For translation patches, the patch id should be of the format <Patch ID>/<Language code>.

invPtrLoc

Specifies the location of the oraInst.loc file. The invPtrLoc option is needed when this option is used during installation. Oracle recommends the use of the default Central Inventory for a platform.

jre

Instructs OPatch to use JRE (Java) from the specified location instead of the default location under the GI/RAC home directory. You cannot specify the jdk and jre options together.

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.

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 GI/RAC home directory.

no_relink

This option does not perform any make operations. You can use it during multiple patch applications and to perform the linking step only once. OPatch does not keep track of the make operations it did not perform. You need to make sure to execute OPatch without this option at the end for compilation.

ocmrf

Give OPatch the absolute path to the OCM response file to be used for OCM configuration. -silent must be used in conjunction with -ocmrf if GI/RAC home does not have OCM installed and configured.

oh

Specifies the GI/RAC home directory to use instead of the default. This takes precedence over the environment variable ORACLE_HOME.

opatch_post_end

Marks the end of the post option. You use this option with the post option. If you do not use this option, everything after post until the end of the command is passed into post.

opatch_pre_end

Marks the end of the pre options. You use this option with the pre option. If you do not use this option, everything after pre until the end of the command is passed into pre.

phBaseDir

Used to specify a directory containing patch directories (or) zip files.

phBaseFile

If you do not specify <patch_location>, use this option to point OPatch to a file containing a list of patches to be n-applied. Each line in the file points to a location of a patch.

post

Specifies the parameters to be passed to the post script. This script is executed after the patch is applied. You need to enclose the values for this option in double-quotes.

pre

Specifies the parameters to be passed to the pre script. This script is executed before the patch is applied. You need to enclose the values for this option in double-quotes.

profile_mask

If the patch to be applied specifies WLS patch/patchset as prerequisites, OPatch will read the WLS default patch profile. To have OPatch read non-default patch profile, specify the patch profile name with this option.

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 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 GI/RAC 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 GI/RAC 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 napply yesterday for patch A that fixed bugs 1 and 2, you use napply today with this 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.

verbose

Prints additional OPatch output to the screen as well as to the log file.


Examples:

'opatch napply <patch_location>' to apply all patches under
  <patch_location> directory

'opatch napply <patch_location> -id 1,2,3' to apply patches
  1, 2, and 3 which are present under <patch_location>
  directory

'opatch napply <patch_location> -skip_subset -skip_duplicate'
  to apply all patches under <patch_location> directory.
  OPatch will skip 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'
  to apply patches 1, 2, and 3 which are under <patch_location>
  directory. OPatch will skip duplicate patches and subset patches
  (patches under <patch_location> that are subsets of patches  
  installed in the Oracle Home) 

'opatch napply <patch_location> -idfile /tmp/list.txt' where list.txt contains
a list of patch IDs to be applied. The list should be separated by a space or
comma. For example: 1 2 3

'opatch napply <patch_location> -id 1/fr,2/de' to apply patches 1 (french
patch), 1 (german patch) which are present in the <patch_location> directory

A.7 nrollback

The Nrollback command rolls back patches from several GI/RAC homes at the same time.

Syntax

Use the following syntax for this command:

opatch nrollback -id <comma-separated list of patch IDs>
                      [ -all_nodes ] 
                      [-connectString  <List of connect strings>] 
                      [-delay <value>] -id <Comma separated list of patch IDs>
                      [-idFile <file location containing a list of
                       rollback IDs separated by commas or white spaces>
                      [-init <parameters for the init script in escaped double
                       quotes> [-opatch_init_end] ]
                      [-invPtrLoc <Path to oraInst.loc> ]
                      [-jre <LOC> ] [-local] 
                      [-local_node <Local node name>]
                      [-no_inventory] [-no_relink] [-no_sysmod]
                      [-oh <ORACLE_HOME> ]   
                      [-post <parameters for the post script in 
                       escaped double quotes>[ -opatch_post_end] ]
                      [-pre <parameters for the pre script in 
                       escaped double quotes> [-opatch_pre_end] ]
                      [-property_file <Path to property file>]
              [-ptlConnect <portal connect string>]
                      [-ptlPassword <portal password>]
                      [-ptlSchema <portal schema>] 
                      [-remote_nodes <List of remote nodes (node1,node2)>]
                      [-retry <value>] [-runSql]  [-silent] 
                      [-sqlScript <path of the sql file>]
                      [-verbose]

Options

Table A-6 lists the options available for this command.

Table A-6 nrollback Command Options

Option Description

delay

If you use the retry option with the rollback command, specifies how many seconds OPatch should wait before attempting to lock the inventory again if a previous failure occurs.

id

Indicates the patch to be rolled back. Use the lsinventory option to display all patch identifiers. Each one-off patch is indicated by its ID. To successfully roll back a patch, you must provide the patch identifier.

idFile

Use 'lsinventory' option to display all patch ids. Each one-off patch is indicated by its id. To rollback a patch, the id for that patch must be supplied. The input to be given is a file location that contains a list of rollback patch ids separated by commas or white spaces. For translation patches, the patch id should be of the format <Patch ID>/<Language code>. This option cannot to be in conjunction with 'id' option.

invPtrLoc

Specifies the location of the oraInst.loc file. You need to use this option if you used the invPtrLoc option during installation. Oracle recommends the use of the default Central Inventory for a platform.

jre

Specifies the location of a particular JRE (Java) for OPatch to use instead of the default location under the GI/RAC home directory.

local

Specifies that OPatch roll back the local node, then updates 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.

no_relink

This option does not perform any make operation in the patch. You can use this option during multiple patch removals and to perform the compilation step only once.

oh

Specifies the GI/RAC home directory to use instead of the default directory. This takes precedence over the ORACLE_HOME environment variable.

opatch_post_end

Marks the end of the post options. Use this option with the post option. If you do not use this option, everything after post until the end of the command is passed into post.

opatch_pre_end

Marks the end of the pre options. Use this option with the pre option. If you do not use this option, everything after pre until the end of the command is passed into pre.

post

This option is used to pass parameters to the post script. This script is executed after removal of the patch. The value for this option have to be enclosed in double quotes. The parameters will be common parameters which will be passed to post scripts of all patches being rolled back. This option should be ended by option 'opatch_post_end'.

pre

This option is used to pass parameters to the pre script. This script is executed before removal of the patch. The value for this option have to be enclosed in double quotes. The parameters will be common parameters which will be passed to pre scripts of all patches being rolled back. This option should be ended by option 'opatch_pre_end'.

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.

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


Examples

'opatch nrollback -id 1,2,3' to roll back patches 1, 2, and 3
  that have been installed in the Oracle Home.

'opatch nrollback -id 1/fr,2/de to rollback patches 1 with language 'fr',
2 with language 'de' that have been installed in the Oracle Home.

A.8 rollback

The rollback command removes an existing one-off patch from the appropriate GI/RAC home directory indicated by the reference ID. The following syntax is used for this command:

Syntax

opatch rollback -id <ID> [-connectString  <List of connect strings>]
                [-delay <value>] 
                [-init <parameters for the init script in escaped double
                 quotes> [-opatch_init_end] ]
                [-invPtrLoc <Path to oraInst.loc> ]
                [-jre <LOC> ] [-local]
                [-local_node <Local node name>] [-no_inventory]
                [-no_relink] [-no_sysmod]
                [-oh <ORACLE_HOME>] [-ph <Patch Location>]           
                [-post <parameters for the post script in escaped
                 double quotes>[ -opatch_post_end] ] 
                [-pre <parameters for the pre
                 script in escaped double quotes> [-opatch_pre_end] ]
                [-property_file <path to property file>]
                [-ptlConnect <portal connect string>] 
                [-ptlPassword <portal password>]
                [-ptlSchema <portal schema>]
                [-remote_nodes <List of remote nodes (node1,node2)>]
                [-retry <value>] [-runSql] [-silent]
                [-sqlScript <path of the sql file>] [-verbose]
                [all_subpatches]

Options

Table A-7 describes the options available for the rollback command.

Table A-7 rollback Command Options

Option Description

delay

If you use the retry option with the rollback command, specifies how many seconds OPatch should wait before attempting to lock the inventory again if a previous failure occurs.

id

Indicates the patch to be rolled back. Use the lsinventory option to display all patch identifiers. Each one-off patch is indicated by its ID. To successfully roll back a patch, you must provide the patch identifier.

invPtrLoc

Specifies the location of the oraInst.loc file. You need to use this option if you used the invPtrLoc option during installation. Oracle recommends the use of the default Central Inventory for a platform.

jre

Specifies the location of a particular JRE (Java) for OPatch to use instead of the default location under the GI/RAC home directory.

local

Specifies that OPatch roll back the local node, then updates 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_relink

Do not perform the make operations in the patch. This option can be used during multiple patch removals and perform the compilation step only once.

oh

Specifies the GI/RAC home directory to use instead of the default directory. This takes precedence over the ORACLE_HOME environment variable.

opatch_post_end

Marks the end of the post options. Use this option with the post option. If you do not use this option, everything after post until the end of the command is passed into post.

opatch_pre_end

Marks the end of the pre options. Use this option with the pre option. If you do not use this option, everything after pre until the end of the command is passed into pre.

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 post script. This script executes after the patch is removed. You must enclose the value of this option in double-quotes.

pre

Specifies the parameters to be passed inside the pre script. This script executes before the patch is removed. You must enclose the value of this option in double-quotes.

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.

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". An Oracle Real Application Clusters setup does not support this option.

sqlScript

This option can be used to specify the custom SQL script to be run by OPatch after patching is completed

verbose

Prints additional OPatch output to the screen as well as to the log file.

all_subpatches

This option is valid ONLY for composite patches. It allows the user to rollback all sub-patches of a composite series in one shot.


A.9 query

The query command queries a specific patch for specific details. It provides information about the patch and the system being patched.

Syntax

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_patching_model] 
              [-get_product_family] [-has_sql] [-is_online_patch]  
              [-is_rolling_patch] [-is_system_patch] [-jre <LOC> ] [-oh <LOC> ] 
              [ <patch_location> ]

Options

Table A-8 lists the options available for the query command.

Table A-8 query Command Options

Option Description

all

Retrieves all information about a patch. This is equivalent to setting all available options.

is_auto_patch

This option says 'true' if the patch is auto-enabled, 'false' otherwise. This command doesn't support System Patch.

is_system_patch

This option says 'true' if the patch is a System Patch, 'false' otherwise.

is_translatable_patch

This option says 'true' if the patch is translatable, 'false' otherwise. This option doesn't support System Patch.

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.

get_os

Get platforms for which this patch could be applied. This option does not support System Patch.

get_patch_language

Get the language supported by the patch. This option doesn't support System Patch.

get_product_family

Get the product family to which the patch belongs. This option does not support System Patch.

is_online_patch

Indicates true if the patch is an online patch. Otherwise, the option is false.

is_rolling_patch

Indicates true if the patch is a rolling patch. Otherwise, the option is false.

jre

This option tells OPatch to use JRE (java) from the specified location instead of the default location under GI/RAC home.

oh

Specifies the GI/RAC home directory to use instead of the default directory. This takes precedence over the ORACLE_HOME environment variable.


A.10 version

The version command shows the current version number of the OPatch utility.

Syntax

The following syntax is used for this command:

opatch version [-all] [-invPtrLoc <Path to oraInst.loc>]
               [-jre <LOC>] [-oh <ORACLE_HOME>]
               [-v2c <5-digit version> -oui_loc <Custom OUI Location>
                -ph <Patch Location> -ohs <list of Oracle Homes
                separated by commas]
               [-help] [-h]

Table A-9 version Command Options

Option Description

all

This option displays versions of OPatch for all GI/RAC homes registered in the Central Inventory.

invPtrLoc

Used to locate the oraInst.loc file. When the installation used the invPtrLoc flag. This should be the path to the oraInst.loc file.

jre

This option tells OPatch to use JRE (java) from the specified location instead of the default location under GI/RAC home.

oh

The GI/RAC home to work on. This takes precedence over the environment variable ORACLE_HOME

v2c

The standard 5-digit version to compare. If this option is specified with an valid version which made by no more than 5 numbers separated by '.', those GI/RAC homes with valid version will be break up to two parts, one is those GI/RAC homes which have opatch version higher or equal to the value of this option, and the other is those with lower version

ph

The patch location from where the Minimum OPatch Version (if defined) will be picked. If a valid patch location is provided, will take the required minimum opatch version from the patch and set it as the standard OPatch version to be compared to.

ohs

List of GI/RAC homes to be considered. Please provide them separated by commas

help

Display valid options can be attached to this operation.


A.11 prereq

This operation runs the prerequisite checks on an ORACLE_HOME. This command does not support System Patches.

Syntax

opatch prereq <command> [-id <Comma separated list of patch IDs>]
                        [-invPtrLoc <Path to oraInst.loc> ] 
                        [-jre <LOC>] [-local_node <Local node name>] 
           [-oh <ORACLE_HOME> ]
        [-ph <Path to the single patch location>]
           [-phBaseDir <Path to the dir containing all patches>]
           [-phBaseFile <Path to the file containing the
                          location of the patches to be applied>] 
        [-property_file <Path to property file>]
                     [-remote_nodes <List of remote nodes (node1,node2)>]                                   [-sid <Comma separated list of database SIDs>]
           [-connectString  <List of connect strings>]

Commands

The prereq command executes commands that check for the prerequisite conditions shown in the table.

Table A-10 prereq Commands

Command Description

CheckActiveFilesAndExecutables

Check if there are any file(s) that are active, which are touched by the patch to be applied or rolled back.

CheckActiveServices

Check for the services that are active. Note: Applicable for Windows platforms only.

CheckApplicable

Check for the presence of the required components in the ORACLE_HOME and check if all the actions of the given patch(es) are applicable.

CheckApplicableProduct

Check if the patch is applicable for the given GI/RAC home. If the patch is marked for stand-alone homes, then it can not be applied on normal OUI-based home and vice versa. Also, a patch can be marked as a hybrid patch, where it is applicable for both homes.

CheckCentralInventoryForOH

Check if the given ORACLE_HOME is registered in the central inventory specified by the oraInst.loc file.

CheckCentralInventoryForRWSession

Check if a RW (read-write) session can be created for the given central inventory.

CheckCentralInventoryLocation

Validate the Central Inventory location. Check if it has the correct directory structure and has the inventory.xml with read permissions.

CheckComponents

Check for the presence of the required components in the ORACLE_HOME.

CheckConflictAgainstOH

Check if there are any conflicts between the patch(es) to be applied and the patch(es) in the OH.

CheckConflictAgainstOHWithDetail

Check if there are any conflicts between the patch(es) to be applied and the patch(es) in the OH, by giving out the detailed information about the conflicts/supersets.

CheckConflictAmongPatches

Check if there are any conflicts among the patch(es) to be applied.

CheckConflictAmongPatchesWithDetail

Check if there are any conflicts among the patch(es) to be applied, by giving out the detailed information about the conflicts/supersets.

CheckFileVersions

Check if the copy actions of Fusion Applications patch(es) have at least one or more file version(s) greater than the version(s) installed in the GI/RAC home.

CheckFusionAppsCompatible

Check if OUI for the GI/RAC home supports patching of Fusion applications.

CheckForIdenticalPatchInOracleHome

Check if the given list of patch(es) are identical with respect to the patch(es) installed in the GI/RAC home.

CheckForInputValues

Check if the input values provided to OPatch are enough for OPatch to proceed further.

CheckForNoOpPatches

Check if any of the patch(es) provided by the user are no-op patches. A no-op patch cannot be applied to the GI/RAC home and can be skipped. This prerequisite will fail for no-op. patches.

CheckIfOHLockedForPatching

Check if the ORACLE_HOME is locked for patching by any previous unsuccessful OPatch Session.

CheckInstalledOneOffs

Check if all the patches provided by the user to rollback are present in the given GI/RAC home.

CheckMinimumOPatchVersion

Check if all the patches provided by the user satisfy the requirement of minimum OPatch version for the OPatch currently being used.

CheckOneOffSuperset

Check if the given input Fusion Applications patch list are all candidates for one-off (or) singleton supersets. This prereq does not do any checks among the input patch list.

CheckOracleHome

Check if the given ORACLE_HOME is valid. Check if it has the inventory files with proper permissions.

CheckOraInstLocation

Check if the oraInst.loc file is proper and has the read permissions.

CheckOUILocation

Check the ORACLE_HOME for the presence of OUI.

CheckOUIVersionCompatible

Check if the OUI in the ORACLE_HOME is compatible for the OPatch.

CheckPatchApplicableOnCurrentPlatform

Check if the given patch(es) is applicable on the current platform.

CheckPatchApplyDependents

Check if all the patch(es) required by the patch(es) currently being installed is present in the GI/RAC home or not.

CheckPatchRollbackDependents

Check if there are any patch(es) in the GI/RAC home that are depending on the patch(es) being currently rolled back.

CheckPatchShipHome

Check if the given patch to be applied has the proper structure and has the correct permissions for all the files.

CheckRemoteCommandInvocable

Check if commands can be invoked on the remote machines.

CheckRemoteCopyAndRemove

Check if files can be copied to and removed from the remote machines.

CheckRequiredLibs

Check if all the required OUI libraries are present in the given ORACLE_HOME.

CheckRollbackable

Check if the given patch(es) can be rolled back from the ORACLE_HOME.

CheckSystemCommandAvailable

Check if all the commands required for applying or rolling back the given patch are present in the system.

CheckSystemSpace

Check if enough system space is available for the patch(es) to be applied.

CheckUserAdminPrivilege

Check is the user is 'root'.

Note: OPatch should not be invoked by 'root', if so then this check fails.

CheckPatchingModel

Check if the patching model of all incoming patch(es) is compatible with that of the GI/RAC home.


Table A-11 prereq Options

Option Description

connectString

This option can be used to specify the list of database instances and remote nodes. The value for this option is specified as per the following syntax "SID:User:Passwd:Node". The SID is a must, others can be ignored, OPatch takes default values for it.Example: oracle:dba:dba:mymachine,oracle1:::NOTE: If the system is not part of RAC setup, then to specify just the local node, provide the node name as empty string. This option cannot be used along with 'sid' option.

id

This option can be used to specify the patch IDs of all the patches that are to be rolled back from the given GI/RAC home.

invPtrLoc

Used to locate the oraInst.loc file. Needed when the installation used the -invPtrLoc flag. This should be the path to the oraInst.loc file.

jre

This option tells OPatch to use JRE (java) from the specified location instead of the default location under GI/RAC home.

local_node

This option can be used to specify to OPatch the local node name to be used for RAC mode application of the patch.

oh

The GI/RAC home to work on. This takes precedence over the environment variable ORACLE_HOME.

ph

This option can be used to specify the path to the patch location. Example: /tmp/101010

phBaseDir

This option can be used to specify the path to the base directory where all the patches to be applied are kept. Note: The directory should contain only non-duplicate patches in zipped or unzipped format.

phBaseFile

This option can be used to specify complete path to the file containing the location of the patches to be applied.

property_file

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 is supplied with OPatch.

sid

This option can be used to specify the SIDs of the database instances. This option can be used only for local system operations.


A.12 util

The util command invokes the chosen utilities on an ORACLE_HOME. This command does not support System Patches.

Syntax

opatch util [ -help ] [ COMMAND ]

Run opatch util [ COMMAND ] -help to get help on a specific command.

Table A-12 util Commands

Option Description

CheckMinimumOpatchVersion

Check if a patch is compatible with the given OPatch version.

CheckComponents

Check if the given patch is suitable for the GI/RAC homes registered in the Central Inventory by components check.

Cleanup

Remove the backup for restore area of the given patch or for all the patches.

DisableOnlinePatch

Disable and remove the specified online patch(es) on the given database instances.

EnableOnlinePatch

Install and enable the specified online patch(es) on the given database instances.

GetPatchLevel

Return the patching level on Local Grid Home.

InstallOCM

Install and configure OCM.

LoadXML

Prompt for path/name of the XML file, then check if the XML is correct.

SaveConfigurationSnapshot

Save configuration snapshot of current GI home to specified file. ORACLE_HOME shall point to GI home. Default snapshot file is ORACLE_HOME/cfgtoollogs/opatch/sysconfig/configData.txt

UpdateOPatchVersion

Update the version of OPatch in the inventory of GI/RAC home.

Verify

Using the defined ORACLE_HOME and given patch location via -ph, the program will check to make sure the patch was applied to the ORACLE_HOME.Example: 'opatch util verify -ph /tmp/patchLoc'