                            OPATCH PREREQUISTE USERS GUIDE
                         Copyright (c) Oracle Corporation 2005

INTRODUCTION
------------

OPatch Prerequisite is a Java based utility that allow users to run prerequisite
checks before applying or rolling back the patch so that if any prereqs fail, 
then a suitable action be taken so that the chances of OPatch failing in its 
operation is very unlikely.

This utility is an integrated part of OPatch and will not be available as an 
independent utility or can run without OPatch.

Help given below explains in detail the commands and the options available.


ENVIRONMENT VARIABLES
---------------------

ORACLE_HOME:
       This variable must point to a valid Oracle Home and matches the value
       when that Oracle Home was installed.

OPATCH_DEBUG:
       Setting this variable to "true" sets the log level to debug.

OPATCH_PLATFORM_ID:
       OPatch has its own mechanism of finding the platform ID. If this
       variable to set to some numeric value, then OPatch skips its mechanism
       and assumes the platform ID to be the one specified here.

   NOTE: 
   -----
   The above given Environment variables can be used when the prereqs are
   invoked from OPatch. If the prereqs are run from 'runInstaller' or J2EE based
   OPatch Prereq Application (see Section "RUNNING OPATCH PREREQS FROM OTHER TOOLS"
   below), then these env. variables will not be effective.


SYNOPSIS
--------

< perl > < opatch > < opatch command > < sub-command > [ < command_arguments > ]

where:

    perl:               A version of perl. The version must be 5.005_03 or
                        greater but 5.6 or greater is recommended.
    opatch:             The path to the opatch program.
    opatch command:     The command opatch should invoke.
    sub-command:        The function the opatch command should do.
    command_arguments:  Any arguments supported by the sub-command.


DETAILS
-------
DESCRIPTION
    This operation runs the prerequisite checks on an ORACLE_HOME.

SYNTAX
opatch prereq <command> [-invPtrLoc <Path to oraInst.loc> ]
                        [-jre <LOC> ] [-oh <ORACLE_HOME> ]
                        [-property_file <Path to property file>]
                        [-local_node <Local node name>]
                        [-remote_nodes <List of remote nodes (node1,node2)>]
                        [-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>]
                        [-id <Comma separated list of patch IDs>]

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

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

       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.

       CheckOUILocation
              Check the ORACLE_HOME for the presence of OUI.

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

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

       CheckUserAdminPrivilege
              Check is the user is 'root'.
              Note: OPatch should not be invoked by 'root', if so
                    then this check fails.

       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 Oracle Home.

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

       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.

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

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

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

       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.

       CheckRollbackable
              Check if the given patch(es) can be rollbacked from
              the ORACLE_HOME.

       CheckConflictAmongPatches
              Check if there are any conflicts among the patches
              to be applied.

       CheckConflictAmongPatchesWithDetail
              Check if there are any conflicts among the patches
              to be applied, by giving out the detailed information
              about the conflicts/supersets.

       CheckConflictAgainstOH
              Check if there are any conflicts between the patches
              to be applied and the patches in the OH.

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

       CheckRACNodeList
              Check if all the nodes in the RAC setup are valid, up
              and reachable.

       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.

       CheckForCRSHomeIfRAC
              Check if the given Central Inventory has a CRS Home
              registered with it, if it is a RAC setup.

       CheckPatchApplyDependents
              Check if all the patches required by the patch currently being
              installed is present in the Oracle Home or not.

       CheckPatchRollbackDependents
              Check if there are any patches in the Oracle Home that are
              depending on the patch being currently rolled back.

       CheckStandAloneHome
              Check if the Oracle Home is a stand-alone home or a
              normal oui-based home.

       CheckApplicableProduct
              Check if the patch is applicable for the given Oracle 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.

       CheckProductXMLPresence
              Check if the product.xml is present under $ORACLE_HOME
              ($ORACLE_HOME/product.xml)

       CheckProductXMLValidity
              Check if the product.xml present is valid or invalid.

       CheckPatchInventoryProductMatch
              Check if there is a match between ORACLE_HOME/product.xml
              {product, version} and that of patch's product list in
              its inventory.

