Sunday, August 23, 2015

Attach 12.1.2 ORACLE HOME after clone

After an instance was cloned, 12.1.2 ORACLE HOME does not exist. I had to run a command to attach it.

$ echo $ORACLE_HOME
/u05/app/EBS/apps/tech_st/10.1.2

$ opatch lsinventory

Oracle Interim Patch Installer version 1.0.0.0.63
Copyright (c) 2009 Oracle Corporation. All Rights Reserved..

Oracle recommends you to use the latest OPatch version
and read the OPatch documentation available in the OPatch/docs
directory for usage. For information about the latest OPatch and
other support-related issues, refer to document ID 293369.1
available on My Oracle Support (https://myoraclesupport.oracle.com)

Oracle Home                : /u05/app/EBS/apps/tech_st/10.1.2
Oracle Home Inventory : /u05/app/EBS/apps/tech_st/10.1.2/inventory
Central Inventory          : /u05/app/oraEbsInventory
   from                          : /etc/oraInst.loc
OUI location                : /u05/app/EBS/apps/tech_st/10.1.2/oui
OUI shared library       : /u05/app/EBS/apps/tech_st/10.1.2/oui/lib/linux/liboraInstaller.so
Java location                : /u05/app/EBS/apps/tech_st/10.1.2/jre/1.4.2/bin/java
Log file location           : /u05/app/EBS/apps/tech_st/10.1.2/.patch_storage/<patch ID>/*.log

Creating log file "/u05/app/EBS/apps/tech_st/10.1.2/.patch_storage/LsInventory__06-26-2015_11-21-30.log"

Result:
LsInventory: OPatch Exception while accessing O2O

OPATCH_JAVA_ERROR  : An exception of type "OPatchException" has occurred:
OPatch Exception:  OUI found no such ORACLE_HOME set in the environment
  Can not get details for given Oracle Home
  An exception occurs
  null

There is no Interim Patch

OPATCH_JAVA_ERROR  : An exception of type "OPatchException" has occurred:
Can not get a list of inventory on this home.

ERROR: OPatch failed because of Inventory problem.

Check inventory.xml and also see the 10.1.2 ORACLE HOME has no entry in the file:
$ more /ebsu05/app/oraEbsInventory/ContentsXML/inventory.xml
<?xml version="1.0" standalone="yes" ?>
<!-- Copyright (c) 2002 Oracle Corporation. All rights Reserved -->
<!-- Do not modify the contents of this file by hand. -->
<INVENTORY>
<VERSION_INFO>
   <SAVED_WITH>10.1.0.6.0</SAVED_WITH>
   <MINIMUM_VER>2.1.0.6.0</MINIMUM_VER>
</VERSION_INFO>
<HOME_LIST>
<HOME NAME="EBS_WEBOH__u05_app_EBS_apps_tech_st_10_1_3" LOC="/u05/app/EBS/apps/tech_st/10.1.3" TYPE="O" IDX="1"/>
</HOME_LIST>
</INVENTORY>

Fix: run ./runInstaller to create ORACLE_HOME

First of all, make sure inventory location is correct:
$ vi /etc/oraInst.loc
inventory_loc=/u05/app/oraEbsInventory

$ cd $ORACLE_HOME/oui/bin
$ echo $ORACLE_HOME
 /u05/app/EBS/apps/tech_st/10.1.2
$ ./runInstaller -silent -attachHome ORACLE_HOME=/u05/app/EBS/apps/tech_st/10.1.2 ORACLE_HOME_NAME=EBS_1012_home

Starting Oracle Universal Installer...
No pre-requisite checks found in oraparam.ini, no system pre-requisite checks will be executed.
Preparing to launch Oracle Universal Installer from /tmp/OraInstall2015-06-26_11-39-13AM. Please wait ...
$ 'AttachHome' was successful.
$

Now, check file /u05/app/oraEbsInventory/ContentsXML/inventory.xml again, it should have two entries. And also "$ opatch lsinventory" works!

Similarly steps can attach a 10.1.3 ORACLE_HOME in EBS R12.1:

$ cd $INST_TOP/ora/10.1.3
$ ls
$ . TWO_TASK_nodename.env
$ echo $ORACLE_HOME
/u05/app/EBS/apps/tech_st/10.1.3
$ cd $ORACLE_HOME/oui/bin
$ ./runInstaller -silent -attachHome ORACLE_HOME=/u05/app/EBS/apps/tech_st/10.1.3 ORACLE_HOME_NAME=EBS_WEBOH_10_1_3_HOME
Starting Oracle Universal Installer...
No pre-requisite checks found in oraparam.ini, no system pre-requisite checks will be executed.
Preparing to launch Oracle Universal Installer from /tmp/OraInstall2020-11-07_11-42-25AM. Please wait ...
$ 'AttachHome' was successful.


NOTES:
1. if you get a error, like "Please wait ...The Java RunTime Environment was not found at /tmp/OraInstall2015-06-26_11-23-23AM/jre/bin/java", modify one line in oraparam.ini

  $ vi oraparam.ini   (under $ORACLE_HOME/oui  10.1.2 OH)
        # JRE_LOCATION=%JRE_LOCATION%
        JRE_LOCATION=../../jdk/jre                           #  <-- actual path is $ORACLE_HOME/jdk/jre

2. I tried " ouicli.pl " recommended in "How To Create, Update or Rebuild The Central Inventory For Oracle Applications E-Business Suite (Doc ID 742477.1)". But it failed to add one entry to inventory.xml and so does not attach 10.1.2 Oracle Home for unknown reason.

3. If need to detach an ORACLE_HOME from central inventory, see Don ID 417694.1:
./runInstaller -silent -detachHome ORACLE_HOME="<path_to_Oracle_Home>"
If above line fails, you "have to consider building a separate central inventory for this Oracle Home".

No comments: