DMK Oracle
release_2.2.0
release_2.2.0
  • Introduction
  • Release 2 note
  • ⚙️Installation and configuration
    • Installation & Upgrade & De-installation (Unix)
    • Installation & Upgrade & De-installation (Windows)
    • Functionalities & Features
    • Advanced Configuration
    • Variables and aliases
    • Migration to DMK
  • 🗄️Structure
    • Structure
    • Oracle Grid Infrastructure & DMK
    • Oracle Database Multitenant – DMK features
  • 📃Scripts
    • Status script
    • O.S Start/Stop script integration
      • O.S Start/Stop script integration until Red Hat/Oracle Linux 6
      • O.S Start/Stop script integration since Red Hat/Oracle Linux 7
    • dmk.sh / dmk-core.pl
    • service_start_stop.ksh
    • database.ksh
    • db_crs.ksh
    • listener.ksh
    • listener_vcs.ksh
    • fsdisc.ksh
    • emctlagent.ksh
    • emctlgrid.ksh
    • opmnctl.ksh
    • goldengate.ksh
    • dgobserver.ksh
    • version.ksh|version
    • housekeeping.{ksh|cmd }
    • odiagentctl.{ksh}
    • Libraries
      • DMK_ENV.pm
      • DMK_STATUS.pm
  • ℹ️Appendix
  • 🧩Extension
    • dmk_dbbackup
      • Introduction
      • Release notes
      • Installation
      • Functionalities & Features
      • Structure
      • dmk_rman.{ksh|cmd}
      • dmk_dtpump.{ksh|cmd}
      • dmk_backup_report.{ksh|cmd}
      • Appendix
    • dmk_dbcreate
      • Introduction
      • Release notes
      • Installation & Upgrade & De-Installation
      • Functionalities & Features
      • Database creation
      • Structure
      • Bug fix :DMK-14-10 and Oracle 12c
      • Appendix
    • dmk_dbduplicate
      • Introduction
      • Release notes
      • Installation & Upgrade & De-Installation
      • Functionalities & Features
      • Database duplicates/clones
      • Structure
      • Scheduling
      • Example
      • Appendix
    • dmk_ha
      • Introduction
      • Release notes
      • Installation & Upgrade & De-Installation
      • Functionalities & Features
      • Structure
      • Scripts
      • Data Guard : archivelog management strategy (Oracle 10g/11g)
      • Data Guard monitoring
      • DMK_HA virtual IP solution for Unix/Linux
      • DMK_HA virtual IP solution for Microsoft Windows
      • Oracle GoldenGate with Oracle Active Data Guard
      • Appendix
    • dmk_sql
      • Introduction
      • Installation & Upgrade & De-installation
      • Functionalities & Features
      • Structure
      • References
      • Scripts
      • Generate Report
      • Search
  • 📄OFA
    • Introduction
    • OFA Naming guidelines
    • OFA directory structure
Powered by GitBook
On this page
  • Function instance_status
  • Function process_status
  • Function dataguard status
  • Function crs_status
  • Function pstat: print the process status
  • Function istat: print the instance information
  • Function dstat: print the dataguard status
  • Function cstat: print the clusterware status
  1. Scripts
  2. Libraries

DMK_STATUS.pm

Perl-module to show status of processes, clusterware, instance, dataguard

DMK uses it for status.pl (standalone script to show status) and dmk-core.pl (to show the instance status of the current sid).

It can also be used in custom scripts. There are 2 types of functions: One gets the information (long name), the other one prints the informationi (short name). Example: If you only need the status the DataGuard configuration in a custom script, use the dataguard_status function and get the result from $configuration{status}, if you need a human-readable summary of the whole DataGuard status, use the dstat function.

#!/usr/bin/env perl
use lib "$ENV{DMK_HOME}/lib";
use DMK_STATUS;
dataguard_status();
print "Status of DataGuard Configuration: $configuration{status}\n";

Function instance_status

The function instance_status is used to get the status of the instance. Required argument is the ORACLE_SID. It will login to the instance to get the information about the database-instance. The result is in the global hash %oracle_sid_status, e.g. $oracle_sid_status{DATABASE_ROLE}='PRIMARY'; It will not print the result. This function is used by the istat function which will print the status.

Hint: To see the sql-statement and the result in detail, set the environment varialbe DEBUG=1;

Function process_status

The function process_status reads the configuration files orahomes and orasids to know the configured Oracle components, and then gets the running OS processes to see which components are running.

The status of most services (e.g. Listeners) is up or down.

For database-instances, depending on the release and the running processes, a more detailed status can be presented: down/nomount/mount/open readonly|read-write. This function wil NOT login to the instance, it only evaluates the processes! If you get nomount/mount, that means, depending on the running processes, it is not absolutely clear if the instance is in nomount or in mount.

The newer the release, the more accurate the result. With Oracle <10g, alway the same processes are running, so the status can only be down or up.

This function will NOT print the status (this is done by the pstat) function. The Result is stored in the following global hashes:

  • our %instances;

  • our %listeners;

  • our %cluster;

  • our %observers;

  • our %emagents;

  • our %ems;

Function dataguard status

The function dataguard_status is used to get the dataguard status of the current ORACLE_SID or the connect-string (2nd parameter). Parameter 1 are the options (o=observer, v=verbose).

This function will only collect the information. It is called by thedstat function which will print the result.

The result is in the following hashes:

  • our %configuration;

  • our %database;

  • our %observer;

Function crs_status

The function crs_status is used to get the status of Grid Infrastructure aka. Clusterware.

This function will only collect the information. It is called by thecstat function which will print the result.

The result is in the %res hash

Function pstat: print the process status

The function pstat gets the the information from the process_status function and is responsible to print the result.

Function istat: print the instance information

The function istat gets the the information from the instance_status function and is responsible to print the result. Mandatory parameter is the ORACLE_SID.

Function dstat: print the dataguard status

The function dstat gets the the information from the dataguard_status function and is responsible to print the result.

Parameters: v=verbose, o=observer, */* connect-string for remote-database.

Function cstat: print the clusterware status

The function dstat gets the the information from the crs_status function and is responsible to print the result.

PreviousDMK_ENV.pmNextAppendix

Last updated 1 month ago

📃