OPTIONS
       -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 Oracle Home.

       -oh
              The oracle home to work on. This takes precedence over
              the environment variable ORACLE_HOME.

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

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

       -remote_nodes
              This option can be used to specify to OPatch the list
              of remote nodes to be used for RAC mode application of
              the patch. The node names are comma separated and
              without spaces.

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

       -phBaseDir
              This option can be used to specify the path to base dir
              where all the patches to be applied are kept.

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

       -id
              This option can be used to specify the patch IDs of all
              the patches that are to be rollbacked from the given OH.


RUNNING OPATCH PREREQS FROM OTHER TOOLS
---------------------------------------

RUNNING FROM OUI RUNINSTALLER
-----------------------------
OPatch Prereqs can be invoked from OUI RunInstaller. This enables the user
to run a group of checks and also the prereqchecker framework of runInstaller
provides a good user interface.

To run OPatch prereqs from runInstaller, you need to have the latest OUI 10.2


SYNOPSIS
--------

<path to runInstaller> < command > < session_variables > [< command_arguments >]

where,
     path to runInstaller: Complete to the runInstaller.
     command:              Command to the runInstaller to run.
     session_varirables:   Values of various variables.
     command_arguments:    Arguments for the commands invoked.



DETAILS
-------

DESCRIPTION
   This operation runs the specified group of OPatch prerequisite checks on
   the given ORACLE_HOME.


SYNTAX
   runInstaller -prereqchecker <session_variables> 
                                     [-entryPoint <group of prereqs to run> ]
                                     [-invPtrLoc <path to oraInst.loc> ]
                                     [-silent]

SESSION VARIABLES

   PREREQ_CONFIG_LOCATION
            Location of the directory where all the prereqs are kept.

   ORACLE_HOME
            Path to Oracle Home on which the prereqs has to be run.

   OPATCH_PATCH_LOCATION
            Path to the patch. Ex: /tmp/101010

   OPATCH_PATCH_BASE_DIR
            Path to the directory containing all the patches to be applied.
            Ex: /tmp/patches

   OPATCH_PATCH_BASE_FILE
           Path to the file containing the location of the patches to be
           applied. Ex: /tmp/patch_locs.txt

   OPATCH_PATCH_ID
           Patch IDs(comma separated) of the all the patches to be rolled back.
           Ex: 101010,101020,101033

   OPATCH_REMOTE_NODES
           Remte nodes of the RAC on which the RAC checks has to be run.
           Ex: host1,host2

ENTRY POINTS
The following entry points have be provided, each entry point performs a group
of prereq checks.

   oracle.opatch.apply
           Run opatch prereq checks related to apply operation.

   oracle.opatch.rollback
           Run opatch prereq checks related to rollback operation.

   oracle.opatch.rac
           Run RAC prereq checks.

   oracle.opatch.conflict
           Run prereq checks to determine the superset/subset/conflicts among
           the patches provided and also with the patches present in the given
           ORACLE_HOME.

USAGE EXAMPLES

1) Running apply checks
runInstaller -prereqchecker PREREQ_CONFIG_LOCATION=
$ORACLE_HOME/OPatch/opatchprereqs ORACLE_HOME=$ORACLE_HOME
OPATCH_PATCH_BASE_DIR=/tmp/patches_tobe_applied -entryPoint oracle.opatch.apply

2) Running rollback checks
runInstaller -prereqchecker PREREQ_CONFIG_LOCATION=
$ORACLE_HOME/OPatch/opatchprereqs ORACLE_HOME=$ORACLE_HOME
OPATCH_PATCH_ID=101010,101020 -entryPoint oracle.opatch.rollback

3) Running conflice checks
runInstaller -prereqchecker PREREQ_CONFIG_LOCATION=
$ORACLE_HOME/OPatch/opatchprereqs ORACLE_HOME=$ORACLE_HOME
OPATCH_PATCH_BASE_DIR=/tmp/patches_tobe_applied -entryPoint oracle.opatch.conflict

4) Running RAC checks
runInstaller -prereqchecker PREREQ_CONFIG_LOCATION=
$ORACLE_HOME/OPatch/opatchprereqs ORACLE_HOME=$ORACLE_HOME 
-entryPoint oracle.opatch.rac


=========================================================================
Modified  10/17/05

