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.
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.
Last updated