Loading

Oracle Integration

Serverless Observability Serverless Security Stack 9.0.0

Version 1.31.1 (View all)
Subscription level
What's this?
Basic
Developed by
What's this?
Elastic
Ingestion method(s) Database, File

Use the Oracle integration to ingest Oracle Database audit logs and collect database metrics for operational visibility and troubleshooting.

This integration has been tested with Oracle Database 19c, and should work for 18c as well though it has not been tested.

This integration collects:

  • Audit logs from Oracle Database audit trail files.
  • Metrics covering tablespace usage, system metrics, memory, system statistics, and performance.
Note

The Oracle integration expects an *.aud audit file that is generated from Oracle Databases by default. If disabled, refer to the Oracle Database Audit Trail Documentation.

Connectivity to Oracle can be facilitated in two ways: by using official Oracle libraries, or by using a JDBC driver. Connectivity through JDBC is currently not supported with Metricbeat.

To get connected with the Oracle Database, you must set the following environment variables: ORACLE_SID, ORACLE_BASE, ORACLE_HOME.

For example, let’s consider Oracle Database 21c installation using RPM manually by following the Oracle Installation instructions. The environment variables should be set as follows:

  • ORACLE_SID=ORCLCDB
  • ORACLE_BASE=/opt/oracle/oradata
  • ORACLE_HOME=/opt/oracle/product/21c/dbhome_1

Also, add $ORACLE_HOME/bin to the PATH environment variable.

  1. In Kibana, go to Management > Integrations.
  2. In the "Search for integrations" search bar, type Oracle.
  3. Click the Oracle integration from the search results.
  4. Click the Oracle button to add the integration.
  5. Configure:
    • Logs (audit trail): point the Elastic Agent filestream input to the Oracle audit file location (*.aud).
    • Metrics (SQL input): provide an Oracle DSN.
  6. Click Save and Continue to save the integration.

Oracle Instant Client (OCI) enables development and deployment of applications that connect to Oracle Database. The Instant Client libraries provide the necessary network connectivity and advanced data features to make full use of Oracle Database. If you have OCI Oracle server which comes with these libraries pre-installed, you don't need a separate client installation.

The OCI library installs few Client Shared Libraries that must be referenced on the machine where Metricbeat is installed. To set up the OCI Instant Client, follow the Oracle Client Installation instructions. The OCI Instant Client is available with the Oracle Universal Installer, RPM file or ZIP file that you can download from the Oracle Instant Client Download page.

If Elastic Agent is running as a systemd service and not using ldconfig is an option, to update the links to the shared libraries, you can use the LD_LIBRARY_PATH environment variable. Follow these steps to make sure that Elastic Agent and its spawned processes respect the LD_LIBRARY_PATH environment variable.

Note

Make sure that you have administrative privileges to modify the Elastic Agent systemd service configuration.

  1. Check the status of the Elastic Agent systemd service by running the following command: systemctl status elastic-agent.service Take note of the path to the elastic-agent.service file, which is typically located in the systemd service directory. Example path: /etc/systemd/system/elastic-agent.service

  2. Open the elastic-agent.service file in your preferred text editor, find the EnvironmentFile key (commonly found at /etc/sysconfig/elastic-agent), and verify its contents, as these configurations are essential for the elastic-agent's runtime environment initialization. If the EnvironmentFile is absent, create it and set the necessary permissions to ensure the elastic-agent has full access.

  3. Add the LD_LIBRARY_PATH environment variable to the configured EnvironmentFile. Set it to the directory where libraries (libclntsh.so) are located. For example, if your libraries are in the /opt/oracle/instantclient_21_1 directory, add the following line to the EnvironmentFile (i.e. /etc/systemd/system/elastic-agent.service)

    LD_LIBRARY_PATH=/opt/oracle/instantclient_21_1

  4. Save the changes made to the configured EnvironmentFile.

  5. Restart the Elastic Agent systemd service to apply the changes by running the following command:

    systemctl restart elastic-agent.service

Note

Make sure that you replace /opt/oracle/instantclient_21_1 with the actual path to the directory where the required libraries (libclntsh.so) are located. This will set the library search path for the Elastic Agent service to include the specified directory, allowing it to locate the required libraries.

