You are on page 1of 60

Copyright 2014, Oracle and/or its affiliates. All rights reserved.

1
Upcoming: Database Inventory: Concepts and troubleshooting
Copyright 2014, Oracle and/or its affiliates. All rights reserved. 2
Oracle Advisor Webcast Program
Current schedule
Archived recordings
Doc ID 740966.1
Upcoming: Database Inventory: Concepts and troubleshooting
Copyright 2014, Oracle and/or its affiliates. All rights reserved. 3
AGENDA
Presentation approximately 45 minutes
Q&A Session approximately 15 minutes

Web attendees can ask questions via Q&A panel
Phone attendees can ask questions via Q&A panel or
phone (operator assisted)

Upcoming: Database Inventory: Concepts and troubleshooting
Copyright 2014, Oracle and/or its affiliates. All rights reserved. 4
ATTENTION AUDIO Options
You can
either listen the audio broadcast on your computer
or join teleconference (dial in)

Upcoming: Database Inventory: Concepts and troubleshooting
Copyright 2014, Oracle and/or its affiliates. All rights reserved. 5
Voice Streaming Audio Broadcast
Listen only mode
Advantage: no need to dial in
What about Questions?
Type your questions into WebEx Q&A panel
If you prefer full audio access in order to ask
questions directly, please connect to our
teleconference
Connect details you will find at next slide
Upcoming: Database Inventory: Concepts and troubleshooting
Copyright 2014, Oracle and/or its affiliates. All rights reserved. 6
ATTENTION AUDIO INFORMATION
Teleconference Connect details:
1. Conference ID: 41232658
2. International dial in: +44 (0) 1452 562 665
3. US Free call: 1866 230 1938
4. List with national toll free numbers is available in
note 1148600.1
You can view this info anytime during the conference using
Communicate > Teleconference > Join Teleconference
from your WebEx menu
Upcoming: Database Inventory: Concepts and troubleshooting
Oracle Advisor Webcast
Database Inventory: Concepts and
troubleshooting
Asad Hasan
Principal Software Engineer
Copyright 2014, Oracle and/or its affiliates. All rights reserved. 8
AGENDA
Presentation approximately 45 minutes
Q&A Session approximately 15 minutes

Web attendees can ask questions via Q&A panel only
Phone attendees can ask questions via Q&A panel or phone (operator
assisted)
Copyright 2014, Oracle and/or its affiliates. All rights reserved. 9
Oracle Advisor Webcast Program
Current schedule
Archived recordings
Doc ID 740966.1
Copyright 2014, Oracle and/or its affiliates. All rights reserved. 10
AUDIO INFO Join Teleconference
Copyright 2014, Oracle and/or its affiliates. All rights reserved. 11
Q&A panel
type your question here
1
Ask: ALL PANELLIST leave default!
2
Send your question
3
Copyright 2014, Oracle and/or its affiliates. All rights reserved. 12
your question pop-up here
Copyright 2014, Oracle and/or its affiliates. All rights reserved. 13
The following is intended to outline our general product
direction. It is intended for information purposes only, and
may not be incorporated into any contract. It is not a
commitment to deliver any material, code, or functionality,
and should not be relied upon in making purchasing decision.
The development, release, and timing of any features or
functionality described for Oracles products remains at the
sole discretion of Oracle.
Safe Harbor Statement
Oracle Advisor Webcast
Database Inventory: Concepts and
troubleshooting
Asad Hasan
Principal Software Engineer
Copyright 2014, Oracle and/or its affiliates. All rights reserved. 15
Objectives
Understanding Oracle Database
Inventory
Importance of Database Inventory
Knowledge of Common Problems
with Inventory
Copyright 2014, Oracle and/or its affiliates. All rights reserved. 16
Agenda
Overview Database Inventory
Central Inventory and Local Inventory
Inventory Pointer used by OUI and OPatch
Layout of Oracle Inventory
Steps To Recreate Central Inventory
Troubleshooting and known issues

Copyright 2014, Oracle and/or its affiliates. All rights reserved. 17
Overview of Oracle Inventory
Collection of information representing the software installed.
Provided the Oracle Product is Installed using OUI (Oracle Universal
Installer)

OUI Oracles Installer Application





WINDOWS setup.exe
UNIX runInstaller
Copyright 2014, Oracle and/or its affiliates. All rights reserved. 18
Structure of Inventory
Central
Inventory
Pointer File
(oraInst.loc)
Central
Inventory
(oraInventory)
Oracle Home 1
Oracle Home 3
Inventory
Oracle Home 2
Each system has:
One Central Inventory
N Oracle Home(Local) Inventories


