                          OPatch Frequently Asked Questions
 Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved. 

General Questions:

Q1.	What are some of the new options in OPatch?

        '-property_file' is a new option available for 'opatch apply' 
        and 'opatch rollback' operations. This option can be used to 
        provide the user defined property file, giving details like 
        the path to system commands like 'fuser', 'cp', etc...

Q2.	What does:
	" Exception in thread "main" java.lang.UnsatisfiedLinkError:
	no oraInstaller in java.library.path" mean?

	This is a unix specific issue.

	The most frequent reason for this is the liboraInstaller shared
        object file cannot be located at run time. The extension is
	".so" for most systems, ".sl" for most other systems. It means
	LD_LIBRARY_PATH (or SHLIB_PATH, LIBPATH, DYLD_LIBRARY_PATH or
	it's equivalent) doesn't include a path to liboraInstaller file.

	The file is located under the "oui" hierarchy (normally under
	oui/bin/<plaform name>, like oui/bin/solaris). The "oui" directory
	should be in the same directory as the oraInventory directory that 
	is pointed to by the oraInst.loc file.  

Q3.	Where does OPatch officially reside?

        Currently, OPatch resides in $ORACLE_HOME/OPatch. 
  	Some people prefer to keep a central copy. Some download it 
        each time given it's small size.


Q4.    When applying a patch I got the following error:
       "sh: ar: not found"

       This means that the patch involves archiving a file, and OPatch
       can not find the executable "ar" in your PATH.  Reset your PATH
       and try OPatch again.
  
Q5.    Where can I find info. about patch 123 that I applied last year?

       If the patch is not rolled back, then look at the files in
       $ORACLE_HOME/inventory/oneoffs/<patch>. It has info. about the 
       patch such as bugs fixed and bugs descr. You can also use 
       'opatch lsinventory -detail' to see which files had been 
       modified by the patch.

       A copy of original patch will be kept in 
       $ORACLE_HOME/.patch_storage/<patchID>/original_patch
       Whether the patch is rolled back or not, you can get the 
       information from here also.

Q6.    I just want to run 'opatch version' and 'opatch help', but
       OPatch keeps prompting for ORACLE_HOME as follow:
       "Please enter the location for ORACLE_HOME"

       If you just want to get opatch version and help text, you
       can set ORACLE_HOME to any directory containing jdk in it.
       For example,
       If /tmp has jdk in it i.e /tmp/jdk exists, then
       "setenv ORACLE_HOME /tmp" would be good.   

Q7.	How can I minimize the downtime when applying a patch to my RAC?

	The short answer is to use the "-minimize_downtime" flag to the 
	"apply" command and follow the prompts.

Q8.	How does the "-minimize_downtime" flag work?

	The local node is always patched first. This is used as a base
	to patch the other nodes. The user is prompted for the list of
	nodes to patch first out of the remaining nodes. For each node in
	this first list the user is asked to stop the instance and then
	the patch is propagated to that node before continuing to the 
	next node. 

	When the initial group of nodes has been patched the user is asked
	to bring down the remaining nodes. When this is done the patch is
	propagated to this last group and the inventory is updated.

	
Q9.	What is the difference between "rolling RAC" and "minimum downtime"?

	With a normal patch the system resources being used need to be
	released. This means stopping the instance of the database. When
	using the minimum downtime argument it reduces the time the data
	base is inaccessable. This can be specified on the command line.

	In rolling RAC the instantance on one node is inactive. This is 
	for the node to be patched. It can then be activated again. This
	means there a mixture of patched and unpatched nodes operating
	together. A patch is issued by Oracle as being rolling RAC
	installable. There is no command line argument for this feature.

Q10.	What is a rolling RAC patch and how do I enable it?

	Rolling RAC patching allows the interoperation of a patched
	node and an unpatched node simultaneously. This means only one
	node is out of commission while it is patched.

	This cannot be enabled from the command line. Oracle supplies
	a patch that is recognized as being suitable for rolling RAC.

	To test if a patch is a rolling patch, you can use 'opatch query -all'

Q11.	What is the basic actions that happen when applying a rolling
	RAC patch?

	The user is prompted to stop the instances on the node to be
	patched. First the local node is patched and its inventory is 
        updated, then the user is asked for the next node to patch from 
        a list. As each node is patched the user is prompted when it is 
        safe to restart the patched node.

	The cycle of prompt for a node, stop the instances on the node,
	patch the node and restarting the instances continues until 
	stopped by the user or all nodes are patched.

Q12.	Is it possible to stop applying a patch after applying it to
	a few nodes and what are the issues?

	Yes, it is possible to interrupt the process. 

	There is a prompt that allows the user to stop applying the 
	patch. However, since only some of the node are patched, if the user 
        wants to apply the patch to other nodes as well, then he has to start
        the operation from an un-patched node and use -remote_nodes option to 
        specify the nodes to which the patch has to be propogated.
        If you want to rollback the patch, then use -remote_nodes option to 
        specify the nodes on which the patch has to be rollbacked.

Q13.	Is there a limit to partially applying a patch and then 
	rolling it back and what are the issues?

	There is a limit. The locking mechanism only allows you to
	partially apply a patch and then user has to run the restore.sh
        script to manually restore the system. User will not be able to 
        re-apply the patch before restoring the system.

Q14.	Can rollback be interrupted?

	Yes, rolling back a patch can be stopped after any node in
	the same way applying a patch can be stopped. However the
	system has to be restored using restore.sh back before 
        applying another patch or reapplying the same patch.


Q15.    When I apply a patch I get an error that reads 
        "Failed to load the patch object. 
        Possible causes are: The specified path is not an interim 
        patchshiphome. Meta-data files are missing from the patch area ". 
        What do I do?

        This simply means the directory OPatch is using to find the patch 
        doesn't match the template it is checking for. 
        For more information on this error, refer to section "Not a
        valid patch area" on page 8-30 of OPatch User Guide.

Q16.    When I apply a patch I get an error that reads 
        "Syntax error.....Patch location not valid". What do I do?

        This simply means that the patch location that you specified is an 
        invalid one. Give the correct patch location and apply the patch again.

	The patch should have the following directory structure.

        <Patch Shiphome>
           |
           |
            -- etc
           |    |
           |     - config
           |    |
           |     - xml
           |
           |
            -- files
           |
           |
            -- custom
                 |
                  - scripts

	a. A directory <patch shiphome>/etc that has the files that drive OPatch
	b. A directory <patch shiphome>/files that has patches for the files
	c. An optional directory <patch_shiphome>/custom that contain the 
           pre/post scripts.

      
Q17.    When I apply a patch I get an error that reads "Exception in thread "main"
        java.lang.NoClassDefFoundError: <Class Name>". What do I do?

        This may be due to OPatch not able to find the particular class 
        listed in the error, which is supposed to be located inside 
        $ORACLE_HOME/OPatch/jlib/opatch.jar file. Check if you have the
        particular class file there. To check this, execute the following 
        command; the missing class file will be printed out:

        cd $ORACLE_HOME/OPatch/jlib
        jar tf opatch.jar <Class File Name>.class
        
        It is recommended that you contact Oracle support when you encounter 
        this error.

        Another reason might be having done a file transfer of OPatch in a 
        non-binary mode. 

Q18.    When I apply a patch, I get an error that reads "OPatch cannot find the 
        required command ar from Property file and your PATH". What do I do?

        ar is a command used by OPatch. This message may appear if OPatch
        is not able to locate this command. For more details and workaround 
        for this problem, refer to section "OPatch cannot find system commands
        like fuser, make" on page 8-31 of OPatch User Guide.

Q19.    When I apply a patch, I get an error that reads "OPatch cannot find 
        the required command fuser from Property file and your PATH". 
        What do I do?

        fuser is a command used by OPatch. This message may appear if OPatch 
        is not able to locate this command. For more details and workaround for
        this problem, refer to section "OPatch cannot find system commands like
        fuser, make" on page 8-31 of OPatch User Guide.

    
Q20.    Can I run patching in scripted mode?
 
        Yes, it is possible by using the command opatch <option> -silent. 
        For more information, refer to section "Operations and Options in OPatch
        Utility" on page 8-10 of OPatch User guide.

Q21.    Before applying a patch I want to know what is the impact of the patch?

        You can use the command opatch <option> -report. For more information, refer
        to section "Operations and Options in OPatch Utility" on page 8-10 of OPatch
        User Guide.

Q22.    What versions of OPatch can I use with Oracle Universal Installer 10.2?
        
        Oracle recommends using OPatch version 10.2 from the Oracle home with
        Oracle Universal Installer 10.2. Also note that OPatch is compatible 
        only with the version of Oracle Universal Installer that is installed 
        in the Oracle home.

Q23.    When I apply a patch, I get an error that reads as follows:
        "OPatchSession cannot load inventory for the given Oracle Home <Home_Location>.
        Possible causes are:
        No read or write permission to ORACLE_HOME/.patch_storage
        Central Inventory is locked by another OUI instance
        No read permission to Central Inventory
        The lock file exists in ORACLE_HOME/.patch_storage
        The Oracle Home does not exist in Central Inventory"
        What do I do?

        This error may occur because of any one or more of the following reasons:
        1. The ORACLE_HOME/.patch_storage may not have read/write permissions.
           Ensure that you give read/write permissions to this folder and apply
           the patch again.
        2. There may be another Oracle Universal Installer instance running. Stop
           it and try applying the patch again.
        3. The Central Inventory may not have read permission. Ensure that you give
           read permission to the Central Inventory and apply the patch again.
        4. The ORACLE_HOME/.patch_storage directory might be locked. If this directory
           is locked, you will find a file named patch_locked inside this directory.
           This may be due to a previously failed installation of a patch. To remove
           the lock, restore the Oracle home and remove the patch_locked file from
           the ORACLE_HOME/.patch_storage directory.    
           For more information on restoring the Oracle home, refer to section 
           "Restoring Oracle Homes" on page 8-23 of OPatch User Guide.
        5. The Oracle home may not be present in the Central Inventory. This may 
           be due to a corrupted or lost inventory or the inventory may not be 
           registered in the Central Inventory. For more information, refer to section
           "Diagnosing and Recovering from Central Inventory Corruption" on page 3-10.
           of OPatch User Guide.

Q24.    In 10.2 ORACLE_HOME, I don't have a directory called "filemap" under 
        ORACLE_HOME/inventory. Where does OPatch keep the information about
        files touched by each installed oneoff?

        In 10.2 and later versions, all information about each oneoff applied is 
        kept in the inventory as simple XML files and not dispersed across the 
        filemap (which replicated the ORACLE_HOME directory structure). 
        These XML files are kept under ORACLE_HOME/inventory/oneoffs/<patchID>.
        Please refer to 10.2 Universal Installer and OPatch Guide for details. 

Q25.    In 10.2 ORACLE_HOME, the comps.xml does not have complete information about
        each oneoff installed. Why is that so?

        10.2 onwards all the information about each oneoff is kept in separate XML
        files. The comps.xml will just have information about the patch ID and the
        bugs fixed by the oneoff. All the other information is kept in XML files 
        located under ORACLE_HOME/inventory/oneoffs/<patchID>.

Q26.    I see some patch verification being done during apply, but the same
        does not happen during rollback. Why?

        Yes, during application of the oneoff patch, after the inventory
        updation the inventory and file system is checked to confirm that all
        the required changes are made. This is a step which confirms the proper
        patch application.
        But the same thing is not done during rollback, because during rollback
        OPatch does not have a target to be compared against.


Q27.    In a RAC Setup, if -remote_nodes is given with a list of nodes to be patched
        and the RAC Setup results in a set of nodes greater than the list,how would 
        OPatch behave?

        OPatch when invoked with -remote_nodes option works only on those nodes 
        specified and it will not do any detection to determine the actual nodes 
        of the RAC. Using this option can lead to inconsistent patch level between 
        different nodes. Please read the OPatch User's Guide to find the exact usage 
        of this option.



Q28.	When OPatch does verification of the files patched, it gives some verification
	failure messages for actions after apply and this is specific to some platform(s).
	The same failure does not occur in some other platform(s). Why?

	In some platforms, a few bytes are added to files and hence, OPatch detects
	verification failure. From 10.2.0.3 onwards, OPatch provides an OPatch property
        variable OPatch.SKIP_VERIFY_PLATFORM  which could be set with a platform id as
        'OPatch.SKIP_VERIFY_PLATFORM=<id>'. This can be given in the command line when
        'apply' is invoked. If verification failure occurs, OPatch would check this
        id. If the id matches current platform, OPatch would give a warning message and
        would not attempt to restore ORACLE_HOME.
        The syntax to give this property is:
        "opatch apply <patch_location> OPatch.SKIP_VERIFY_PLATFORM=<platform_id_value>"

        Ex : opatch apply /scratch/home/4563443 OPatch.SKIP_VERIFY_PLATFORM=46

======================================================================================
Modified  06/21/06