The Oracle listener is a service that runs on the database host and receives requests from Oracle clients. Make sure that Listener is running by using this command:

lsnrctl STATUS

If the listener is not running, use the command to start:

lsnrctl START

Then, you can launch Metricbeat.

The following two configuration formats are supported:

oracle://<user>:<password>@<connection_string>
user="<user>" password="<password>" connectString="<connection_string>" sysdba=<true|false>
		

Example values are:

oracle://sys:Oradoc_db1@0.0.0.0:1521/ORCLCDB.localdomain?sysdba=1
user="sys" password="Oradoc_db1" connectString="0.0.0.0:1521/ORCLCDB.localdomain" sysdba=true
		

In the URL-based format, special characters should be URL encoded.

In the logfmt-encoded DSN format, if the password contains a backslash character (\), it must be escaped with another backslash. For example, if the password is my\_password, it must be written as my\\_password.

Note

To mask the password shown in the DSN, remove the username and password from the DSN string, and configure the DSN to only include the host address and any additional parameters required for the connection. Subsquently, use the username and password fields under advanced options to configure them.

To configure Oracle Integration to connect to databases using TLS ports, configure the connection string using this format:

user="elastic_ro" password="" connectString="(DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCPS)(HOST=0.0.0.0)(PORT=1832))) (CONNECT_DATA = (SERVICE_NAME = THESERVICENAME)))" sysdba=false
		

The database_audit dataset collects Oracle Audit logs.

ECS Field Reference

Refer to the following document for detailed information on ECS fields.

Tablespace metrics describes the tablespace usage metrics of all types of tablespaces in the oracle database.

Tablespace metrics also describes extended space of all type of tablepaces.

To collect the Tablespace metrics, Oracle integration relies on a specific set of views. Make sure that the user configured within the Oracle DSN configuration has READ access permissions to the following views:

  • SYS.DBA_DATA_FILES
  • SYS.DBA_TEMP_FILES
  • DBA_FREE_SPACE
  • DBA_TABLESPACE_USAGE_METRICS
  • DBA_TABLESPACES

ECS Field Reference

Refer to the following document for detailed information on ECS fields.

The system metrics value captured for the most current time interval for the long duration (60-seconds) are listed in the following table.

To collect the Sysmetrics metrics, Oracle integration relies on a specific set of views. Make sure that the user configured within the Oracle DSN configuration has READ access permissions to the following view:

  • V$SYSMETRIC

ECS Field Reference

Refer to the following document for detailed information on ECS fields.

A Program Global Area (PGA) is a memory region that contains data and control information for a server process. It is nonshared memory created by Oracle Database when a server process is started. Access to the PGA is exclusive to the server process. Metrics concerning Program Global Area (PGA) memory are mentioned below.

To collect the Memory metrics, Oracle integration relies on a specific set of views. Make sure that the user configured within the Oracle DSN configuration has READ access permissions to the following views:

  • V$SGASTAT
  • V$PGASTAT

ECS Field Reference

Refer to the following document for detailed information on ECS fields.

The System Global Area (SGA) is a group of shared memory structures that contain data and control information for one Oracle Database instance. Metrics concerning System Global Area (SGA) memory are mentioned below.

To collect the System Statistics metrics, Oracle integration relies on a specific set of views. Make sure that the user configured within the Oracle DSN configuration has READ access permissions to the following view:

  • V$SYSSTAT

ECS Field Reference

Refer to the following document for detailed information on ECS fields.

Performance metrics give an overview of where time is spent in the system and enable comparisons of wait times across the system.

To collect the Performance metrics, Oracle integration relies on a specific set of views. Make sure that the user configured within the Oracle DSN configuration has READ access permissions to the following views:

  • V$BUFFER_POOL_STATISTICS
  • V$SESSTAT
  • V$SYSSTAT
  • V$LIBRARYCACHE
  • DBA_JOBS
  • GV$SESSION
  • V$SYSTEM_WAIT_CLASS

ECS Field Reference

Refer to the following document for detailed information on ECS fields.

This integration includes one or more Kibana dashboards that visualizes the data collected by the integration. The screenshots below illustrate how the ingested data is displayed.