How the FlexNet inventory agent determines ORACLE_HOME on Unix-like operating systems when gathering Oracle Database inventory
Introduction:
To connect successfully to an Oracle Database instance for inventory, the inventory component (ndtrack) of the FlexNet inventory agent must determine the exact ORACLE_HOME environment variable setting for the instance. This article describes the detection logic on Unix-like operating systems, what can prevent correct identification, and related details for validation and troubleshooting.
To connect successfully to an Oracle Database instance for inventory, the inventory component (ndtrack) of the FlexNet inventory agent must determine the exact ORACLE_HOME environment variable setting for the instance. This article describes the detection logic on Unix-like operating systems, what can prevent correct identification, and related details for validation and troubleshooting.
Logic for identifying ORACLE_HOME
The inventory component uses the first of the following values that is available and not empty to identify the ORACLE_HOME variable for a running Oracle Database instance process:
The inventory component uses the first of the following values that is available and not empty to identify the ORACLE_HOME variable for a running Oracle Database instance process:
- The ORACLE_HOME environment variable in the default shell profile of the user owning the “Oracle” process.
- The home directory specified in /etc/oratab for the SID identified from the “Oracle” process name.
- The real path (with no symlinks) of the executable used to invoke the running “Oracle” process.
Processes used to identify potential Oracle Database instances
The inventory process looks for Oracle Database processes with names like:
The inventory process looks for Oracle Database processes with names like:
- ora_smon_
- xe_smon_
- asm_smon_
- db_smon_
A matching process is referred to here as an “Oracle” process.
When may ORACLE_HOME fail to be correctly identified?
Examples include:
Examples include:
- When symlinks are used so different paths resolve to the same real directory. For example:
- ORACLE_HOME is set to /oracle/ABC;
- /oracle/ABC is a symlink to /oracle/19.3.0;
- The agent identifies /oracle/19.3.0 as home.
- When ORACLE_HOME is set in the default profile of a single oracle user running multiple instances. Most instances may have different ORACLE_HOME values than the default profile setting.
Inventory logging details
tracker.log includes entries like:
tracker.log includes entries like:
[Wed 15 Dec 2021 11:18:06 AM EST (G, 0)] {19070} ===== Discovered Oracle database instances and listeners
[Wed 15 Dec 2021 11:18:06 AM EST (G, 0)] {19070} +-- "/oracle/product/ABC": Discovered by = Process,Oratab,Osdbagrp, Executable ID = 64517:939841567, DBA group = "dba", Home owner = "oracle", Has SQLPlus = true, SQLNet Authentication Services = "", Can Inventory = true, Real Home = ""
[Wed 15 Dec 2021 11:18:06 AM EST (G, 0)] {19070} | +-- Instance "ABC": Discovered by = Process,Oratab, Process ID = 22896, State = running, Process owner = "oracle"
[...]
[Wed 15 Dec 2021 11:18:07 AM EST (G, 0)] {19070} Started tracking Oracle instance "ABC" in "/oracle/product/ABC".
[...]
[Wed 15 Dec 2021 11:21:56 AM EST (G, 0)] {19070} Successfully gathered inventory from Oracle instance "ABC" in "/oracle/product/ABC".
The final path shown indicates the ORACLE_HOME directory determined by the agent. If the home identified by /etc/oratab or by process differs from the ORACLE_HOME obtained from the user profile, the earlier value appears under “Real Home.”
Verifying the ORACLE_HOME value
- Locate tracker.log entries that show the ORACLE_HOME path:
Started tracking Oracle instance "ABC" in "/oracle/product/ABC". - Confirm with the DBA the actual ORACLE_HOME value in use and compare.
Errors when ORACLE_HOME is incorrect
Inventory may fail with errors such as:
Inventory may fail with errors such as:
ORA-12547: TNS:lost contactORA-01034: ORACLE not available
Example log:
[Wed 15 Dec 2021 11:18:06 AM EST (G, 0)] {19070} Started tracking Oracle instance "ABC" in "/oracle/product/ABC".
[Wed 15 Dec 2021 11:18:06 AM EST (G, 0)] {19070} | ORA-12547: TNS:lost contact
[Wed 15 Dec 2021 11:18:06 AM EST (G, 0)] {19070} | SP2-0751: Unable to connect to Oracle. Exiting SQL*Plus
[Wed 15 Dec 2021 11:18:06 AM EST (G, 0)] {19070} Failed to inventory Oracle instance "ABC" in "/oracle/product/ABC".
Note that similar errors can have other causes, such as ORACLE_BASE mismatches in orabasetab.
Testing connectivity manually
Example approach to test using sqlplus as done by the agent (replace placeholders with actual values from logs):
Example approach to test using sqlplus as done by the agent (replace placeholders with actual values from logs):
su - oracle
export ORACLE_HOME=OracleHomeDirectory
export ORACLE_SID=OracleSID
cd "$ORACLE_HOME/bin"
./sqlplus "/ as sysdba"
If the OracleInventoryAsSysdba preference is set to False, connect with:
./sqlplus "/"
Options if an incorrect ORACLE_HOME is found
- Adjust Oracle configuration (such as entries in /etc/oratab or shell profile settings) so the discovery logic identifies the correct value.
- Remember: If ORACLE_HOME is set in a profile for an account, it applies to all instances for that account. Any mismatch can block inventory for other instances.
- Set
UserDefinedOracleHome=Falsein mgsconfig.ini to ignore the shell profile’s value. Default is True. Example:
-
$ cat <<EOF >/tmp/mgsconfig.ini [ManageSoft\Tracker\CurrentVersion] UserDefinedOracleHome=False EOF $ /opt/managesoft/bin/mgsconfig -i /tmp/mgsconfig.ini
- If ORACLE_HOME cannot be resolved for any instance, local inventory for that instance is not possible. Consider beacon-based Oracle inventory collection as an alternative.
Obtaining ORACLE_HOME from user profile
The inventory component executes a command like the following to obtain the ORACLE_HOME environment variable value from the default profile of the user running an Oracle Database instance:
The inventory component executes a command like the following to obtain the ORACLE_HOME environment variable value from the default profile of the user running an Oracle Database instance:
$ su - oracle -c 'echo $ORACLE_HOME'
Related information
See the following pages for other information related to this topic:
- IT Asset Management System Reference >
- Gathering FlexNet inventory >
Was this helpful?
© 2026 Flexera. All rights reserved.