DBCollect/Detection: Difference between revisions

From Dirty Cache Wiki
Jump to navigation Jump to search
No edit summary
Tag: Manual revert
Line 18: Line 18:


Therefore, the instance detection part has been rewritten in version 1.18.0 as follows:
Therefore, the instance detection part has been rewritten in version 1.18.0 as follows:
== Finding candidates ==


* If the <code>--orahome</code> option is used, try the ORACLE_HOMEs given by this parameter first
* If the <code>--orahome</code> option is used, try the ORACLE_HOMEs given by this parameter first
* Next, try to locate the instance in <code>oratab</code>. The ORACLE_HOME given for the instance will be tried
* Next, try to locate the instance in <code>oratab</code>. The ORACLE_HOME given for the instance will be tried
* Finally, try the ORACLE_HOMEs found via processing the Oracle Inventory (<code>inventory.xml</code>)
* Finally, try the ORACLE_HOMEs found via processing the Oracle Inventory (<code>inventory.xml</code>)
The Oratab and Inventory parts can be skipped (for troubleshooting purpuses) with the <code>--no-oratab</code> and <code>--no-orainv</code> options.
== Validating ORACLE_HOME ==
* Each ORACLE_HOME directory must have an executable <code>sqlplus</code> binary in <code>$ORACLE_HOME/bin/sqlplus</code>
* Each ORACLE_HOME directory must NOT have an executable <code>crsctl</code> binary in <code>$ORACLE_HOME/bin/sqlplus</code>

Revision as of 15:04, 31 August 2025


Instance detection

This page describes how dbcollect detects (running) Oracle instances and their correct ORACLE_HOMEs.

Running instances

  • If a logons file is provided (using --logons), dbcollect will NOT automatically detect instances, but only connect to the services listed in the logons file.
  • If no logons file is specified, dbcollect runs the command ps -eo pid,user,group,args to find all running processes on the OS.
  • Running instances are matched if the args match ora_pmon_<oracle_sid>
  • If the --included option is given, only instances that are explicitly included will be processed (a warning message is given for non-included instances)
  • If the --excluded option is given, only instances that are not explicitly excluded will be processed (a warning message is given for excluded instances)

ORACLE_HOME

dbcollect uses SQL*Plus to connect to databases. As of Oracle 19, there is no clean, consistent way to find the correct ORACLE_HOME for a running instance. Older versions would have a hc_<sid>.dat file where the most recent timestamp on these files was used to figure out which ORACLE_HOME is the correct one. In Oracle 19, the DBS directory is moved from $ORACLE_HOME/dbs to $ORACLE_BASE/dbs which is shared by multiple ORACLE_HOMEs and therefore can no longer be used to identify the correct directory.

Therefore, the instance detection part has been rewritten in version 1.18.0 as follows:

Finding candidates

  • If the --orahome option is used, try the ORACLE_HOMEs given by this parameter first
  • Next, try to locate the instance in oratab. The ORACLE_HOME given for the instance will be tried
  • Finally, try the ORACLE_HOMEs found via processing the Oracle Inventory (inventory.xml)

The Oratab and Inventory parts can be skipped (for troubleshooting purpuses) with the --no-oratab and --no-orainv options.

Validating ORACLE_HOME

  • Each ORACLE_HOME directory must have an executable sqlplus binary in $ORACLE_HOME/bin/sqlplus
  • Each ORACLE_HOME directory must NOT have an executable crsctl binary in $ORACLE_HOME/bin/sqlplus