Copyright 2014, Oracle and/or its affiliates. All rights reserved. 19
Default Location Inventory Pointer
Solaris/HP-UX /var/opt/oracle/oraInst.loc
Linux/AIX : /etc/oraInst.loc



On Windows : registry HKLM\Software\oracle\inst_loc




cat oraInst.loc
inventory_loc=/u01/app/oraInventory
inst_group=oinstall
Inst_loc C:\Program Files\Oracle\Inventory
Copyright 2014, Oracle and/or its affiliates. All rights reserved. 20
Central Inventory
Inventory having information of Oracle Homes installed in a machine.

Contains
Inventory File
Logs Directory

Updated by install or de-install of a ORACLE_HOME.




Copyright 2014, Oracle and/or its affiliates. All rights reserved. 21
How Does OUI Decide oraInventory Location ?
OUI Set Up Central Inventory
ORACLE_BASE
$ORACLE_BASE/../oraInventory
/u01/app/oraInventory
Set
Not Set
No /home/oracle/oraInv
entory
If it is not first time OUI refers /etc/oraInst.loc
OFA -Complaint
Yes
/u[01-09]/app/oraInventory
Copyright 2014, Oracle and/or its affiliates. All rights reserved. 22
Inventory File(inventory.xml)
Located in :
<centralinventorylocation>/ContentsXML/inventory.xml
It Lists Oracle_Home with following attributes:







HOME IDX="1 LOC="/u01/app/oracle/product/11.2.0/dbhome_1"
NAME="OraDb11g_home1

HOME NAME=grid11g" LOC="/grid11g" IDX=2" CRS="true"
NODE NAME="rac1" NODE NAME="rac2"

Copyright 2014, Oracle and/or its affiliates. All rights reserved. 23
Central Inventory Logs Directory

Contains all installation logs for that node:
<central inventory location>/logs

installActions<YYYY-MM-DD_HH-MM-SS{AM/PM}>.log
oraInstall<YYYY-MM-DD_HH-MM-SS{AM/PM}>.err
oraInstall<YYYY-MM-DD_HH-MM-SS{AM/PM}>.out

Location Of Logs For OPatch And OUI (Doc ID 403212.1)




Copyright 2014, Oracle and/or its affiliates. All rights reserved. 24
Inventory on Windows
In Windows 64 bit machine, there can be two inventories:

1) For all the oracle software installed using 64-bit DB software .
"c:\Program Files\Oracle\Inventory"

2) For the 32-bit oracle softwares, eg: 32-bit db client s/w this exists at:
"c:\Program Files (x86)\Oracle\Inventory"







Copyright 2014, Oracle and/or its affiliates. All rights reserved. 25
Cont..
The two inventories are maintained independently
64-bit oracle software operate on 64 bit inventory
32-bit oracle software operate on 32-bit inventory

Registry keys associated with these inventories:
HKEY_LOCAL_MACHINE\SOFTWARE\ORACLE 64bit
HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\ORACLE -32 bit






Copyright 2014, Oracle and/or its affiliates. All rights reserved. 26
Inventory Corrections examples :

=> Attach Oracle_Home to Central Inventory :



=> Detach Oracle_Home from Central Inventory :









./runInstaller -silent -attachHome
ORACLE_HOME="<OracleHome-Directory>
ORACLE_HOME_NAME="<OracleHome-Name>
./runInstaller -silent -detachHome
ORACLE_HOME="<OracleHome-Directory>
ORACLE_HOME_NAME="<OracleHome-Name>
Copyright 2014, Oracle and/or its affiliates. All rights reserved. 27
Steps To Recreate Central
Inventory(oraInventory) In RDBMS Homes
STEP1: Locating the central inventory
STEP2: Remove the Central inventory (if it exists)
STEP3: Change the directory to the oui location.
STEP4: Attaching the Home

Copyright 2014, Oracle and/or its affiliates. All rights reserved. 28
Demonstration
Copyright 2014, Oracle and/or its affiliates. All rights reserved. 29
Local inventory

Each Oracle_Home has a local inventory within
$ORACLE_HOME/inventory

It contains the following files :
Components File
Home Properties File


Copyright 2014, Oracle and/or its affiliates. All rights reserved. 30
Components File - comps.xml
It has records of all the components as well as patchsets or interim
patches installed in the Oracle home.

ORACLE_HOME/inventory/ContentsXML/comps.xml



