Overview
In order to successfully connect to an Oracle Database instance to gather inventory, the inventory component (ndtrack) of the FlexNet inventory agent must be able to correctly guess the exact ORACLE_HOME environment variable that the instance is running with. This article describes how this is done on Unix-like operating systems, and what can go wrong with this process.
Logic for identifying ORACLE_HOME
The inventory component uses the first of the following values that can be determined (and is not empty) to make a best guess at the likely value of the ORACLE_HOME variable for a running Oracle Database instance process:
- The value of the ORACLE_HOME environment variable in the default shell profile of the user that the “Oracle” process is running as.
- The home directory as specified in /etc/oratab for the SID identified from the "Oracle" process name.
- The real path (with no symlinks) of the executed used to invoke the running "Oracle" process.
What processes are used to identify potential Oracle Database instances?
The inventory gathering process looks for Oracle Database processes with any of the following names to identify potential instances to be inventoried:
- ora_smon_<SID>
- xe_smon_<SID>
- asm_smon_<SID>
A process discovered with one of these names is referred to in this article as an "Oracle" process.
When may the ORACLE_HOME directory fail to be correctly identified?
Some examples of scenarios where the path identified by the above logic does not exactly match the ORACLE_HOME environment variable used by the Oracle Database instance are:
- When symlinks are used then different paths may resolve to the same real path. For example, this would occur if:
- The "Oracle" process is running with the environment variable ORACLE_HOME set to “/oracle/ABC”; and
- “/oracle/ABC” is a symlink to “/oracle/19.3.0”; and
- The home directory identified by the agent based on the logic described above is “/oracle/19.3.0”.
- When the ORACLE_HOME environment variable is set in the default profile of a single “oracle” user that is used to run multiple Oracle Database instances. In this case it is likely that all (possibly except for one) of those instances will each individually have an ORACLE_HOME that is different from the default profile setting.
Inventory component logging related to the ORACLE_HOME discovery
The tracker.log file generated by the inventory gathering component includes details like the following related to discovery of Oracle Database instances and their home directories:
[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 path “/oracle/product/ABC” in the above example is the ORACLE_HOME directory determined as per the steps described above.
If the home identified from the /etc/oratab or “Oracle” process is overridden by the home identified from the ORACLE_HOME environment variable in the profile of the Oracle user, then the “Real Home” value identifies the former path.
Checking whether the correct ORACLE_HOME value has been identified
To check whether the inventory component is correctly identifying the ORACLE_HOME for a particular database instance:
- Find logging like the following which shows the identified ORACLE_HOME directory in the inventory component’s tracker.log file:
[Wed 15 Dec 2021 11:18:07 AM EST (G, 0)] {19070} Started tracking Oracle instance "ABC" in "/oracle/product/ABC". - Ask your DBAs to identify the exact ORACLE_HOME directory path that the instance is actually running with.
- Confirm whether these values match exactly.
What happens if an incorrect ORACLE_HOME is identified?
Oracle Database inventory gathering may fail with logging showing one of the following errors when the agent identifies an ORACLE_HOME value that does not exactly match the value that the instance is running with:
- ORA-12547 TNS:lost contact
- ORA-01034: ORACLE not available
For example:
[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".
Or:
[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-01034: ORACLE not available
[Wed 15 Dec 2021 11:18:06 AM EST (G, 0)] {19070} | Process ID: 0
[Wed 15 Dec 2021 11:18:06 AM EST (G, 0)] {19070} | Session ID: 0 Serial number: 0
[Wed 15 Dec 2021 11:18:06 AM EST (G, 0)] {19070} Failed to inventory Oracle instance "ABC" in "/oracle/product/ABC".
Note that these errors can potentially have other root causes. For example, similar errors may be caused by a ORACLE_BASE value in the $ORACLE_HOME/install/orabasetab file that does not match the ORACLE_BASE value the instance is actually running with.
Testing connecting to the Oracle Database instance
Commands like the following can be executed to manually test whether a connection can be made to an Oracle Database instance in a similar fashion to what the FlexNet inventory agent will do.
Replace the “oracle” username, “OracleHomeDirectory” and “OracleSID” values in the first 3 lines with actual values as shown in logging from the inventory component’s tracker.log file.
su - oracle
export ORACLE_HOME=OracleHomeDirectory
export ORACLE_SID=OracleSID
cd "$ORACLE_HOME/bin"
./sqlplus "/ as sysdba"
The above sqlplus command will need to succeed in order for the FlexNet inventory agent to be able to gather Oracle Database inventory.
Tip: If the inventory agent’s OracleInventoryAsSysdba preference has been configured to the non-default value of “False”, use the following sqlplus command to connect instead of the command shown above:
./sqlplus "/"
What can be done if an incorrect ORACLE_HOME is identified?
The following approaches may be considered to get a successful connection to gather Oracle Database inventory if an incorrect ORACLE_HOME is identified by default:
- Consider whether the configuration of the Oracle Database instance can be modified so that the ORACLE_HOME discovery process identifies the correct value. For example, this could involve modifying the details in the /etc/oratab file to exactly match the value the instance runs with, or changing the ORACLE_HOME environment variable in the default profile of the oracle user.
- The UserDefinedOracleHome inventory agent preference can be set to “False” to avoid using the ORACLE_HOME value from the default shell profile of the user that the “oracle” process is running as. This may be appropriate if that value is set but multiple instances with different homes are running on the server.
One way to set this preference would be to execute commands like the following:$ cat <<EOF >/tmp/mgsconfig.ini
[ManageSoft\Tracker\CurrentVersion]
UserDefinedOracleHome=False
EOF
$ /opt/managesoft/bin/mgsconfig -i /tmp/mgsconfig.ini - Consider using beacon-based collection of Oracle inventory (rather than agent-based collection).
How is ORACLE_HOME obtained from an Oracle user’s default 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:
$ 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 >
Related Articles
Gathering diagnostic tracing from a FlexNet inventory agent process on Unix-like operating systems 135Number of Views Managing Oracle Universal Installer (OUI) evidence gathered by the FlexNet inventory agent 115Number of Views Known Issue: Inventory gathering process may terminate on Unix-like operating systems while gathering Java version details… 34Number of Views Agent-based Oracle inventory fails when ORACLE_HOME environment variable in impersonated user's profile does not match the… 5Number of Views Application usage metering using the FlexNet inventory agent 190Number of Views
Hi, I am Reva - Ask me anything.
No new updates
Thanks for the feedback!
Your feedback has been saved.Rate this response:
Add Additional feedback ( Optional )
Are you sure you want to cancel
the case creation?
Are you sure you want to cancel the case creation?
Are you sure you want to close this case
| Products | Region | Phone Numbers |
|---|---|---|
| FlexNet Operations FlexNet Embedded FlexNet Publisher FlexNet Connect FlexNet Code Insight InstallAnywhere InstallShield |
North America * |
+1 630-332-2513 (toll) +1 877-279-2853 (toll-free in North America) |
| Europe * |
+44 1925 944367 (toll) +44 800 047 8642 (toll-free in Europe) |
|
| Japan * | +81 3-4540-5335 (select option 2) | |
| Australia * |
+61 3 9895 2177 +61 1800 560 603 (toll-free in Australia) |
|
|
Usage Intelligence (formerly
Revulytics) Compliance Intelligence |
Please use the Case Portal to submit your support ticket or reach out to your Revenera contact. | |
Case id: 00001065
Activity: Status change: 2 hours ago