Variables and aliases
for dmk configuration files
Aliases for editing configuration files
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
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
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.
The "dbs/" directory with spfile, passwordfile, etc. is now in $ORACLE_BASE/dbs, other files are now below $ORACLE_BASE/homes/${DMK_HOME_INVNAME}/
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
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
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.
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:
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
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.
Similar possibilities for setting ASM instance environment (example: +ASM2 is on this host):
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"):
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;
Last updated