After each opatch apply/napply OUI updates its comps.xml
with patch details.



opatch lsinventory
opatch lsinventory -detail

Copyright 2014, Oracle and/or its affiliates. All rights reserved. 31
Sync Central and Local Inventory
Inventory.xml :



Comps.xml



INSTALL_TIME="2014.May.01 10:59:29 GMT
INST_TYPE NAME="EE" NAME_ID="EE" DESC_ID="EE_DESC
LOC=" /u01/app/oracle/product/11.2.0/dbhome_1 " TYPE="O"
IDX="1"/>
INST_LOC="/u01/app/oracle/product/11.2.0/dbhome_1/oracle.server
HOME_IDX="1
Copyright 2014, Oracle and/or its affiliates. All rights reserved. 32
Home Properties
Contains Platform details for a particular oracle_home
$ORACLE_HOME/inventory/ContentsXML/oraclehomeproperties.xml





Helps determine if the patch(32 or 64 bit) is applicable for platform

<GUID>1722428402#.1076931936
<ARU_ID>226
<ARU_ID_DESCRIPTION>Linux x86-64
<PROPERTY NAME="ARCHITECTURE" VAL="64"/>
Copyright 2014, Oracle and/or its affiliates. All rights reserved. 33
Cont..
Set Oracle_Base

oraenv reads oraclehomeproperties.xml









<PROPERTY NAME="ORACLE_BASE" VAL="/u01/app/oracle"/>
Copyright 2014, Oracle and/or its affiliates. All rights reserved. 34
Inventory Pointer Within Oracle_Home
How to identify where is Oracle_Home registered ?

cat $ORACLE_HOME/oraInst.loc



Overrides the Default Inventory Pointer .

inventory_loc=/u01/app/oraInventory
Copyright 2014, Oracle and/or its affiliates. All rights reserved. 35
Layout of Oracle Inventory
Inventory Ptr
<oracle_home>/inventory/oneoff/inventory.xml
<InventoryLoc>/ContentsXML/comps.xml
<OH>/inventory/ContentsXML/comps.xml
<OH>/inventory/ContentsXML/oraclehomeproperties.xml
Get Inventory Pointer
Get Independent
Products
Get Oracle Homes
For each OH
Get Components
Get platform
Home GUID

<InventoryLoc>/ContentsXML/inventory.xml
For Opatch
Copyright 2014, Oracle and/or its affiliates. All rights reserved. 36
Check Oracle XML Is Correct ?
We can use opatch utility to check health of specific XML file.



Error in XML File:



org.xml.sax.SAXParseException: <Line 12, Column 12>: XML-
20121: (Fatal Error) End tag does not match start tag
'HOME.at
oracle.xml.parser.v2.XMLError.flushErrorHandler(XMLError.ja
va:422)



%opatch util LoadXML -xmlInput
inventory_Loc/ContentsXML/inventory.xml
Copyright 2014, Oracle and/or its affiliates. All rights reserved. 37
How To Identify Error In XML Files ?






<HOME NAME="OraDb11g_home1"
LOC="/u05/app/oracle/product/11.2.0/dbhome_1"
TYPE="O" IDX="1"/>

<HOME NAME="OraDb11g_home1"
LOC="/u05/app/oracle/product/11.2.0/dbhome_1"
TYPE="O" IDX="1">
(Fatal Error) End tag does not match
Copyright 2014, Oracle and/or its affiliates. All rights reserved. 38
Significance of oraInst.loc using OUI and
OPATCH
Default OUI takes central Inventory from:
/var/opt/oracle/oraInst.loc or /etc/oraInst.loc
Opatch takes central Inventory from $OH/oraInst.loc

If oraInst.loc does not exist:
./runInstaller -invPtrLoc <path>/oraInst.loc
./opatch lsinventory -invPtrLoc <path>/oraInst.loc



Copyright 2014, Oracle and/or its affiliates. All rights reserved. 39
oraInst.loc - Case Study
Case 1-New Install in a Clean Machine
Oracle_Home/oraInst.loc is created in the end of installation after
executing oraInstRoot.sh .
Oracle_Home/oraInst.loc Default inventory pointer file is same .
Case 2 Default Inventory Pointer Exists
Finds Inventory location from inventory pointer in default location .
The file under OH/oraInst.loc has contents similar to the default
inventory pointer file.
Copyright 2014, Oracle and/or its affiliates. All rights reserved. 40
Non-Default Inventory Pointer Location
Case 3 New Install with -invPtrLoc <neworaInst.loc>

