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
  • for dmk behavior
  • DEBUG
  • DMK_INITIALSID
  • đŸĒŸ DMK_NO_DESKTOP_LINK
  • DMK_PRE_CMD / DMK_POST_CMD
  • DMK_SAVE_LAST_ENVFILE
  • PERL_EXEC
  • for dmk configuration files
  • related to ORACLE_HOME / ORACLE_SID
  • Related to status display
  1. Installation and configuration

Variables and aliases

PreviousAdvanced ConfigurationNextMigration to DMK

Last updated 2 months ago

for dmk behavior

DEBUG

If this variable is set to 1, DMK prints more verbose output of what it internally does.

DMK_INITIALSID

The ORACLE_SID (can be a real or a "dummy" SID) that should be set if dmk.sh / dmk.cmd is sourced without the sid parameter

đŸĒŸ DMK_NO_DESKTOP_LINK

If missing, DMK creates a Windows desktop link to start a terminal with DMK environment (cmd or ps1). If you prefer no, or another name for the desktop link, set the variable DMK_NO_DESKTOP_LINKto 1.

DMK_PRE_CMD / DMK_POST_CMD

In these variables you can specify commands to run:

  • DMK_PRE_CMD: before setting the [INTERNAL] variables and after restore of SET_DMK_* variables.

  • DMK_POST_CMD: after setting the aliases.

This mechanism is not recommended and not supported if you change settings handled by DMK. Use it at your own risk! The idea is to run custom scripts or binaries. The value of the variable will be added as-is (without enclosing quotes) to the dmk environment file ($DMK_TEMPFILE). It can be one or more script to be sourced or executables to run. Examples:

var::DMK_PRE_CMD::=::nowarn::"echo \"This is the pre-command at $(date)\""::
var::DMK_POST_CMD::=::nowarn::'ls; date; id'::  #execute 3 commands
var::DMK_POST_CMD::=::nowarn::'. /home/oracle/customscript.inc':: #source script

DMK_SAVE_LAST_ENVFILE

Copy the last generated environment file ($DMK_TEMPFILE) to the file specified in DMK_SAVE_LAST_ENVFILE. Example:

# $etc/dmk.conf.local
var::DMK_SAVE_LAST_ENVFILE::=::nowarn::"/tmp/dmkenv.$(id -un).inc"::

Stores the last env-file as /tmp/dmkenv.oracle.inc

PERL_EXEC

Explicitly specify the perl binary to use for startup (sourcing) of DMK. After DMK is sourced, it switches to the Perl of the current ORACLE_HOME (if available).

for dmk configuration files

Aliases for editing configuration files

Alias
Description

vid

vi dmk.conf.local ; the configuration file with the machine-specific settings

vis

vi ${DMK_ORA_ADMIN_SID}/dmk/${ORACLE_SID}.conf the configuration file with the ORACLE_SID specific settings in

viohome

vi ${DMK_HOME}/etc/ora_homes

viosid

vi ${DMK_HOME}/etc/ora_sids

Variables for generating the dummy-name of a new ORACLE_HOME

Variable
Description

DMK_HOMEFORMAT_RDBMS

Naming pattern for database homes

DMK_HOMEFORMAT_GRINF

Naming pattern for Grid Infrastructure (usually 1 home)

DMK_HOMEFORMAT_PRODUCT

PRODUCT is the product-name in ora_homes

For details, see chapter ora_sids above.

related to ORACLE_HOME / ORACLE_SID

Variables depending on the Oracle release/version

Variable
Description

DMK_GRID_BASE

The ORACLE_BASE of the grid infrastructure

DMK_GRID_HOME

The ORACLE_HOME of the active grid infrastructure (see /etc/oracle/olr.loc)

DMK_ORA_REL

Release of Oracle; Format aabc (new: bc=00 if >=18c), e.g. 1900, 0920

DMK_ORA_VER

Version of Oracle, Format aabbcc, e.g. 191500, 090200

DMK_SQLPLUS

