Search This Blog

Tuesday, December 20, 2016

How to attach db oracle home to central inventory?


Summary :

I was getting the error below when i tried the check lsinventory. It is due to oracle home was not registered with the central inventory. We are having solaris servers and we can find the inventory location through $ORACLE_HOME/oraInst.loc or /var/opt/oracle/oraInst.loc.


bash-3.2$ /d02/DEV/oratest/11204/OPatch/opatch lsinventory
Oracle Interim Patch Installer version 11.2.0.3.15
Copyright (c) 2016, Oracle Corporation.  All rights reserved.


Oracle Home       : /d02/DEV/oratest/11204
Central Inventory : /var/opt/oracle/oraInventory
   from           : /d02/DEV/oratest/11204/oraInst.loc
OPatch version    : 11.2.0.3.15
OUI version       : 11.2.0.4.0
Log file location : /d02/DEV/oratest/11204/cfgtoollogs/opatch/opatch2016-12-19_14-25-29PM_1.log

List of Homes on this system:

  Home name= OH375238208, Location= "/d02/DEV/appltest/fs2/FMW_Home/oracle_common"
  Home name= OH6845398, Location= "/d02/DEV/appltest/fs2/FMW_Home/webtier"
  Home name= OH639747260, Location= "/d02/DEV/appltest/fs2/FMW_Home/Oracle_EBS-app1"
  Home name= DEV_TOOLS__d02_DEV_appltest_fs2_EBSapps_10_1_2, Location= "/d02/DEV/appltest/fs2/EBSapps/10.1.2"
LsInventorySession failed: RawInventory gets null OracleHomeInfo

OPatch failed with error code 73


From the error message we can find out that current running oracle home '/d02/DEV/oratest/11204' was not listed in the inventory.

Below log will give your more info on the registered oracle homes in the invetory.

 vi /d02/DEV/oratest/11204/cfgtoollogs/opatch/opatch2016-12-19_14-25-29PM_1.log
"/d02/DEV/oratest/11204/cfgtoollogs/opatch/opatch2016-12-19_14-25-29PM_1.log" 31 lines, 2853 characters
[Dec 19, 2016 2:25:30 PM]    OUI exists, the oraclehome is OUI based.
[Dec 19, 2016 2:25:30 PM]    OUI exists, the oraclehome is OUI based.
[Dec 19, 2016 2:25:30 PM]    OPatch invoked as follows: 'lsinventory -invPtrLoc /d02/DEV/oratest/11204/oraInst.loc '
[Dec 19, 2016 2:25:30 PM]    OUI-67077:
                             Oracle Home       : /d02/DEV/oratest/11204
                             Central Inventory : /var/opt/oracle/oraInventory
                                from           : /d02/DEV/oratest/11204/oraInst.loc
                             OPatch version    : 11.2.0.3.15
                             OUI version       : 11.2.0.4.0
                             OUI location      : /d02/DEV/oratest/11204/oui
                             Log file location : /d02/DEV/oratest/11204/cfgtoollogs/opatch/opatch2016-12-19_14-25-29PM_1.log
[Dec 19, 2016 2:25:30 PM]    Patch history file: /d02/DEV/oratest/11204/cfgtoollogs/opatch/opatch_history.txt
[Dec 19, 2016 2:25:30 PM]    Starting LsInventorySession at Mon Dec 19 14:25:30 AST 2016
[Dec 19, 2016 2:25:31 PM]    List of Homes on this system:

                               Home name= OH375238208, Location= "/d02/DEV/appltest/fs2/FMW_Home/oracle_common"
                               Home name= OH6845398, Location= "/d02/DEV/appltest/fs2/FMW_Home/webtier"
                               Home name= OH639747260, Location= "/d02/DEV/appltest/fs2/FMW_Home/Oracle_EBS-app1"
                               Home name= DEV_TOOLS__d02_DEV_appltest_fs2_EBSapps_10_1_2, Location= "/d02/DEV/appltest/fs2/EBSapps/10.1.2"