File under OH/oraInst.loc has contents similar <neworaInst.loc>

Different from the default inventory pointer.

To perform an operation on this home pass
-invPtrLoc <neworaInst.loc>

Copyright 2014, Oracle and/or its affiliates. All rights reserved. 41
Inventory Backup
Highly Recommended before any Upgrade or Patch Operation.

Installs cannot be performed on the system due to inventory errors

Rebuilding the Oracle Home(Local) inventory is not possible

Central Inventory Backup
Oracle Home Backup
Copyright 2014, Oracle and/or its affiliates. All rights reserved. 42
Demonstration
Copyright 2014, Oracle and/or its affiliates. All rights reserved. 43
Automated Inventory Backup
Operations Update Central Inventory Operations Update Local Inventory
a) Install (New Home)
b) Deinstall ( Remove Home)
c) Clone
d) Add node
e) Attach home
a) Install (patchsets,upgrades)
b) Deinstall (components)
c) Add node

Backup the directory:
oraInventory/backup/
/time stamp/
Backup the directory:

$ORACLE_HOME/inventory//backup/tim
e stamp/
Copyright 2014, Oracle and/or its affiliates. All rights reserved. 44
Multiple OraInventory Locations?

Consolidate Multiple Central Inventories into a Single Central Inventory.

Step1:Identify the Central Inventory Directory
Step2:Execute orainstroot.sh
Step3:Identify other Central inventories and Oracle home
Step4:Execute the following command :


->cd $ORACLE_HOME/oui/bin
->./runInstaller -silent -attachHome
ORACLE_HOME="<Oracle_Home_Location>"
ORACLE_HOME_NAME="<Oracle_Home_Name>"
Copyright 2014, Oracle and/or its affiliates. All rights reserved. 45
Demonstration
Copyright 2014, Oracle and/or its affiliates. All rights reserved. 46
Summary
Understanding of Central and
Local Inventory
Steps to Recreate Central Inventory
Purpose of oraInst.loc
Consolidation of oraInventory
What we covered today
Copyright 2014, Oracle and/or its affiliates. All rights reserved. 47
Additional References
Document 564192.1 FAQs on Central Inventory
and Oracle Home Inventory (Local Inventory) in
Oracle RDBMS
Document 556834.1 Steps To Recreate Central
Inventory(oraInventory) In RDBMS Homes
Document 414600.1 Strategies for a Corrupted
Oracle Central Inventory
Document 453399.1 How To Check if
inventory.xml/comps.xml Or Any Oracle XML
File Is Correct?
Copyright 2014, Oracle and/or its affiliates. All rights reserved. 48
Questions & Answers
Copyright 2014, Oracle and/or its affiliates. All rights reserved. 49
MOS Community thread for Q&A
https://community.oracle.com/thread/3572317
Copyright 2014, Oracle and/or its affiliates. All rights reserved. 50
Q&A panel
type your question here
1
Ask: ALL PANELLIST leave default!
2
Send your question
3
Copyright 2014, Oracle and/or its affiliates. All rights reserved. 51
Further Info & Help
Generic Advisor Webcast Note (Doc ID 740966.1)
Database Advisor Webcast (Doc ID 1456176.1)
DB Newsletter (Doc ID 1284265.1)
MOS Community Database Install/Upgrade/Opatch


Copyright 2014, Oracle and/or its affiliates. All rights reserved. 52
Oracle Advisor Webcast Program
Current schedule
Archived recordings
Doc ID 740966.1
select your product:
e.g.
Oracle Database
Copyright 2014, Oracle and/or its affiliates. All rights reserved. 53
Archives
Schedule
Copyright 2014, Oracle and/or its affiliates. All rights reserved. 54
Copyright 2014, Oracle and/or its affiliates. All rights reserved. 55
Learn More
About Oracle Support Best Practices
www.oracle.com/goto/proactivesupport
Get Proactive in My Oracle Support
https://support. oracle.com | Doc ID: 432.1
Get Proactive Blog
https://blogs.oracle.com/getproactive/
Ask the Get Proactive Team
get-proactive_ww@oracle.com
Available References and Resources to Get Proactive
Copyright 2014, Oracle and/or its affiliates. All rights reserved. 56
Copyright 2014, Oracle and/or its affiliates. All rights reserved. 57
Copyright 2014, Oracle and/or its affiliates. All rights reserved. 58
Copyright 2014, Oracle and/or its affiliates. All rights reserved. 59
THANK YOU
Copyright 2014, Oracle and/or its affiliates. All rights reserved. 60