sqlplus-binary for the current SID (For Oracle8 it is svrmgrl instead of sqlplus)

DMK_SYSCONNECT

'/ as sysasm' for +ASM* instances, otherwise '/ as sysdba' (for Oracle8: command="connect internal")

For Oracle <18c version and release is the same

SQL*Plus: Release** 9.2.0.6.0 - Production on Mon Nov 14 13:56:09 2022

For Oracle >= 18c the release number (oraversion -baseversion) is always the same for all release updates (RU/RUR), but the version shows the RU's (oraversion -compositeVersion)

SQL*Plus: Release 18.0.0.0.0 - Production on Mon Nov 14 13:59:37 2022

Version 18.10.0.0.0

The sq and sqh alias now uses $DMK_SQLPLUS "$DMK_SYSCONNECT" instead of hardcoded values.

Variables and aliases related to read-only / conventional ORACLE_HOME's

With Oracle > 12c you can configure (21c it is the default) that files that are not part of the ORACLE_HOME installation (e.g. spfile, tnsnames.ora, trace-files) will be written in $ORACLE_BASE instead of $ORACLE_HOME.

roohctl -enable

The "dbs/" directory with spfile, passwordfile, etc. is now in $ORACLE_BASE/dbs, other files are now below $ORACLE_BASE/homes/${DMK_HOME_INVNAME}/

Variable
Description

DMK_DBS

$ORACLE_BASE/dbs (for rooh) $ORACLE_HOME/dbs (for non-rooh)

DMK_ORACLE_HOME_RW

$ORACLE_BASE/homes/${DMK_HOME_INVNAME} (for rooh) $ORACLE_HOME (for non-rooh)

DMK_HOME_INVNAME

Name in the oraInventory, e.g. OraDB21Home1

DMK_HOME_PRODUCT

see ora_homes file. Examples: rdbms_ee, rdbms_se

ORACLE_BASE

The ORACLE_BASE of the current ORACLE_HOME

GRID_BASE

The ORACLE_BASE of the grid-infrastructure home. Also set in database homes

DMK_DIAG_DEST

"diag/" directory, derived from ORACLE_BASE

DMK_ORA_ADMIN

"admin/" directory, derived from ORACLE_BASE

Alias
Description

cddbs

cd $DMK_DBS

cdh

cd $ORACLE_HOME

cdhrw

cd $DMK_ORACLE_HOME_RW

cdob

cd $ORACLE_BASE

Variables and aliases related to SID's

Variable
Description

DMK_INITIALSID

Which SID should be initially set.

DMK_SID_PDB_NAME

The name of the current pluggable database (CDB$ROOT for the container)

DMK_SID_PDB

The $DMK_SID_PDB_NAME formatted to be used in the PS1 prompt

DMK_SID_TYPE

The 'type' field in ora_sids for the current ORACLE_SID

DMK_SID_CRSTYPE

The 'crstype' field in ora_sids file for the current ORACLE_SID

DMK_SID_INSTANCES

The 'instances' field in ora_sids file for the current ORACLE_SID

NLS_LANG

See chapter about $ORACLE_SID.conf file

DMK_ORA_DB_UNIQUE_NAME

db_unique_name of the current SID

DMK_ORA_DB_NAME

db_name of the current SID

DMK_ORA_SID_ALERTLOG

Alertlog of the current SID

DMK_ORA_SID_LOG

Trace/Logfile directory of the current SID

Per default, the initial ORACLE_SID that is set in a new environment is the first "H"ome-Entry in ora_sids. With the variable DMK_INITIALSID (defined in dmk.conf.local) you can specify any other SID in ora_sids. You can also specify a Perl reguar expression, e.g. rdbms.* (mind the "." before "": The "." the representation of any character, together with the "" it matches 0-n characters after 'rdbms') , then the alphabetically latest entry (e.g. rdbms191700) will be set. The advantage is that if you deinstall an old home you do not need to adapt the variable. It always uses the latest home.

