Status script
Last updated
Last updated
The utility status.pl shows various Oracle related stati.
This script shows the status of running (stopped) Oracle processes.
It only evaluates running processes and configuration files. It will NOT log in to a database or any other product.
Depending on the running database processes and the Oracle release, it tries to detect the current startup status of the instance.
mo
Instance is started in MOUNT
rw
Instance is started OPEN READ WRITE
ro
Instance is started OPEN READ ONLY
up
Instance is started. Before Rel. 10.1 there are no processes visible to detect no/mo/rw/ro For non-Instance products: status is "up" if it is running
of
Offline/Down
In this example the DB1020 database is in mount or open read-only state. Based on the processes it cannot be exactly determined. To see the real state, set the environment for DB1020 and use the istat alias.
To show the status of the current database instance, use the alias "istat". It will login with "/ as sysdba" to the database to get the information. If that fails (e.g. you do not have sysdba privilege), it shows the status of pstat.
It uses the same color definition as pstat.
In this mode, status.pl shows the status of clusterware. It uses the crsctl utility and formats the result to an output of 1 line per resource. Per default it uses colors to show the status if it is run in an interactive terminal and DMK_COLOR_NO_COLOR is not set (to suppress color, set the variable to 1).
This mode shows the Data Guard status. The following options can be specified: v
queries the configuration with verbose, which updates the current state. Otherwise it uses the cached state which is updated at least each minute. The option o
shows the observer line even if there is no observer configured. If there is a paramter with "@" it is interpreted as the connect-string to use. If it is missing, it tries to connect with "/" (OS-authenticated) and if that fails, it looks if there is a connect string available from the dgobserver.ksh configuration.
If the variable LANG contains UTF-8, then it uses linedrawing characters, otherwise it emulates it with ascii chars (example above)
This mode shows the status of the clusterware resource
If the script runs in an interactive terminal, it uses colors to make the output easier readable. The default colors are optimized for a terminal with white background, but the colors can be adapted by variables. If you want a monochrome output, set the variable DMK_COLOR_NO_COLOR=1
DMK_COLOR_ONL
color for resources in target/status ONLINE
DMK_COLOR_OFF
color for resources in target/status OFFLINE
DMK_COLOR_INT
color for resources in target/status INT
DMK_COLOR_OKU
color for resources in target/status Up which is OK
DMK_COLOR_OKD
color for resources in target/status Down which is OK
DMK_COLOR_ERR
color for resources in target/status ERROR
DMK_COLOR_WAR
color for resources in target/status WARNING
DMK_COLOR_RW
color for database instance OPEN READ-WRITE (rw)
DMK_COLOR_RO
color for database instance OPEN READ-ONLY (ro)
DMK_COLOR_MO
color for database instance MOUNTED (mo)
DMK_COLOR_NO
color for database instance in NOMOUNT (no)
DMK_COLOR_UP
color for database instance/other Oracle daemons running (up)
DMK_COLOR_OF
color for database instance OFFLINE (of)
The colors available are black, red, green, yellow, blue, magenta, cyan and white. It can be prefixed with 'bright_' to get a more intensive color, e.g. 'bright_yellow'. You can specify the color for the font and the background. The background color is prefixed by 'on_'. If the background color is not specified, the terminal background is used. Example: default DMK_COLOR_RW
is 'black on_bright_green'. To invert that, set DMK_COLOR_RW
to 'bright_green on_black'.
$DMK_BASE/bin/status.pl
is responsible for parameter handling and presenting the result.
It uses the $DMK_BASE
/lib/DMK_ENV.pm> module to get the environment (which homes and SID's are present).
To collect the runtime information it uses the $DMK_BASE/lib/DMK_STATUS.pm
library. This module offers functions to gather information for the above mentioned components (e.g. instance_status). Afterwards, the result is available in Perl hashes (e.g. %instances, %listeners) and it will be formatted accordingly by status.pl
.