ℹ️Appendix

DMK - Sql*Plus profile login.sql

By default, the Oracle SQL_Plus utility can take advantage of a login profile. DMK delivers a template script with some basic settings. To activate the DMK SQL_Plus profile copy the template script as follows:

cp -r ${DMK_HOME}/templates/sql ${DMK_HOME}

DMK – Linux/Unix Colored prompt

By default, the Linux/Unix prompt (variable PS1) customized by DMK does not include any colors. However, nowadays most Linux Oracle database servers have BASH shell installed per default and almost all kind of terminal supports colors.

# standard Linux prompt colors: 00=normal, 01=bold, 30-37 textcolor, 40-47 background
# var::PS1BASH::=::nowarn::'\\[\\033[00;36m\\u@\\h:\\w/ [${ORACLE_SID}${DMK_SID_PDB}]\\033[00m\\] '::
#prompt in light blue (cyan)
# var::PS1BASH::=::nowarn::'\\[\\033[00;30m\\u@\\h:\\w/ [${ORACLE_SID}${DMK_SID_PDB}]\\033[00m\\] '::
#prompt in black
# var::PS1BASH::=::nowarn::'\\[\\033[00;31m\\u@\\h:\\w/ [${ORACLE_SID}${DMK_SID_PDB}]\\033[00m\\] '::
#prompt in red
# var::PS1BASH::=::nowarn::'\\[\\033[00;32m\\u@\\h:\\w/ [${ORACLE_SID}${DMK_SID_PDB}]\\033[00m\\] '::
#prompt in green
# var::PS1BASH::=::nowarn::'\\[\\033[00;33m\\u@\\h:\\w/ [${ORACLE_SID}${DMK_SID_PDB}]\\033[00m\\] '::
#prompt in yellow/brown
# var::PS1BASH::=::nowarn::'\\[\\033[01;33m\\u@\\h:\\w/ [${ORACLE_SID}${DMK_SID_PDB}]\\033[00m\\] '::
#prompt in bright yellow
# var::PS1BASH::=::nowarn::'\\[\\033[01;33;40m\\u@\\h:\\w/ [${ORACLE_SID}${DMK_SID_PDB}]\\033[00m\\] '::
#prompt in yellow on black (useful for a bright background)
# var::PS1BASH::=::nowarn::'\\[\\033[00;34m\\u@\\h:\\w/ [${ORACLE_SID}${DMK_SID_PDB}]\\033[00m\\] '::
#prompt in blue
# var::PS1BASH::=::nowarn::'\\[\\033[00;35m\\u@\\h:\\w/ [${ORACLE_SID}${DMK_SID_PDB}]\\033[00m\\] '::
#prompt in magenta
# var::PS1BASH::=::nowarn::'\\[\\033[00;37m\\u@\\h:\\w/ [${ORACLE_SID}${DMK_SID_PDB}]\\033[00m\\] '::
#prompt in white

Copy the desired prompt definition to $etc/dmk.conf.local;

Default aliases

Name
Description

c

Clear console

cda

Changes directory to ${ORACLE_BASE}/admin/${ORACLE_SID}

cdal

Changes directory to ${DMK_ORA_SID_LOG} – alert*.log directory

cdb

Changes directory to ${ORACLE_BASE}

cdd

Changes directory to ${DMK_BASE}

cddi

Changes directory to ${DMK_DIAG_DEST}

cdh

Changes directory to ${ORACLE_HOME}

cdl

Changes directory to ${ORACLE_BASE}/local

cdt

Changes directory to ${ORACLE_BASE}/network/admin

dmkhelp <package name>

Displays all default aliases/variables categorized by the DMK package you are looking for. The help is available for all packages.

f

Executes fdisk.ksh

lspdb

Lists Oracle Pluggable Databases for the current environment

rmanc

Launch rman with catalog/nocatalog connection if the rman.conf is present

sqh

Sqlplus with history

sq

Sqlplus without history

sta/ser/u

Print Oracle components status: “sta” by status “ser” by service “u” a faster variant of “ser” (no differentiation between the database states OPEN/MOUNT/NOMOUNT)

g

Print Oracle GoldenGate groups status details for Manager, Extract, Replicat and for Goldengate monitor Jagent

taa/via

Tail/Edit the alert*.log

adr/viadr

Tail/Edit the dr*.log (Dataguard broker log file)

vid

Edit the ${DMK_HOME}/etc/dmk.conf

vil

Edit the ${TNS_ADMIN}/listener.ora

vio

Edit the ORATAB

Other aliases are created automatically for directories under the “${DMK_BASE}”.

As explained in paragraph 4.2 Automatic creation of aliases and variables for modules.

Default variables

Name
Description

DMK_BASE

Match the directory level above “${DMK_HOME}” Match typically the “${ORACLE_BASE}/local”

DMK_HOME

Installation directory

ORACLE_BASE

O.F.A , Software root directory

TNS_ADMIN

Match the directory “${ORACLE_BASE}/network”

DMK_ORA_ADMIN

Match the directory “${ORACLE_BASE}/admin”

DMK_ORA_ADMIN_SID

Match the directory “${ORACLE_BASE}/admin/${ORACLE_SID}”

DMK_ORA_SID_LOG

Match the alert*.log directory regardless of the database release

DMK_DIAG_DEST

Oracle 11g diagnostic dest Match typically the ${ORACLE_BASE}/diag

Other variables are created automatically for directories under the “${DMK_BASE}”.

As explained in paragraph 4.2 Automatic creation of aliases and variables for modules.

Microsoft Windows specifics

Unix utilities

Utility
Description

tail.exe

Open Source real-time log viewer

tar.exe

GNU tar

gunzip.exe

Open Source gunzip

vi.exe

“VImproved”, Open Source text editor

There are more utilities in dmk\bin\wbin\ directory. Additional utilities can be extracted from UnxUtils.zip

Powershell

dmk.Ps1 will set the environment for PowerShell. There is no need to have powershell specific scripts. The *.cmd scripts (e.g. housekeeping.cmd) can be used in powershell and cmd.exe How does it work: All the variables $ENV:variablename will be propagated to the called program, so a myscript.cmd has set the %variablename% in the process. The same applies for Perl scripts.

Microsoft Windows Task Scheduler

DMK Scheduler-enabled scripts can be run directly without setting a dmk environment before (e.g. houskeeping.cmd). It will set the environment inside the script. How to see if it is scheduler-enabled? If it runs from a cmd.exe without sourcing dmk, it is scheduler-enabled. Microsoft Windows scheduled tasks doesn’t launch directly the PowerShell layer. So use the *.cmd scripts instead. If you only have a Ps1 script, you have to explicitly invoke PowerShell:

powershell.exe –noprofile –command "yourcommand.Ps1"

Support Matrix Release 2.0.0

Operating System
Support Level
Oracle Releases

MS Windows 2003

Supported

10.2, 11.2

MS Windows 2008

Supported

10.2, 11.2,12.1

MS Windows 2012

Supported

11.2, 12.1

Oracle Enterprise Linux

Certified

All releases supported by Oracle

Red Hat Enterprise Linux

Certified

All releases supported by Oracle

Suse Enterprise Linux

Supported

All releases supported by Oracle

IBM AIX

Supported (IBM & Intel)

10.1, 10.2, 11.1, 11.2

Sun Solaris

Supported (ipc86 & SPARC)

10.2, 11.2

HP-UX

Supported (Itanium)

10.2, 11.2

The current release 2.0.0 is only tested with Linux. Maybe It works with AIX/Solaris/HPUX, but It Is not tested. With Windows, it definitely does not work --> use a former release of DMK.

Last updated