Oracle DB health

  • Last Updated 3/31/2023, 12:34:01 PM UTC
  • About 3 min read

Plugin info

name: ora-db-health

Collects health information for instance, root database and PDBs:

  • instance status, enum of UNAVAILABLE, STARTED, MOUNTED, OPEN , OPEN MIGRATE
  • root database open mode, enum of MOUNTED, READ WRITE, READ ONLY, READ ONLY WITH APPLY
    • dimensions:
      • database role, enum of SNAPSHOT STANDBY, LOGICAL STANDBY, PHYSICAL STANDBY, PRIMARY, FAR SYNC
  • root database restricted access, true/false
    • dimensions:
      • database role, enum of SNAPSHOT STANDBY, LOGICAL STANDBY, PHYSICAL STANDBY, PRIMARY, FAR SYNC
  • for each PDB excluding PDB$SEED:
    • open mode, enum of MOUNTED, READ WRITE, READ ONLY, READ ONLY WITH APPLY
      • dimensions:
        • database role, enum of SNAPSHOT STANDBY, LOGICAL STANDBY, PHYSICAL STANDBY, PRIMARY, FAR SYNC
    • restricted access, true/false
      • dimensions:
        • database role, enum of SNAPSHOT STANDBY, LOGICAL STANDBY, PHYSICAL STANDBY, PRIMARY, FAR SYNC

# UNAVAILABLE status

An instance is reported as unavailable when not able to connect over BEQ with one of the following errors:

  • ORA-01033, ORACLE initialization or shutdown in progress
  • ORA-01034, ORACLE not available
  • ORA-01088, shutdown in progress - operation not permitted until restart
  • ORA-01089, immediate shutdown or close in progress - no operations are permitted
  • ORA-01090, shutdown in progress - connection is not permitted
  • ORA-01092, ORACLE instance terminated. Disconnection forced
  • ORA-27101, shared memory realm does not exist

All other errors are reported as plugin run errors.

# Metric source FQDNs

  • Instance, configuration source param if present or sid
  • Root database, configuration source param if present or sid
  • PDB, <pdb name>.<instance source fqdn>

# Prerequisites

  • Linux
    • User Groups: oinstall, dba
  • Windows
    • Group Memberships: ORA_HOMENAME_DBA

Important, the connection to the database/ASM takes place over BEQ. This means that the process resource limits for myrmex-ad must match those set for the oracle database/ASM processes. Set these limits in the systemd unit file for myrmex-ad and then reload and restart the myrmex-ad service. Refer to https://www.man7.org/linux/man-pages/man5/systemd.exec.5.html#PROCESS_PROPERTIES (opens new window) for the process limit directives and their ulimit equivalents.

# Metrics

  • oracle/db/instance/status
  • oracle/db/database/[role:database role]/open_mode
  • oracle/db/database/[role:database role]/restricted

# Configuration

Plugin is configured with a yaml file:

  • oracle_home: path to ORACLE_HOME
  • source: the value that will appear as the source of metrics generated by this configuration. defaults to plugin hostname
  • timeout: execution timeout in duration format (opens new window). Defaults to 10s
  • sid: database SID
  • connect_as: (optional) one of sysdba, sysoper, sysasm. Default is sysdba

# Example Configuration

oracle_home: /u01/app/oracle/product/12.2.0.1/dbhome_1
sid: my_sid
source: my_sid.db.prod

# Validate Configuration

ora-db-health --run-conf /path/to/config/file.yaml --validate

# Testing

Run the plugin from the command line and get any emitted metrics on stdout

ora-db-health --run-conf /path/to/config/file.yaml

# List metrics emitted by this plugin

ora-db-health --metrics
Last Updated: 3/31/2023, 12:34:01 PM