top of page
Writer's pictureShashi Kallae

Oracle Database Inventory Concepts


What is Oracle Database Inventory all about?

Overview of Oracle Database Inventory. Illustration by Shashi Kallae.
Overview of Oracle Database Inventory. Illustration by Shashi Kallae.

Oracle Inventory is a central repository that stores the location of the ORACLE_BASE and ORACLE_HOMES. Want to know more about it? Details are mentioned below.


Layout of Oracle Inventory

Oracle Database Central Inventory Structure. Illustration by Shashi Kallae.
Oracle Database Central Inventory Structure. Illustration by Shashi Kallae.

Location of Oracle Inventory on a Linux server

On a given Oracle database Linux server, the location of the Oracle Inventory is stored in the oraInst.loc file. This contains information pertaining to the central inventory location and the Oracle installation owner group, which is essential to the OUI either to install upgrades or apply any maintenance release patches. More details on oraInventory and local inventory are discussed below.

inventory_loc=central_inventory_location
inst_group=group

The below example reflects the contents of the oraInst.loc file. This is the inventory pointer within the ORACLE_HOME, which tells where ORACLE_HOME is registered.

$ cat /etc/oraInst.loc

inventory_loc=/u01/app/oraInventory
inst_group=oinstall

To find more details on the oracle installation group, grep the group from the group file as mentioned below.

Example: grep groupname /etc/group
$ grep oinstall /etc/group
oinstall:x:54321:grid,oracle

Note

 
  • When performing a new Installation, do not put the oraInventory directory under the $ORACLE_BASE directory.

  • The above action will result in user permission errors for other Oracle-related installations.

Importance of oraInst.loc file

  • Default OUI takes central inventory location from /etc/oraInst.loc.

  • OPatch takes central inventory location from $ORACLE_HOME/oraInst.loc.


What happens if oraInst.loc doesn't exist?

  • When performing a new installation, if oraInst.loc doesn't exist, then the following will occur.

  • Oracle_Home/oraInst.loc is created at the end of installation after executing oraInstRoot.sh, which makes the inventory file default.

Set Oracle Environment Variables

Ensure to set the Oracle environment variables before starting a new install, an upgrade, or applying Release Updates.

Bourne/Bash/Korn Shell

export ORACLE_HOSTNAME=‘example.fqdn.com'
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=/u01/app/oracle/product/19X/dbhome_1
export PATH=$PATH:$ORACLE_HOME/bin
export ORACLE_SID=databaseinstance_name
C Shell

% setenv ORACLE_HOSTNAME example.fqdn.com
% setenv ORACLE_BASE=/u01/app/oracle
% setenv ORACLE_HOME=/u01/app/oracle/product/19x/dbhome_1
% setenv PATH=$PATH:$ORACLE_HOME/bin
% setenv ORACLE_SID=databaseinstance_name

About oraInventory

  1. Oracle Inventory Directory stores an Inventory of all Oracle-related software installed on the system (inventory_loc=/u01/app/oraInventory).

  2. Any users who install Oracle software on the Linux server must be granted OINSTALL privileges to read, write, and execute on the oraInventory directory.

  3. /etc/oraInst.loc file holds the above-mentioned details. Before starting any Oracle-related process, set your ORACLE_BASE environment variable.


What is Central Inventory?

  • Central Inventory contains information about all ORACLE_HOMES installed on a host.

  • Central Inventory is also called as oraInventory. Each Central Inventory, or Global Inventory, or oraInventory consists of a file called inventory.xml, which contains the list of all the ORACLE_HOMES installed on the host.

  • Oracle Universal Installer creates and updates this directory. All Oracle software owners are granted read and write privileges to the Central Inventory directory.

Inventory File (inventory.xml):
------------------------------
Path: $centralinventory_location/ContentsXML/inventory.xml

$ cat “$centralinventory_location"/ContentsXML/inventory.xml

HOME IDX="1“ LOC="/u01/app/oracle/product/19x/dbhome_1"
NAME="OracleDb19x_home1“
HOME NAME=“grid19x" LOC="/grid19g" IDX=“2" CRS="true"
NODE NAME="rac1" NODE NAME="rac2"
Central Inventory (Logs Directory):
----------------------------------
Contains all the installation logs for that particular node
Path: $centralinventory_location/logs

$ cat $centralinventory_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

