Maintenance outage for upgrade on Sunday, September 22

This site, docs.bmc.com, will be inaccessible for two hours starting at 8 AM CDT, Sunday, September 22, for a platform upgrade.

    Page tree
    Skip to end of metadata
    Go to start of metadata

    Note

    Due to interdependency between the Oracle Real Application Clusters and Oracle Database patterns, you might need to run two scans of the related hosts to discover all components of the deployment.

    Note

    In TKU May 2019 Oracle RAC modelling was updated, for more details see "Cluster Awareness in BMC Discovery 11.x series" section.

    Discover with BMC Discovery
    download

    This product can be discovered by any edition of BMC Discovery. Download our free Community Edition to try it out, or [see what else it can discover] !

    What is this?
    This is a product information page, containing details of the information that BMC Discovery gathers about a product and how it is obtained.
    Product Name
    Database
    Publisher Page
    Oracle
    Category
    Relational Database Management Systems
    Release
    TKU 2019-May-1
    Change History
    Oracle Database - Change History
    Reports & Attributes
    Oracle Database - Reports & Attributes
    Publisher Link
    Oracle

    Product Description

     

    Extended Discovery pattern which allows to model Database Detail Nodes being managed by the Oracle Database Server  is available for this product.

     

    Oracle RDBMS (a product of Oracle Corporation) is an enterprise-class relational database management system product. Oracle RDBMS is available on multiple platforms such as: Unix (Solaris, HP-UX, AIX, Mac OS X Server, Tru64), Linux, Microsoft Windows, z/OS, OpenVMS.

    Known Versions

    Version numbering of Oracle products has been fairly inconsistent and seems to vary from product to product with marketing and actual product versions often used interchangeably.

    Known versions of this product are:

    • 7.0
    • 7.1
    • 7.2
    • 7.3
    • 8.0
    • 8i Release 1 (8.1.5.x)
    • 8i Release 2 (8.1.6.x)
    • 8i Release 3 (8.1.7.x)
    • 9i Release 1 (9.0.1.x)
    • 9i Release 2 (9.2.0.x)
    • 10g Release 1 (10.1.0.x)
    • 10g Release 2 (10.2.0.x)
    • 11g Release 1 (11.1.x)
    • 11g Release 2 (11.2.x)
    • 12c Release 1 (12.1.x)
    • 12c Release 2 (12.2.x)
    • 18c

    Editions

    Oracle RDBMS is available in a number of different editions all of which are built on the same common code base. The editions are likely provided for marketing and license-tracking reasons.

    Known editions of the current version of the product (11g) are:

    • Enterprise Edition - offers largest scale performance, scalability and reliability in either single-server or clustered configurations. No limits applied to the maximum number of CPUs, RAM usage or Database Size. Licensed on the basis of users or CPUs and typically used on servers running more than 4 CPUs.
    • Standard Edition - contains base database functionality. Licensed on the basis of users or CPUs with the limitation of running on server with a maximum of 4 CPUs. An Enterprise-edition license is required for servers running more than 4 CPUs.
    • Standard Edition One - contains some more restrictions than Standard Edition. Marketed and sold for use on systems with one or two CPUs.
    • Express Edition - a version that is free to distribute on Windows and Linux platform, with a small footprint and restricted to the use of a single CPU and a maximum of 11GB of user data (database size) and 1GB of RAM and can be installed one instance per host.

    Software Pattern Summary

    Product ComponentOS TypeVersioningPattern Depth
    DatabaseServerUnixSQL qClustered setups - detectiuery, Command (Active), PathInstance-based or Grouped by version (data dependent)
    WindowsSQL query, Command (Active), Registry, Path
    TNSListenerUnixCommand (Active), PathInstance-based or Grouped by version (data dependent)
    Windows

    Platforms Supported by the Pattern

    The patterns have been created in a manner that allows them to support Windows, Linux and Unix platforms from the same module.

    Identification

    Software Instance Triggers

    ComponentTrigger NodeAttributeConditionArgument
    DatabaseServerDiscoveredProcesscmdmatches

     

    regex'(?:ora|xe)_smon_.+$'
    or

    regex'(?i)\boracle\d*\.exe$'



    TNSListenerDiscoveredProcesscmdmatchesregex'(?i)\btnslsnr(?:\.exe)?$'

    Software Instance type attributes created

    The patterns in this module will set the following value for the type attribute on a SI:

     

     Pattern NameSI type
    DatabaseServerOracle Database Server
    DatabaseServerOracle Database Worker
    TNSListenerOracle Net Services (TNS) Listener

    Simple Identification Mappings

    The following components/processes are identified using the combination of pattern definitions and simple identity mappings.

    • Simple identifiers for DatabaseServer

      NameCommand
      Oracle Advanced Queuing

      \bora_qmn[0-9]_.*$

      Oracle Archiver

      \bora_arc[0-9]_.*$

      Oracle Checkpoint

      \bora_ckpt_.*$

      Oracle Database Automatic Workload Repository Statistics Gatherer Process\bora_mmon_\w+$
      Oracle Database Diagnosability Process\bora_dia\d_\w+$
      Oracle Database Flashback Data Archive\bora_fbda_\w+$
      Oracle Database Lightweight Manageability Tasks Process\bora_mmnl_\w+$
      Oracle Database Job Queue Slave\bora_q\d{3}_\w+$
      Oracle Database Queue Monitor Process\bora_qmnc_\w+$
      Oracle Database PL/SQL Server Process\bora_psp\d_\w+$
      Oracle Database Space Manager\bora_smco_\w+$
      Oracle Database Space Manager Worker Process\bora_w\d{3}_\w+$
      Oracle Database Virtual Time Keeper Process\bora_vktm_\w+$
      Oracle Database Writer

      \bora_dbw[0-9]_.*$

      Oracle Resource Manager\bora_dbrm_\w+$
      Oracle External Job Scheduler

      \bora[Oracle Database^ ]*\bextjob$

      Oracle Job

      \bora_j[0-9][0-9][0-9]_.*$

      Oracle Job Queue Coordinator

      \bora_cjq[0-9]_.*$

      Oracle Log Writer

      \bora_lgwr_.*$

      Oracle MTS Dispatcher

      \bora_d[0-9][0-9][0-9]_.*$

      Oracle MTS Server

      \bora_s[0-9][0-9][0-9]_.*$

      Oracle Parallel Execution

      \bora_p[0-9][0-9][0-9]_.*$

      Oracle Process Monitor

      \bora_pmon_.*$

      Oracle Recovery Process

      \bora_reco_.*$

      Oracle Intelligent Agent\bdbsnmp$
      Oracle Shadow Process

      \boracle[a-zA-Z0-9_]+$

      Oracle System Monitor

      \bora_smon_.*$

      Oracle Net Services (TNS) Listener\btnslsnr$
      Oracle DataPump Export

      \bora[Oracle Database^ ]*\bbin/expdp$

      (?i)\bora[Oracle Database^ ]*\bexpdp\.exe$

      Oracle DataPump Import

      \bora[Oracle Database^ ]*\bimpdp$

      (?i)\bora[Oracle Database^ ]*\bimpdp\.exe$

      Oracle Database Export Utility

      (?i)\bora[Oracle Database^ ]*\bexp\.exe$

      \bora[Oracle Database^ ]*\bbin/exp$

      Oracle External Procedure Agent(?i)\bextproc\.exe$
      \bextproc\w+$
      Oracle Database Import Utility

      (?i)\bora[Oracle Database^ ]*\bimp\.exe$

      \bora[Oracle Database^ ]*\bbin/imp$

      Oracle MTS Recovery Service(?i)\bomtsreco\.exe$
      Oracle Recovery Manager

      (?i)\bora[Oracle Database^ ]*\brman\.exe$

      Oracle Enterprise Manager Website Service(?i)\bnmentsrvc\.exe$
      Oracle Client Cache

      (?i)\bora[Oracle Database^ ]*\bonrsd\.exe$

      (?i)\bora[Oracle Database^ ]*\bonrsd\d\d\.exe$

      Oracle Connection Manager Administration Service

      (?i)\bora[Oracle Database^ ]*\bcmadmin\.exe$

      Oracle Connection Manager Gateway(?i)\bcmgw\.exe$
      Oracle DB Console(?i)\bnmesrvc\.exe$
      Oracle Database Server(?i)\boracle\d\d\.exe$
      (?i)\boracle\.exe$
      Oracle External Job Scheduler

      (?i)\bora[Oracle Database^ ]*\bextjob\.exe$

      Oracle Net Services (TNS) Listener(?i)\btnslsnr\.exe$
      Oracle Web Publishing Assistant(?i)\bowastsvr\.exe$
      Interactive Database client - SQL shell\bsqlplus$
      (?i)sqlplus.exe$
      Graphical Oracle Database client (Windows)(?i)\bsqlplusw\.exe$
    • Simple identifiers for DatabaseServer Express

      NameCommand
      Oracle Database Express System Monitor


      \bxe_smon_.*$

      Oracle Database Express Process Monitor


      \bxe_pmon_.*$

      Oracle Database Express Process-spawner


      \bxe_psp[0-9]_.*$

      Oracle Database Express Memory-manager Process


      \bxe_mman_.*$

      Oracle Database Express Database Writer


      \bxe_dbw[0-9]_.*$

      Oracle Database Express Log Writer


      \bxe_lgwr_.*$

      Oracle Database Express Checkpoint


      \bxe_ckpt_.*$

      Oracle Database Express Recovery Process


      \bxe_reco_.*$

      Oracle Database Express Job Queue Coordinator


      \bxe_cjq[0-9]_.*$

      Oracle Database Express Memory-monitor Process


      \bxe_mmon_.*$

      Oracle Database Express Memory-monitor Light Process


      \bxe_mmnl_.*$

      Oracle Database Express Queue-monitor Processes


      \bxe_qmnc_.*$

      Oracle Database Express MTS Server


      \bxe_s[0-9][0-9][0-9]_.*$

      Oracle Database Express MTS Dispatcher


      \bxe_d[0-9][0-9][0-9]_.*$

      Oracle Database Express MTS Process


      \bxe_q[0-9][0-9][0-9]_.*$

    Versioning

    Oracle Database Server and Oracle Database Server Express (UNIX)

    In case of Oracle Database Server, version information is currently collected using one of four possible methods (sql query, active, registry, path) while in case of Oracle Database Server Express (UNIX) version information is collected using one of 2 possible methods (active, package).

    The methods are tried in an order of precedence based on likely success and/or accuracy of the information that can be gathered. Once a result is obtained, the method lower in precedence is not attempted. In order of precedence the methods are:

    SQL query versioning

    The pattern obtains version information from the SQL query (performed by the core pattern to determine the optimal IP / port information) by means of a regex:


    • (?i)Release\s+(\d+(?:\.\d+)*)

    Active Versioning

    For versions Oracle 18+ the following command is used in order to determine the version:

    • Unix: %ora_home%/bin/oraversion -compositeVersion

    • Windows: %ora_home%\bin\oraversion -compositeVersion

    If the above failed, the method is attempts to run SQLPlus command only if the installation path (ora_home) has been determined:

    • Unix: "echo exit | ORACLE_HOME=%ora_home% %ora_home%/bin/sqlplus /NOLOG"

    • Windows: 'set "ORACLE_HOME=%ora_home%" && echo exit | "%ora_home%\\bin\\sqlplus" /NOLOG'

    The output from this command is then parsed via the regex, " Release\s+(\d+(?:\.\d+)*)

    ", to extract the version string.


    If version prior to Oracle 8 is detected, a code mapping is used to attempt to map the version obtained to the actual Oracle version because such versions are not directly linked to the version of the Oracle Database Server. If this does not succeed, then this approach will not set a version for the product. 

    Note

    The disadvantage of this method is that the user permissions for the account Discovery uses need to allow execution of the SQLPlus binary, and the fact that an assumption is made that the 'oratab' file is being actively maintained with $ORACLE_HOME path being accurate. If installation path is not obtained, versioning will using this method will not be attempted.

    Registry Versioning (Windows only)

    The content of <install_path>/oracle.key file is extracted to give the Oracle Install Key: ( 'HKEY_LOCAL_MACHINE\\'

    + oracle_keyfile.content + '\\').


    Once the Oracle Install Key is known, version_key is obtained from the Windows Registry by searching for "%oracle_install_key%\VERSION"

    .


    Package Versioning (Express Edition, Linux platform only)

    Oracle Database Server Express Edition (available on Unix and Windows) can be installed from the .rpm package only. The host is being queried for the 'oracle-xe-univ' package, and its version parameter provides the full version of product.

    Regular expression used to match the package name is:

    • oracle-xe-univ$

    • oracle-database-

    Active Versioning 2

    Path Versioning

    The Path Regex functionality allows a regular expression to be applied against the process command line to derive a version number from the command path or arguments.

    For Database Server (other than Express Edition) running on a UNIX host the regular expression used is as follows:


    • (?:(?:ora|orcl)[^/]*|(?:ora|orcl)[^ ]*product[^ /]*|/[Pp][Rr][Oo][Dd][Uu][Cc][Tt][s]?|/prod|/oracle)/(1?\d)\.?(\d?)\.?(\d?)\.?(\d?)

    For Database Server Express Edition (UNIX) the regular expression used is as follows::


    • /oracle\S+/(\d+(?:\.\d+)*)

    This path may come from a file or the results of an active command.

    Windows Path Regular Expression:


    • (?i)(?:Oracle|ora|or|product)(?:\\|)(1?\d)\.?(\d?)\.?(\d?)\.?(\d?)

    Versioning is achieved in this caseuptodepth x.x.x depending on the deployment pattern.

    Examples of paths that would be matched and versions extracted are:

    • d:\ora81\bin\ORACLE.EXE - 8.1
    • d:\oracle\product\10.2.0\db_1\bin\ORACLE.EXE - 10.2.0
    • d:\apps\oracle\7.3.3\bin\oracle73.exe - 7.3.3
    • d:\orant\bin\oracle80.exe - 8.0

    TNS Listener

    Versioning is performed using the path versioning approach. The Path Regex functionality allows a regular expression to be applied against the process command line to derive a version number from the command path or arguments.

    The regular expressions used are as follows:

    Unix Path Regex: (?:(?:ora|orcl)[^/]*|(?:ora|orcl)[^ ]*product[^ /]*|/[Pp][Rr][Oo][Dd][Uu][Cc][Tt][s]?|/prod|/oracle|/app)/(1?\d)\.?(\d?)\.?(\d?)\.?(\d?)

    Windows Path Regex: (?i)(?:Oracle|ora|or|product)(?:\\|)(1?\d)\.?(\d?)\.?(\d?)\.?(\d?)


    When these Regular Expressions fail, another multi-platform Regular Expression is employed.

    Multi-platform Regular Expression: (?i)[/\\](\d+(?:\.\d+)+)[/\\]bin[/\\]tnslsnrVersioning is achieved in this case to depth x.x , x.x.x or x.x.x.x - depending on the deployment pattern.

    Examples of paths that would be matched and versions extracted are:

    • /dboracle/orabase/product/9.2.0.7/bin/tnslsnr - 9.2.0.7
    • /u01/app/oracle/product/10.1.0/db_1/bin/tnslsnr - 10.1.0
    • /dboracle/product/8.1.7.4v/bin/tnslsnr - 8.1.7.4
    • /u01/app/oracle/product/9.2/bin/tnslsnr - 9.2

    Note

    These files are viewed using an unprivileged account. It is possible to view them as a privileged user. To do this you must alter the PRIV_CAT variable is the platform scripts

    Alternative Versioning Approach

    Unix/Linux

    Detailed analysis of methods to obtain Oracle RDBMS product version was then undertaken by Engineering and Oracle RDBMS SMEs (internal and customer) and it was concluded that due to the complexity of the product in terms of deployment and configuration, there is no single way to reliably obtain Oracle RDBMS version in all instances.

    Application Model Produced by Software Pattern

    Product Architecture

    An Oracle database server instance comprises a set of operating system processes and memory structures that interact with the storage. Additional to this are client connectivity components which enable database clients to communicate with the database server.

    • Related Processes

    Depending on how Oracle was installed (including licensing restrictions) the processes listed in the table of related processes above may not all be observed on a single host running Oracle RDBMS. Client processes in particular are likely to be running on multiple hosts.

    Configuration Options

    There are a few configuration options available for this product:

    • oratabs :=[ "/etc/oratab", "/etc/oracle/oratab","/etc/opt/oracle/oratab" "/var/opt/oracle/oratab", "/var/opt/unix/oratab", "/shared/opt/oracle/oratab" ]; - List of Oracle oratab locations

    • listener_ora_path := [](""); - List of custom locations to Oracle listener config file (ex: <CUSTOM_PATH>/listener.ora or <CUSTOM_PATH>/<ORA_SID>/listener.ora)

    • default_xe_port := "1521"; - Default listening port - Express edition
    • extended_sql_discovery := true; - Enables sql queries for extended database discovery.
    • oraInst_loc_file_path := [](""); - List of custom locations to Oracle Installer location file  (ex: oraInst_loc_file_path=['/app/product/oracle'] from '/app/product/oracle/oraInst.loc' file location)

    Software Pattern Model

    By default each Oracle Instance has at least one "Oracle Net Services (TNS) Listener" which manages and distributes connections from Oracle client programs to specific "Oracle Database Server" Instance. But in advanced Oracle configurations (in clusters, HA systems etc) it is possible to have many-to-many relations between Oracle Database Servers and TNS Listeners:

    • one Listener could serve a lot of Oracle Instances
    • one Oracle Instance could be served by a lot of Listeners

    DatabaseServer

    The DatabaseServer pattern triggers on either the Oracle System Monitor (ora_smon_<SID> or xe_smon_<SID>) or Oracle Database Server (oracle.exe, oracle73.exe or oracle80.exe) processes to identify an instance of Oracle Database Server.

    TNSListener

    The TNSListener pattern triggers on the Oracle Net Services (TNS) Listener (tnslsnr or tnslsnr.exe) process to identify an instance of TNS Listener.

    SI Depth

    Oracle Database Server

    On Unix the main process present for each instance of an Oracle database is Oracle System Monitor (SMON).

    An instance is also denoted by a SID which is observed on a command-line as the ending of the process name. e.g. ora_smon_SXQ1

    The DatabaseServer pattern definitions use the Oracle System Monitor process (ora_smon_<SID> or xe_smon_<SID>) as the trigger process.

    The instance name is extracted from the command using the following regular expression '(?i)ora_smon_(\S+)'

    (or 'xe_smon_(.+)'for the Express edition). This name is used to create a unique Software Instance (SI).


    The prime process is then collected into a set of all other processes that also have the same SID in their command or command-line arguments (in case of Oracle Net Services (TNS) Listener process).

    On Windows, one or more Oracle Database Server processes are observed on hosts running Oracle RDBMS. Oracle Database instances can in certain cases be inferred from the command-line arguments but this pattern is not always observed and may be linked to the number of database instances being managed. It seems that if only one database instance is being managed, an SID is not required. More research is however required to be certain that this behaviour is correct.

    If the pattern fails to obtain the SID from the command-line arguments, it will attempt to obtain the SID by searching for the Oracle Database Server service that corresponds to the trigger process pid and then extract the SID from the service name using the following regular expression: '(?i)OracleService(\S+)'

    If a SID is not obtained by the pattern a grouped (on version) SI is created in case of Oracle Database Server, while in case of Oracle Database Server Express (UNIX) and SI with a key based on type and host key is created (since only one instance of Express Edition can run on a host).


    TNS Listener

    The TNS Listener pattern will attempt to extract the Oracle database SID from the command-line arguments of the trigger process and use that to create a unique Software Instance (SI).

    If a SID is not obtained by the pattern a grouped (on oracle installation path extracted from the trigger process) SI is created.

    Cluster Awareness in BMC Discovery 11.x series

    For BMC Discovery 11.x, cluster awareness has been incorporated into the pattern module. This means that a clustered Oracle Database Server Software Instance will be linked to the Cluster node that is logically hosting the Software Instance rather than the host it is directly running on. In addition, the SI key will be altered to include global_db_name in place of ora_sid. Oracle Database Server Software Instance "instance" attribute may be updated. Starting from TKU May 2019 a new Oracle Database Worker SI node type will be created. Oracle Database Worker represents the SI running locally on the host and it will be linked to the clustered Oracle Database Server Software Instance.

    Relationship Creation

    A communication relationship is created between the Oracle Database Server and the Oracle Net Services (TNS) Listener (with exception of Oracle Database Express Edition on either Windows or Unix platform).

    This relationship is modeled both from the DatabaseServer and the TNSListener patterns.

    The DatabaseServer pattern then tries to associate all other related Oracle processes, running on the same host, to the SI.

    NOTE: We cannot determine appropriate (TNS) Listener for the Express Edition of Oracle Database Server, as the command line doesn't contain any attributes.

    Modelling Oracle distributed database system

    In order to represent architecture of homogeneous distributed database system, which is a network of two or more Oracle Databases that reside on one or more machines, the pattern creates a client-server communication link between Oracle SIs which form such system.

    The central concept in distributed database systems is a database link which is a connection between two physical database servers that allows a client to access them as one logical database. The pattern tries to obtain a list of defined database links to other Oracle databases by means of SQL query:

    "SELECT host FROM dba_db_links ORDER BY host"

    where "host" column could be:

    • jdbc-like connection string, example: some.host.name:1451/SOMESID, then connection information is extracted using regexes:
      • linked_ora_host: regex '^(\S+?)[:/]'

      • linked_ora_port: regex ':(\d+)'

      • linked_ora_sid: regex '/(\S+)$'

    • the "net service name" of remote database. Pattern searches related section for each "net service name" in <ORACLE_HOME>/network/admin/tnsnames.ora

      file and obtains the following information from each found section:


      • linked_oracle_host: regex '(?i)HOST\s*=\s*([^\s\)]+)'

      • linked_oracle_service: regex '(?i)SERVICE_NAME\s*=\s*([^\s\)]+)'

      • linked_oracle_sid: regex '(?i)SID\s*=\s*([^\s\)]+)'

    • tnsname-like connection string, example: (DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP) (HOST=some.host.name)(PORT=1485))) (CONNECT_DATA=(SERVICE_NAME=SOMESID)))
      • linked_oracle_host: regex '(?i)HOST\s*=\s*([^\s\)]+)'

      • linked_oracle_service: regex '(?i)SERVICE_NAME\s*=\s*([^\s\)]+)'

      • linked_oracle_sid: regex '(?i)SID\s*=\s*([^\s\)]+)'

    Then pattern creates a link to each Oracle SI with attribute service_name = <linked_si_service>

    on host <linked_si_host>.

    Oracle E-Business Suite

    The Oracle Database Server pattern raises a flag when acting in an Oracle E-Business Suite environment. This flag is stored in the Oracle Database Server SI as the ebs_suite attribute.
    The way the pattern determines whether it has discovered and instance of Oracle Database Server running as part of E-Business is to search for any TNS Listener process where its command-line args match a regular expression APPS_<ora SID> where <ora SID> is this Database Server SID.
    The flag is then checked for later in the pattern in order to determine the correct path to listener.ora file, as this path is different for Database Servers running as a component of Oracle E-Business.

    Discovery of important SI attributes

    SID (Instance name)

    The database SID (instance name) is initially extracted from the trigger process command line arguments by using a regular expression, which varies depending on Operating System:

    • Windows:
      • from process.args using regex '(\S+)'

      • from Windows Service Name which starts 'oracle.exe' process: regex '(?i)OracleService(\S+)'

    • Unix:
      • fromprocess.cmd using regex '(?i)ora_smon_(\S+)'

    NOTE: Oracle SID for Windows is always stored in upper case.

    The pattern extracts service  name from the JDBC connection. The database name is used as service name, if the connection string matches the following regular expression:

    • regex·'jdbc:oracle:(?:thin|oci8?):(?:.*?)@/?/?[^/]*/'

    Otherwise, the service name is extracted using the following regular expression:

    • regex "jdbc:oracle:thin:@\(DESCRIPTION\s*=.*SERVICE_NAME\s*([^\s\)]+)"

     ORACLE_HOME (installation path)

    This method is employed for the DatabaseServer pattern and uses these possible approaches.

    • Windows:
      1. From process.cmd using regex "(?i)^(\w:.+)\\bin\\oracle"


      2. From command line of Windows Service which starts 'oracle.exe' process: regex "(?i)^(\w:.+)\\bin\\\w\.exe"
      3. From listener.ora file. This approach works only if related Oracle Net Services (TNS) Listener is found and has listener_ora_file_path and Oracle SID is known.


    4. From the TNS Listener SI - This approach is used only in the Oracle Database Server pattern if the pattern has failed to obtain the Oracle DB Server installation path via the direct method described above. Pattern searches for SI of "Oracle Net Services (TNS) Listener" which serves its Oracle SID and obtains ORACLE_HOME only if one Listener SI is found.

    • Unix:
      1. from process.cmd using regex "(?i)^(/.+)/bin/ora_smon_"


      2. from oratab file: the pattern tries to open a file called 'oratab' by searching through a list of potential (user configurable) locations for it:


      • /etc/oratab
      • /var/opt/oracle/oratab
      • /var/opt/unix/oratab
      • etc/oracle/oratab
      • etc/opt/oracle/oratab
      • shared/opt/oracle/oratab

    Note

    These files are typically viewed using an unprivileged account (Discovery login account). It is possible to view them as a privileged user. To do this you must alter the PRIV_CAT variable in the platform scripts

    If the 'oratab' file is located, the file is parsed for the database with the SID in the process command-line via the following regular expression: "(?m)^\s*%norm_ora_sid%:([^:]+):(?:[YNW])?"

    Note

    In clustered environments db_unique_name is used instead of SID

    3. Using pmap command (Solaris and Linux)
    On certain Unix platforms (Solaris and Linux), the pmap command can be used against the process id (pid) of the 'oracle' process:

    <path_to_pmap>/pmap %process.pid% | awk '{print $4}' | grep '/oracle$' | uniq

    Oracle installation path is then extracted using one of the following regular expressions:

    • For Database Server: \W(/[^ ]*/)bin/oracle\W

    • For Database Express: \(/\S*)/bin/oracle\W

    Note

    This approach works only in cases where the appliance has credentials that give the logged-in user elevated privileges via privilege escalation mechanism (e.g. 'sudo'). The approach is disabled by default due to the above requirement (majority of installations do not provide these level of privileges to the account used by the Discovery appliance).

    To enable this approach:
    1. Both the priv_execution and pmap_enabled options in the configuration section should be set to 'true'.
    2. The PRIV_RUNCMD function should be defined in the appropriate platform scripts to invoke the privilege escalation (e.g. through the use of 'sudo' or 'suexec') on the hosts being scanned.
    3. The pmap_path option in the configuration section may be modified to point to an alternative path (the default being /usr/bin/pmap) for an instance of 'pmap' on the hosts being scanned

    4. From listener.ora file. This approach works only if related Oracle Net Services (TNS) Listener is found and has listener_ora_file_path attribute and Oracle SID is known.

    5. From the TNS Listener SI - This approach is used only in the Oracle Database Server pattern if the pattern has failed to obtain the Oracle DB Server installation path via the direct method described above. Pattern searches for SI of "Oracle Net Services (TNS) Listener" which serves its Oracle SID and obtains ORACLE_HOME only if one Listener SI is found.

    Determining the port and IP the database is listening on - listen_tcp_sockets

    The patterns use the following approach to obtain the port and IP (if specifically set) the database server is listening on:

    • Listener SI obtains the list of all tcp sockets (attr:'listen_tcp_sockets') and the list of served Oracle Instances (attr:'served_oracle_instances'):
      • from: command "lsnrctl status <LISTENER_NAME>"


        or


      • from: file 'listener.ora', which could be located in:

        • <ORACLE_HOME>/network/admin/listener.ora

          - default installation



        • <ORACLE_HOME>/network/admin/<ORA_SID>_<SHORT_HOSTNAME>/listener.ora

          - Oracle with E-Business Suite



        • <ORACLE_HOME>/network/admin/<ORA_SID>/listener.ora

          - Oracle with E-Business Suite



        • <ORACLE_BASE>/<ORA_SID>/listener.ora

          - Oracle with Oracle Active Data Guard



        • <LISTENER_DIR_PATH_CUSTOM>/listener.ora


        • <LISTENER_DIR_PATH_CUSTOM>/<ORA_SID>/listener.ora

          , where <LISTENER_DIR_PATH_CUSTOM>is configured in pattern configuration section


    • Oracle SI populates information from 'listen_tcp_sockets' attribute of all Listener SIs which serve it.
      Here is an example of the process of obtaining listening tcp sockets:

    Note

    updated OracleRDBMS pattern tries to resolve all named addresses to IP addresses, like for example 'host_alias' being resolved to '192.168.1.10' in the example above

    Obtaining the Global DB Name (global_db_name)

    The pattern uses the following methods for obtaining Oracle 'service_names' and 'global_db_name':

    • In clustered environment pattern obtains <db_unique_name> from from output of command '<crs_home>/bin/crs_stat -v'

      by means of regexes:


      • for Oracle RAC 11: '(?i)^ora\.([^\.]+)\.db'

        against the configuration section corresponding to current <ORA_SID>.


      • for Oracle RAC 10: '(?i)NAME=ora\.([^\.]+)\.<ora_sid_norm>\.inst'


        then pattern run the following command to receive full information about Oracle RAC:



      • ORACLE_HOME=<ora_home>; export ORACLE_HOME; ulimit -c 0 && <ora_home>/bin/srvctl config database -d <db_unique_name>

        and tries to obtain from output <db_domain> and <service_names>


    • From - Oracle Server Parameter File (SPFILE):
      • for Unix:

        1. PRIV_CAT <ORACLE_HOME>/dbs/spfile<ORACLE_SID>.ora | egrep '(db_name|db_unique_name|db_domain)'


        2. PRIV_CAT <ORACLE_HOME>/dbs/init<ORACLE_SID>.ora | egrep '(db_name|db_unique_name|db_domain)'

      • for Windows:

        1. cmd /C findstr "db_name db_unique_name db_domain" "<ORACLE_HOME>\\database\\spfile<ORACLE_SID>.ora"


        2. cmd /C findstr "db_name db_unique_name db_domain" "<ORACLE_HOME>\\database\\init<ORACLE_SID>.ora"


        3. cmd /C findstr "db_name db_unique_name db_domain" "<ORACLE_HOME>\\dbs\\spfile<ORACLE_SID>.ora"

    Obtaining the Oracle Service Names (service_names) and service_name

    Service_names attributes consists of the values in the following order:

    • 1. global_db_name (if its in the list of service_names obtained from Listeners)
    • 2. service_names obtained from related Listener 'sid_to_service_map' attribute (if 'lsnrctl status' command was used).
    • 3. global_db_name (if its not in the list of service_names obtained from Listeners)
    • 4. from spfilexxx.ora or initxxx.ora files (if related command was used)
    • 5. from output of ORACLE_HOME=<ora_home>; export ORACLE_HOME; ulimit -c 0 && <ora_home>/bin/srvctl config database -d <db_unique_name>

      command for clustered Instances

    Note

    To run the SRVCTL command successfully, its version must be the same as the version of the Database. So it is recommended to run it from <ora_home>\bin. The user, which runs the command, should be in software owner's group.

    Service_name is the first element in <service_names> list.

    Global_db_name, service_names and service_name usage explanation

    Each attribute has its own purpose despite it looks like attributes could duplicate each other,

    • global_db_name (<db_unique_name>.<db_domain>) - is used for unique Oracle RAC identification and for running commands for Oracle RAC
    • service_names (with <global_db_name> and all additional services) - is used for search queries in another patterns.
    • service_name (<service_names>) - is used for SQL queries, since this first element should be taken from Listeners and thus guarantee that Oracle Lisnteners is aware of such <service_name> to accept incoming SQL connection.

    Obtaining Net Service Names (net_service_names)

    The pattern obtains all 'net service names which are set up in local Oracle client ( <ORACLE_HOME>/network/admin/tnsnames.ora

    ), which are pointed to local Oracle SI (by SID or by service_name). Each net service name is obtained by regex:



    • (?is)\n\s*([^\s\(\)]+)\s*=\s*\(\s*DESCRIPTION

      from the section in 'tnsnames.ora' file which matches regexes:


    • for SID: (?is)SID\s*=\s*<ORACLE_SID>[\s|\)]

    • for Service_name: (?is)SERVICE_NAME\s*=\s*<Service_name>[\s|\)]

      • if Service_name is not known then "<ORACLE_SID>.world" is used instead.

    Clustered setups - detection

    The pattern uses the following methods for finding evidence that current oracle instance is configured in a clustered setup

    • Unix: pattern searches for the process: 'ora_lmon_<ora_sid>'
    • Windows: pattern tries to run the command ' <crs_home>/bin/crs_stat -v

      ' and looks for a string which matches regex: (?i)USR_ORA_INST_NAME@SERVERNAME\([^\)]+\)=%ora_sid_norm%\s, where <crs_home>is taken from Oracle Clusterware SI running on this host.


    If a clustered setup is detected, the Oracle Database SI has the 'clustered' attribute set to 'true'.

    Rac_host_nodes 

    Pattern tries to obtain the list of host nodes on which current Oracle RAC resides and for which current instance is part of using command <crs_home>/bin/crs_stat -v

    where pattern obtains list of related host nodes names from section correspondent for current Oracle SID using regex:


     regex '(?i)GEN_USR_ORA_INST_NAME@SERVERNAME((\S+))='

    In order to make this list equal on all hosts it is additional sorted.


    Obtaining edition information

    Edition information is obtained using the following methods:

    • SQL query (Unix/Windows):
      The pattern obtains edition information from an SQL query (performed by the core pattern to determine the optimal IP / port informationby means of a regex:

      • (?i)(\S+)\sEdition

    • Registry query (Windows):
      On Windows-based systems, a specific registry key is parsed within the main Oracle RDBMS pattern in order to obtain the edition. The key accessed is:

      • HKEY_LOCAL_MACHINE\SOFTWARE\ORACLE\<Oracle service key>\ORACLE_BUNDLE_NAME

    • Active Command

    Get edition information for Oracle 11.2 and above from "<ora_home>/inventory/response"

    directory:


    • file name in "<ora_home>/inventory/response"

      directory:


      • Windows: dir "<ora_home>\\inventory\\response"

      • Unix: "PRIV_LS <ora_home>/inventory/response"


        (where file names examples: oracle.server_EE.rsp or oracle.server_SE.rsp or oracle.server_PE.rsp or oracle.crs_Complete.rsp)
        output is then parsed by regex: (?i)oracle\.(?:server|crs)_(\S+)\.rsp


    • if no 'valid' edition was extracted, then its obtained from content of the file <ora_home>/inventory/response/oracle.crs_Complete.rsp

      (content examples oracle_install_db_InstallEdition="EE" or "STD"/"SE" or "PE"),


      • Windows: 'findstr oracle_install_db_InstallEdition "<ora_home>\\inventory\response
        <rsp_file_name>"');
      • Unix: "PRIV_CAT <ora_home>/inventory/response/<rsp_file_name> | grep oracle_install_db_InstallEdition"
        by means of regex '(?i)oracle_install_db_InstallEdition="(\S+)"'

    Get edition information for Oracle 11.1.X and below from '<ora_home>/inventory/Components21/oracle.rdbms/<version_subdir>/context.xml'

    file:


    First we need to know exactly name of the directory where 'context.xml' resides

    • <version_subdir> is obtained from directory listing, if more than one directory is found, then the highest version is used:
      #1: PRIV_LS <ora_home>/inventory/Components21/oracle.rdbms


      #2: PRIV_LS <ora_home>/inventory/Components21/oracle.server

    then pattern run the following commands, which extracts lines from context.xml file where edition information is stored:


    • 'PRIV_CAT <ora_home>/inventory/Components21/oracle.server/<version_subdir>/context.xml | grep -w s_serverInstallType'

    if no or 'Custom' edition is extracted then:


    • 'PRIV_CAT <ora_home>/inventory/Components21/oracle.rdbms/<version_subdir>/context.xml | grep -w s_nameOfBundle'

    then, Edition is extracted using regex: 'VAL="(\S+)"'


    In all cases, edition information is only recorded if it can be fully determined. Quite often, the edition information is set to 'Custom' in the context.xml file and this is done by the Oracle installation script if the defaults of creating a database are not followed but a custom installation is performed. In those cases, edition information is not stored in the Software Instance.


    The method detailed abovecannot howeverbe used to identify Oracle RDBMS Express Edition. A separate pattern has been created to identify this edition as the trigger process is different (and distinct) - it is xe_smon_<SID>

    .
    In addition to this, Express Edition has 'XE' as its SID, the only one available for the installation; therefore, 'Express' edition can always be positively determined and the 'edition' attribute set.


    Extended Database Discovery

    Determining optimal port and listening address to query

    In order to perform extended database discovery the Oracle Database pattern has to collect 'listen_tcp_sockets' information from all TNS Listeners which serve current Oracle SID and obtain Oracle "service_name" information.

    The pattern then tries to run the following SQL query on each combination of found listen tcp socket AND ( Oracle SERVICE or Oracle SID):

    SELECT banner FROM v$version WHERE banner LIKE 'Oracle%'

    Once the query successfully run, pattern stores information of successful query into attribute "success_login_credential", examples:

    • success_login_credential := [method, port, ip, service_name]

      where method = 'sid' or 'service'

    This information is used by all associated patterns which run SQL queries against the Oracle Database Server allowing them not to run those queries against all possible pairs of listen tcp sockets AND ( Oracle SID or Oracle SERVICE ).

    Note

    Running of this SQL query is enabled by default! Disabling this SQL query by setting 'false' value for 'extended_sql_discovery' variable in pattern configuration section disables this feature for all associated patterns which run SQL queries against the Oracle Database Server

    The list of affected patterns:

    Extended database discovery - Oracle Database schema and table information

    A separate pattern has been created to query the Oracle Database in order to obtain schema and (optionally) database table details. For more information about this pattern, please refer to the relevant page

    Discovering Oracle Database options / features

    Listing Oracle Database Installed Options

    A separate pattern is used to identify and model a selection of Installed Options in the Oracle Database. For more information on this approach, please refer to the relevant page.

    Listing Oracle Management Packs

    A separate pattern is used to identify and model a selection of Management Packs in the Oracle Database. For more information on this approach, please refer to the relevant page.

    Identification of Oracle Pro*C installation

    A pattern to identify and model Oracle Pro*C pre-compiler (installed as an optional component of Oracle Database) has also been developed. For more information about this pattern, please refer to the relevant page.

    Subject Matter Expertise

    The set of simple identifiers for Oracle RDBMS running on Unix/Linux hosts, including approaches used to version the product have been developed from local knowledge on Oracle RDBMS as well as with input from JPMC SMEs.

    Testing

    Unix/Linux

    Testing to ensure the processes related to Oracle RDBMS have been correctly identified has been performed using Discovery record data from hosts running Solaris,AIXand Linux operating systems.

    Record data contained enough information to extract the version information using the Regex Path versioning approach.

    In addition to this, active version command approach was developed and initially evaluated both on in-house Oracle RDBMS installations and on customer sites. The approach taken was shown to work well, provided the environment conditions that this approach requires were met.

    Testing to ensure the processes related to Oracle RDBMS Express Edition have been correctly identified has been performed against in-house Oracle RDBMS Express installations running on Linux hosts.
    Product version obtained using active command approach, package query and path regex was proven to work.

    Windows

    Testing to ensure the processes related to Oracle RDBMS have been correctly identified has been performed using both Discovery Record data and in-house Oracle RDBMS installations.

    Path Regex versioning approach was also tested against both in-house Oracle RDBMS installations and Discovery Record data and was deemed to work well unless constrained by the data returned from the hosts (e.g. Discovery typically cannot obtain process command-line on hosts running Windows NT or Windows 2000 Server. This limitation no longer exists on hosts running Windows XP or Windows 2003 server).

    Testing to ensure the processes related to Oracle RDBMS Express Edition have been correctly identified has been performed against in-house Oracle RDBMS Express installations running on Windows hosts.
    Product version obtained using active command approach, package query and path regex was proven to work.

    Information Sources

    Oracle Version Numbering
    Oracle Database distributed database architecture

    Open Issues

    On some specific Oracle Enterprise Linux hosts running the "opatch lsinventory" command with insufficient privileges may cause the command hanging on the appliance.
    You need to scan the host with the appropriate privileges in order to avoid this behavior.
    A workaround was added in TKU October 2015 to remove the hanging process for Oracle Enterprise Linux 6.0+.

    srvctl command to get the database information may cause Java dumps on Oracle Database 12.2 running on AIX 7.1.


    Created by: Rebecca Shalfield 30 Oct 2007
    Updated by: Dmytro Ostapchuk 26 Nov 2015