[Dec 19, 2016 2:25:31 PM]    OUI-67073:LsInventorySession failed: RawInventory gets null OracleHomeInfo
[Dec 19, 2016 2:25:31 PM]    Finishing LsInventorySession at Mon Dec 19 14:25:31 AST 2016
[Dec 19, 2016 2:25:31 PM]    Stack Description: java.lang.RuntimeException: RawInventory gets null OracleHomeInfo
[Dec 19, 2016 2:25:31 PM]    StackTrace: oracle.opatch.ipm.RawInventory.loadRawInventory(RawInventory.java:207)
[Dec 19, 2016 2:25:31 PM]    StackTrace: oracle.opatch.ipm.RawInventory.init(RawInventory.java:171)
[Dec 19, 2016 2:25:31 PM]    StackTrace: oracle.opatch.ipm.RawInventory.getInstance(RawInventory.java:87)
[Dec 19, 2016 2:25:31 PM]    StackTrace: oracle.opatch.ipm.IPMReadServices.getRawInventory(IPMReadServices.java:149)
[Dec 19, 2016 2:25:31 PM]    StackTrace: oracle.opatch.ipm.IPMReadServices.loadInventory(IPMReadServices.java:1031)
[Dec 19, 2016 2:25:31 PM]    StackTrace: oracle.opatch.LsInventorySession.process(LsInventorySession.java:317)
[Dec 19, 2016 2:25:31 PM]    StackTrace: oracle.opatch.OPatchSession.process(OPatchSession.java:2042)
[Dec 19, 2016 2:25:31 PM]    StackTrace: oracle.opatch.OPatch.process(OPatch.java:796)
[Dec 19, 2016 2:25:31 PM]    StackTrace: oracle.opatch.OPatch.main(OPatch.java:846)

To check the registered oracle homes within the central inventory, please check the inventory.xml file below.

cd /var/opt/oracle/oraInventory/ContentsXML/

open inventory.xml 

Below are the steps to register oracle home with central inventory.

bash-3.2$ cd $ORACLE_HOME/oui/bin

Make sure you have sourced the env file or provide entire oracle home location in the ORACLE_HOME variable.

bash-3.2$ ./runInstaller -silent -attachHome -invPtrLoc /var/opt/oracle/oraInst.loc
ORACLE_HOME=$ORACLE_HOME ORACLE_HOME_NAME=ORAHOME11Gr23


Starting Oracle Universal Installer...

Checking swap space: must be greater than 500 MB.   Actual 45917 MB    Passed
The inventory pointer is located at /var/opt/oracle/oraInst.loc
The inventory is located at /var/opt/oracle/oraInventory
/var/opt/oracle/oraInventory/ContentsXML/inventory.xml (Permission denied)
'AttachHome' failed.

bash-3.2$ ll /var/opt/oracle/oraInventory/ContentsXML/inventory.xml

bash-3.2$ ls -ltr /var/opt/oracle/oraInventory/ContentsXML/inventory.xml
-rw-r-----   1 appltest oinstall     984 Dec 15 16:17
/var/opt/oracle/oraInventory/ContentsXML/inventory.xml

bash-3.2$ ls -ltr /var/opt/oracle/oraInventory/ContentsXML/inventory.xml
-rwxrwxrwx   1 appltest oinstall     984 Dec 15 16:17

/var/opt/oracle/oraInventory/ContentsXML/inventory.xml

It was a permission issue. After granting required permissions i was to able to register oracle home with the central inventory successfully.

bash-3.2$ ./runInstaller -silent -attachHome -invPtrLoc /var/opt/oracle/oraInst.loc ORACLE_HOME=$ORACLE_HOME ORACLE_HOME_NAME=ORAHOME11Gr23
Starting Oracle Universal Installer...

Checking swap space: must be greater than 500 MB.   Actual 45917 MB    Passed
The inventory pointer is located at /var/opt/oracle/oraInst.loc
The inventory is located at /var/opt/oracle/oraInventory
'AttachHome' was successful.

After this i was able to query the lsinventory successfully without any issue.

Thanks!

1 comment:

  1. Sikky,

    Thanks a ton for sharing.I will try this.
    Can we do the same process for grid home also?pls advice

    Thanks,
    Satish

    ReplyDelete

You cannot complete this task because one of the following events caused a loss of page data: A system failure has occurred "Front end is locked after 12.2 upgrade"

  If you have upgraded to Oracle E-Business Suite 12.2.10 Release Update Pack from Oracle E-Business Suite 12.2.6 Release Update Pack (or ea...