Status script
Status script status.pl
The utility status.pl shows various Oracle related stati.
The mode can be prefixed with "-
" or "--
", but that is optional. Valid values for "mode" are:
| mode | alias | description |
|------|-------------|
| p / proc / process
| pstat
/ u
| Shows running Oracle products and ORACLE_HOMEs; only evaluates config-files and OS-processes |
| i / inst / instance
| istat
| information of the current instance|
| d / dg / dataguard
| dstat
| Status of Data Guard|
| c / crs / cluster
| cstat
| Clusterware status |
Instead of calling status.pl mode, you can use the alias:
Process status (alias pstat, alias u)
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.
Instance status (alias istat)
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.
Clusterware resource status (alias cstat)
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).
If you want to show only resources allocated on the current host, add the option --local
(currently -l
also works because there is no other option beginning with 'l'. But it is not guaranteed for the future)
It only shows the local VIP, plus VIP's failovered to this host
It only shows LISTENER_SCANx running on that host
It only shows instances allocated on this host. This option is especially indended if you run Single instances in a cluster
Data Guard status (alias dstat)
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)
CONFIGURATION
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 ONLINEDMK_COLOR_OFF
color for resources in target/status OFFLINEDMK_COLOR_INT
color for resources in target/status INTDMK_COLOR_OKU
color for resources in target/status Up which is OKDMK_COLOR_OKD
color for resources in target/status Down which is OKDMK_COLOR_ERR
color for resources in target/status ERRORDMK_COLOR_WAR
color for resources in target/status WARNINGDMK_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, 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"
.
TECHNICAL INFORMATION
$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
.
Last updated