DMK User Guide
Introduction
The DMK (Database Management Kit) offers database administrators an efficient way to manage databases. It is a platform-independent and standardized collection of scripts for Linux/Unix systems.
Software Overview
The software is composed of an archive for Linux/Unix systems. No distinction is made between 32-bit and 64-bit architectures.
Support
If you encounter a bug, we strongly recommend enabling the DEBUG
mode before raising a support ticket.
To enable the debug mode:
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
If you have any questions, want to submit a request, report a bug, or contact us for any other reason, please reach out to the Support Team at dmk.support@dbi-services.com.
Alias & Variable Management
DMK sets the environment using ${DMK_HOME}/etc/dmk.conf
in three steps:
Each of these steps corresponds to a section in the ${DMK_HOME}/etc/dmk.conf
file, defined in brackets [...]
. For instance:
[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, etc.). This interaction feature is available for customers on Linux/Unix platforms. This is integrated through :
Directories located in
${MONGODB_BASE}/local
.Creation of an alias and a variable with the name of the directory in uppercase. The system variable
${PATH}
is extended with the directory'sbin
subfolder.
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 allows customizations and extensions. 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
: : automatically creates a variable with the name of the alias.novar
: does not create the above variable.
`[force|noforce]``
force
: if a command or an alias already exists, it is 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.+
: expands an existing variable.-
: contracts, removes element from a variable.
[begin|end|noption|warn|nowarn]
begin|end
: works like the+|-
operators.nooption|warn
: default. Prints a warning if the variable already exists.nowarn
: disables 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