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
  • Status script status.pl
  • Process status (alias pstat, alias u)
  • Instance status (alias istat)
  • Clusterware resource status (alias cstat)
  • Data Guard status (alias dstat)
  • CONFIGURATION
  • TECHNICAL INFORMATION
  1. Scripts

Status script

Status script status.pl

The utility status.pl shows various Oracle related stati.

status.pl mode [options] [connectstring]

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:

## instead of
  status.pl process
## use
  pstat
  u

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.

no
Instance is started in NOMOUNT

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)

status.pl crs

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

cstat --local
status.pl c --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)

status.pl -d
status.pl -d -vo sys/pw@service

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.

+----------+----------------+---------+--------+---------+----------+--------------+----------+----------+-------+
| Level    | Name           | Sid     | Host   | Status  | Mode     | State        | Lag 1    | Lag 2    | Error |
+----------+----------------+---------+--------+---------+----------+--------------+----------+----------+-------+
| Config   | db2100         |         |        | SUCCESS | MaxAvail |              |          |          |       |
+----------+----------------+---------+--------+---------+----------+--------------+----------+----------+-------+
| FSFO     |                |         |        |         |          | Enabled      | PrimPing | TrgtPing |       |
| Observer | ltp14s_db2100o |         | ltp14s |         |          |              |       3s |       1s |       |
| Observer | ltp14s_db2100f |         | ltp14s |         |          |              |       1s |       3s |       |
+----------+----------------+---------+--------+---------+----------+--------------+----------+----------+-------+
| PRIMARY  | db2100a        | DB2100A | ltp14s | SUCCESS | sync     | TRANSPORT-ON |   Transp |    Apply |       |
| Physical | db2100b        | DB2100B | ltp14s | SUCCESS | SYNC     | APPLY-ON     |       0s |       0s |       |
+----------+----------------+---------+--------+---------+----------+--------------+----------+----------+-------+

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 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, 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.

PreviousScriptsNextO.S Start/Stop script integration

Last updated 2 months ago

📃