Advanced Configuration

This chapter presents the “standard” configuration of DMK. However the flexibility of the tool permits customizations and extensions.

Aliases & Variables Management

The following paragraphs explain how to create your own aliases and variables.

Declare an alias

Aliases are declared using the following syntax

alias::<name>::[var|novar]_[force|noforce]::<your code>::# comment
  • [var|novar]

    • var : creates automatically a variable with the name of the alias with the path specified in the alias. The alias cdh='cd $ORACLE_HOME' creates a variable cdh=$ORACLE_HOME

    • novar : doesn’t create the above variable

  • [force|noforce]

    • force : if a command or an alias already exists it’s overwritten

    • noforce: a warning is printed instead of overwriting the existing alias or command

Example of a warning printout

2012-06-22_15-31-19::DMK.pm::ComputeConfig ::WARNING ==> $DMK_HOME\\etc\\dmk.conf alias/command "u" is already in use, Please use FORCE option to override it

For Windows you can explicitly specify if an alias is for cmd.exe or powershell. Add the suffix @cmd or @ps1 to the alias name (e.g. env@cmd).

If you specify an alias for ps1 and it is enclosed in brackets (...) it will be used as-is as a function definition (aliases are implemented as functions). Otherwise, DMK tries to reformat it as a function.

Declare a variable

Variables are declared using the following syntax

var::<name>::[ =|+|-]::[ begin|end|nooption|warn|nowarn]::<your value>::

  • [=|+|-]

    • = : Equal operator

      • : expand an existing variable

    • : contract, remove element from a variable

  • [begin|end|noption|warn|nowarn]

    • begin/end : works only with the operators [+|-]

    • nooption|warn : default behave print a warning in case the variable exists

    • nowarn : disable warning and overwrites the variable

Example of a warning printout

2012-06-22_18-46-09::DMK.pm::ModifyConfigVar ::WARNING ==> Variable : ORACLE_BASE has been overwritten

2012-06-22_18-46-09::DMK.pm::ModifyConfigVar ::WARNING ==> Old value : /u01/app/grid

2012-06-22_18-46-09::DMK.pm::ModifyConfigVar ::WARNING ==> New value : "/u01/app/oracle"

For Windows, you can specify variables in Unix ($ORACLE_HOME) or Windows (%ORACLE_HOME%) notation. DMK rewrites it to the required syntax.

ORACLE Perl Configuration

DMK uses the "perl" executable from the current ORACLE_HOME. It determines automatically the required library path (PERLLIB).

For the initial startup (source dmk.sh) it uses the Perl found via the $PATH variable, or you can specify a Perl binary in the environment variable $PERL_EXEC. If both are missing, it tries to use the Perl of the 1st ORACLE_HOME in the oratab.

The easiest way is to use the Perl version shipped by the OS which is in the $PATH (/usr/bin/perl). For Windows we recommend Strawberry Perl.

It is not recommended to use the Perl of an installed ORACLE_HOME for the initial startup. If you remove it once, the environment no longer works…

Last updated