If the given SID does not exist, fallback to the default mechanism.

Alias
Description

SID / sid

. ${DMK_HOME}/bin/dmk.sh <SID>

Variables and aliases related to Grid Infrastructure

If a Grid Infrastructure home is found, the following variables are available in all SID-environments:

Variable
Description

GRID_HOME

The ORACLE_HOME of the grid infrastructure

GRID_BASE

The ORACLE_BASE of the grid infrastructure

DMK_ORA_SID_ALERTLOG

if +ASM%: the alertlog of the ASM instance if -MGMTDB: the alertlog of the Management instance else: the alerlog of clusterware

Alias
Description

crsctl

${GRID_HOME}/bin/crsctl uses the crsctl in $GRID_HOME without the need to change a PATH variable

cdh

${PERL_EXEC} ${DMK_HOME}/bin/status.pl crs Shows the clusterware resource status

+ASM +ASM[nr]

Set the environment for the ASM instance. The number is optional; DMK can detect the number itself

<DB_UNIQUE_NAME>

For a RAC databases: the environment for this home is set and the SID is the db_unique_name. Intended for policy-managed databases if the instance is currently not allocated to this host

<RAC-SID>[nr] rac1

Set the environment for the rac-instance (admin-managed)

<RAC-PREFIX>_[nr]

Set the environment for the rac-instance (policy-managed, rac-one-node). This alias is only available if the instance is running on this host at startup of dmk. If the instance is relocated, the alias becomes invalid.

<RAC-PREFIX>%

Wildcard-format. dmk.sh checks at runtime, if an instance with this rac-prefix is running and sets the environment for it. If no instance is running, the environment will be set with the db_unique_name.

To simplify setting RAC SID environments in shell-scripts, DMK offers the following possibilities:

dmk.sh accepts for RAC instances the format <RAC_PREFIX>%, also for admin-managed databases. With that, the script can be written independent of the host.

oracle@rac19a2:~/ [grinf19] . dmk.sh RAC%
oracle@rac19a2:~/ [RAC2 (CDB$ROOT)]

Similar possibilities for setting ASM instance environment (example: +ASM2 is on this host):

. dmk.sh +ASM2
. dmk.sh +ASM
. dmk.sh +ASM%

Related to status display

The new status script status.pl will use the color definition of the Perl module Term::ANSIColor; The format is in the following scheme: "foreground-color on_background-color"

The script uses the following defaults, which are optimized for terminals with white background and black font (e.g. Putty: "Use system colours"):

Variable
Default value
Description

DMK_COLOR_RW

black on_bright_green

Instance open read-write

DMK_COLOR_RO

bright_yellow on_green

Instance open read-only

DMK_COLOR_MO

black on_bright_yellow

Instance started in mount state

DMK_COLOR_NO

bright_white on_bright_black

Instance started in nomount state

DMK_COLOR_UP

green on_bright_white

Process started (for instances: effective state is unknown)

DMK_COLOR_OF

bright_white on_black

Process not started, down

DMK_COLOR_ONL

green on_bright_white

Clusterware resource is ONLINE on this host

DMK_COLOR_OFF

black on_bright_white

Clusterware resource is OFFLINE on this host

DMK_COLOR_INT

yellow on_bright_white

Clusterware resource is INTERMEDIATE on this host

DMK_COLOR_OKU

bright_white on_green

Clusterware status is OK and up (online)

DMK_COLOR_OKD

bright_white on_black

Clusterware status is OK and down (offline)

DMK_COLOR_ERR

bright_white on_bright_red

Clusterware status is Error

DMK_COLOR_WAR

black on_bright_yellow

Clusterware status is Warning

DMK_COLOR_NO_COLOR

(not set)

if set to non-empty and not 0: status.pl will not use colors

To change the default values, set these variables before calling status.pl. To disable the color for a variable, use the keyword "reset". To permanently change the default, configure it in dmk.conf.local;

âš™ī¸
âš ī¸