Oracle DB restart

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

Plugin info

name: ora-db-start

Starts oracle instances when down and emits events for the start process result.

WARNING: This plugin should not be used on RAC deployments. You should install and use Oracle Restart and its associated utilities.

# Prerequisites

  • Linux
    • User Groups: oinstall, dba
  • Windows
    • Group Memeberships: 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.

# Event Subscriptions

  • myrmex/ora-db-status/sid/down

# Events

  • myrmex/ora-db-start/sid/already_running set to 1 when instance was found to be running while attempting to start it
    • Dimensions
      • sid the database SID
  • myrmex/ora-db-start/sid/started set to 1 when instance was successfully started
    • Dimensions:
      • sid the database SID
  • myrmex/ora-db-start/sid/error set ot 1 when instance failed to start
    • Dimensions:
      • sid the database SID
  • myrmex/plugins/error/plugin/msg set to error message on plugin execution failure
    • Dimensions
      • plugin the name of the plugin that failed

# Configuration

Plugin is configured with a yaml file:

  • instances: list of databases start confs that this plugin can start
    • 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 2m
    • oracle_home: path to database sid ORACLE_HOME
    • sid: the database SID
    • connect_as: (optional) one of sysdba, sysoper, sysasm. Default is sysdba
    • role: primary or standby
    • standby_type: dataguard, manual. if role is standby
    • ASM: if using ASM set the oracle_home and sid of the ASM instance
      • oracle_home: path to ASM ORACLE_HOME
      • sid: ASM SID
      • connect_as: (optional) one of sysdba, sysoper, sysasm. Default is sysdba

# Example Configuration

# list of databases start confs that this plugin can start
instances:
    # path to oracle_home for this sid
  - oracle_home: /u01/app/oracle/product/12.2.0.1/dbhome_1
    sid: suwpdb1
    # primary or standby. default is primary
    role: primary
    # dataguard, manual. if role is standby
    #standby_type: 
    # if using ASM set the oracle_home and sid of the ASM instance 
    ASM:
     oracle_home: /u01/app/12.2.0.1/grid
     sid: +ASM1

# Validate Configuration

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

# Testing

Run the plugin from the command line to start one or more instances

ora-db-start --run-conf /path/to/config/file.yaml --run-events/path/to/sid/down/events.json

# Example test event file

[
    {
        "namespace": [
            {
                "value": "myrmex"
            },
            {
                "value": "ora-db-status"
            },
            {
                "name": "sid",
                "value": "suwpdb1"
            },
            {
                "value": "down"
            }
        ],
        "timestamp": "2019-05-10T18:25:43.511Z",
        "data": 1
    }
]

# List events emmited by this plugin

ora-db-start --events
Last Updated: 3/31/2023, 12:34:01 PM