DMK User Guide

Introduction

The DMK (database management kit) offers to database administrators’ an efficient way to manage databases. It’s a platform independent and standardized collection of scripts for Linux/Unix.

Software Overview

The software is composed of an archive for Linux/Unix systems. No differentiation is made between for the 32bit and 64bit architectures.

Support

In case you encounter a bug, we strongly recommend enabling the DEBUG mode before to raise a bug.

Enable debug as follows:

mongodb@mongodb-vm:/home/mongodb/ [mdb01] export DEBUG=1 
mongodb@mongodb-vm:/home/mongodb/ [mdb01] 2021-11-19_16:57:56::dmk-run.ksh::MainProgram ::DEBUG ==> Starts the Perl program : /u01/app/mongodb/local/dmk/dmk_perl/perl-5.24.0/bin/perl /u01/app/mongodb/local/dmk/bin/dmk-run.pl u

In case you have questions, want to raise a request, bug or any for any other purpose contact the Support Team at the following mail address: dmk.support@dbi-services.com

Alias & Variable Management

DMK set the environment using ${DMK_HOME}/etc/dmk.conf in 3 steps:

All these steps match to a section from the ${DMK_HOME}/etc/dmk.conf file. Which are defined by brackets [...], example follows:

[GLOBAL] var::MONGODB_CNF::=::nooption::"/u01/app/mongodb/etc/mongodb.cnf":: ...
alias::vic::var_noforce::'vi ${MONGODB_CNF}'::
[SERVER] var::DMK_MONGODB_LOG::=::nowarn::"${MONGODB_BASE}/admin/${MONGODB_SERVER}/log"::

Automatic creation of aliases and variables for modules

DMK interacts with other dbi services toolkits (DMK_DBBACKUP, ....), this interaction feature is available for customers on Linux/Unix platforms. Details of the feature:

  • Directories located under ${MONGODB_BASE}/local

  • Creates an alias and a variable with the name of the directory in Uppercase. The system variable ${PATH} is extended with the ?bin directory

mongodb@[HOST]:/home/mongodb/ [DUMMY] ls -d /u01/app/mongodb/local/demo/* /u01/app/mongodb/local/demo/bin
mongodb@[HOST]:/home/mongodb/ [DUMMY] alias demo
alias demo='cd /u01/app/mongodb/local/demo' 
mongodb@[HOST]:/home/mongodb/ [DUMMY] echo ${PATH} ...:/u01/app/mongodb/local/demo/bin
mongodb@[HOST]:/home/mongodb/ [DUMMY] echo ${DEMO}
/u01/app/mongodb/local/demo

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.

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

    • 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

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

Declare a variable

Variable are declared using the following syntax

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

    • =: equal operator

    • +: expand and existing variablé

    • -: contract, remove element from a variable

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

    • begin|end: works like the operators +|-

    • noopton|warn: default behave print warning in case thevariable exist

    • nowarn: disable warning and overwrites the variable

Example of a warning printout

2016-02-22_18-46-09::DMK.pm::ModifyConfigVar: MONGODB_BASE has been overwritten
2016-02-22_18-46-09::DMK.pm::ModifyConfigVar : /u01/app/grid
2016-02-22_18-46-09::DMK.pm::ModifyConfigVar : "/u01/app/mongodb"

Last updated