                             OPATCH FAQ
             Copyright (c) Oracle Corporation 2002, 2003

General Questions:

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

	'opatch query -all' will allow you to query detailed information about a patch.
	'opatch lsinventory' will list all patches with the applied date chronologically.
	'opatch lsinventory -detail' will list all patches and which files were modified.

	Below is the output of 'lsinventory -detail':

  	Installed Patch List:
  	=====================
  	1) Patch 1 applied on Wed Jul 23 12:50:33 PDT 2003
      	[ Base Bug(s): 1  ]
      	/private/phi_local/OraHome2/lib/NewClass.class -->  OH/lib
      	/private/phi_local/OraHome2/lib/xsu111.jar -->  OH/lib
      	oracle/xml/sql/Foo.class --> /private/phi_local/OraHome2/lib/xsu12.jar
      	oracle/xml/sql/XSUMesg.class --> /private/phi_local/OraHome2/lib/xsu12.jar
      	oracle/xml/sql/Foo.class --> /private/phi_local/OraHome2/lib/xxx.jar

	
	It shows that:
		Patch 1 was applied on July 23, 2003 at 12:50
		NewClass.class was copied to OH/lib
		xsu111.jar was copied to OH/lib
		Foo.class was updated to xsu12.jar
		XSUMesg.class was updated to xsu12.jar
		Foo.class was also updated to xxx.jar


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 there is no specific place for OPatch to reside.
	The perl scripts and Java code have been written to be relocatable.
	The can exist anywhere on your system.

	Some people prefere to keep a copy in each $ORACLE_HOME, others
	prefer to keep a central copy. Some download it each time given
	it's small size.

Q4.     When applying a patch what does it mean when I get the message
	"Not a valid patch area." and what can I do about it?

	This simply means the directory OPatch is using to find the
	patch doesn't match the template for what it's checking for.
	Normally your running OPatch on directory out from where you
	think you are.

	When starting OPatch the directory needs to have:

	a. a directory .../etc that has the files that drive OPatch,
	b. a directory .../files that has patches for the files, and
	c. the directory should have the same name as patch id.

	The third point can be confirmed by the file:
		.../<patch_id>/etc/config/inventory
	which is an XML file. The second line of the file has the
	XML tag "reference_id number" and this number is the patch_id.

	If you didn't start OPatch from the directory <patch_id> then
	you can tell OPatch where to look for this directory by giving
	the directory as the last argument to "apply", i.e.

		opatch apply /tmp/<patch_id>

        Another cause is your patch directory is not a number.  Some
        patches p.zip, when being unzipped, creates directory p1234.
        You probably need to remove the prefix 'p' and have only
        number for the directory (this is the patch id).  Make sure
        that the number is the same as the number listed in the file
        1234/etc/config/inventory as 'reference_id number="1234"'   
      

Q5.     When applying a patch I got the following error: 
        "The errors encounted were:
         Couldn't create file for the make commands. 
         Error is: Permission denied"

        This means you do not have write permission to the patch
        area itself.

Q6.    When applying a patch I got the following error:
       "Exception in thread "main" java.lang.NoClassDefFoundError: O2O"

       This means OPatch can not find the O2O.class which is supposed
       to be located under .../jlib.  Check if you have the O2O.class
       file there.  Another reason is you might have ftp'ed OPatch
       *not* using binary mode.

Q7.    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.
  
Q8.    When applying a patch I got the following error:
       "OPatch can't find command 'fuser'"

       OPatch uses 'fuser' on Unix to check for active Oracle instances.
       On certain HP-UX, only super-user can run 'fuser'. 

       There are 2 ways to work around this problem: 
       1) Set /tmp first on your PATH.  Create a script 'fuser' which
       does nothing.  Make sure you shut down Oracle instances.  Then
       run OPatch.
       2) Be super-user and give executable permission to 'fuser' to
       other users.  Please be advised that this work-around exposes
       potential security hole in your system.  Use at your own risk. 

       HP has been notified about the problem and may change 'fuser'
       settings in their future release of HP-UX.

Q9.    -oh option does not seem to work

       Please set the ORACLE_HOME environment varirable instead and 
	 try OPatch again. 

Q10.   -report option does not seem to work

       -report option is not implemented yet.

Q11.   Where can I find info. about patch 123 that I applied last year?

       Look at the file $ORACLE_HOME/.patch_storage/<patch>/inventory.
	 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.

Q12.   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.  For example,
       "setenv ORACLE_HOME /tmp" would be good.   


Q13.	Why do I get the message:
	" Exception in thread "main" java.lang.NullPointerException
	  at XXX.main..."
	
	Make sure that if your ORACLE_HOME was installed with -invPtrLoc, 
	then you have to supply -invPtrLoc when invoking Opatch.

Q14.	How do I find out what values for ORACLE_HOME are valid?

	Use the command "lsinventory -all" to get a list of all recorded
	ORACLE_HOME entries.


Q15.	How can I to 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.

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

	The local node is always patched first. This is used a base to
	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.

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


Q19.    Why does OPatch keep saying "This is not a RAC system"?

       OPatch currently uses some APIs to detect if the system is RAC.
       The most common problem causing the APIs to fail is because
       of the library path not being set correctly as described in
       Q5. above.

       For example: 
       Solaris
         LD_LIBRARY_PATH = $ORACLE_HOME/lib32:$ORACLE_HOME/lib

       HP-UX
         SHLIB_PATH=$ORACLE_HOME/lib32:/usr/lib
 

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

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

Q22.	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. This means another patch cannot be applied until the 
	process is restarted and all nodes are patched or the partially 
	applied patch is rolled back.

Q23.	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 rollback the partially 
	applied patch. If the user tries to apply a partially
	rolledback patch manual intervention will be needed to fix
	the state of the system.

Q24.	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
	rollback process needs to finish before applying another
	patch or reapplying the same patch.

Q25.  ERROR: Interim inventory update exception...
	Files on system are patched but Inventory Update has failed.  
	Please run 'opatch lsinventory' to check if the patch has been recorded in Inventory.

	The above message means that files on your system are patched but the inventory update
	has failed.  Therefore, it's very likely that 'opatch lsinventory' will not show the
	patch.  If you want to roll back the patch, please invoke the shell script 
	$ORACLE_HOME/.patch_storage/<patch>/rollback_<patch>.sh.

	There are many possible causes.  The most common ones are:

	1)The patch refers to a component X which needs a base component Y.  And your
	ORACLE_HOME inventory does not have that component Y or has Y not at a 
	desired version level.  If this is the case, you can run 'lsinventory', then look
	at the file <patch>/etc/config/actions and <patch>/etc/config/inventory to check
	for required components and their versions.

	2)ORACLE_HOME is 9.2.0.1 which has been updated to 9.2.0.2, then 9.2.0.3.
	and/or you have OUI pre 2.2.18 version.  If this is the case, please upgrade
	to OUI 2.2.18 and try the patch again.



==========================================================================