What is Local Inventory?

  • Local Inventory is a part of the central inventory in Oracle. Local Inventory, also called Oracle Home Inventory, is present in each Oracle Home ($ORACLE_HOME/inventory).

  • There are multiple files in the ORACLE_HOME directory; among them, comps.xml file holds the information about patchsets, all components, and any interim patchsets installed.

  • Local Inventory contains the Components File (comps.xml) and Home Properties File (oraclehomeproperties.xml).

  • Components File - comps.xml

  • Home Properties File - oraclehomeproperties.xml

    • oraclehomeproperties.xml file contains the info about GUID and ARU ID, which informs the patching process about the platform and ID of the node.

    • In a shared Oracle Home, the local node information is not present.

    • GUID — Unique global ID for the Oracle Home

    • oraclehomeproperties.xml file contains platform details for a particular oracle_home. This file helps to determine if the patch is 32-bit or 64-bit.

Path: $ORACLE_HOME/inventory/ContentsXML/oraclehomeproperties.xml

$ cat $ORACLE_HOME/inventory/ContentsXML/oraclehomeproperties.xml

<GUID>1722428402#.1076931936
<ARU_ID>226
<ARU_ID_DESCRIPTION>Linux x86-64
<PROPERTY NAME="ARCHITECTURE" VAL="64"/>
Set ORACLE_BASE environment variable because oraenv reads oraclehomeproperties.xml

<PROPERTY NAME="ORACLE_BASE" VAL="/u01/app/oracle"/>

How do you attach and detach an ORACLE_HOME to the Central Inventory?

The following steps should be performed to attach an Oracle_Home to the Central Inventory.

Attach an Oracle_Home:
---------------------
./runInstaller -silent -attachHome
ORACLE_HOME="<OracleHome-Directory>“
ORACLE_HOME_NAME="<OracleHome-Name>“

The following steps should be performed to detach an Oracle_Home to the Central Inventory.

Detach an Oracle_Home:
---------------------
./runInstaller -silent -detachHome
ORACLE_HOME="<OracleHome-Directory>“
ORACLE_HOME_NAME="<OracleHome-Name>“

How do you recreate Central Inventory?

The following steps should be performed to recreate the Central Inventory.

  1. Locate the Central Inventory.

  2. If a Central Inventory exists, make a backup and rename or delete the file.

  3. Change the directory to the OUI location.

  4. Perform the above steps to attach the home.


How do you consolidate multiple central Inventories into a Single Central Inventory?

If you have multiple OraInventory locations, then do the following,

  • Take a backup of all the oraInventory directories.

  • Identify the Central Inventory Directory.

  • Execute orainstroot.sh.

  • Identify other Central inventories and Oracle home.


Execute the following command,

$ cd $ORACLE_HOME/oui/bin
$ ./runInstaller -silent -attachHome
ORACLE_HOME="<Oracle_Home_Location>"
ORACLE_HOME_NAME="<Oracle_Home_Name>"

How to move or backup Central Inventory to another location safely


Step 1: Set the environment variables

Bourne/Bash/Korn Shell

export ORACLE_HOSTNAME=‘example.fqdn.com'
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=/u01/app/oracle/product/19X/dbhome_1
export PATH=$PATH:$ORACLE_HOME/bin
export ORACLE_SID=databaseinstance_name

Step 2: Find the present location of the central Inventory file. The oraInst.loc file is simply a pointer to the location of the central inventory (oraInventory).

/etc/oraInst.loc

cat oraInst.loc
inventory_loc=/u01/app/oraInventory
inst_group=oinstall

Step 3: Open the oraInst.loc file, check the value of inventory_loc

inventory_loc=/u01/app/oraInventory

Step 4: Copy the oraInventory directory.

cp -Rp /home/oracle/oraInventory /backup_directory/oracle/
cp -Rp $ORACLE_BASE/oraInventory /backup_directory/oracle/

Step 5: Edit the oraInst.loc file and update the inventory_loc location.

vi /etc/oraInst.loc
inventory_loc=/backup_directory/oracle/oraInventory
Save the file.



Oracle Base Directory (Difference between Oracle Database Oracle base and Oracle Grid Infrastructure Oracle base)

Keep an eye on the upcoming Articles on this Topic.


Comentários

Avaliado com 0 de 5 estrelas.
Ainda sem avaliações

Adicione uma avaliação
bottom of page