DMK Oracle
release_2.2.0
release_2.2.0
  • Introduction
  • Release 2 note
  • ⚙️Installation and configuration
    • Installation & Upgrade & De-installation (Unix)
    • Installation & Upgrade & De-installation (Windows)
    • Functionalities & Features
    • Advanced Configuration
    • Variables and aliases
    • Migration to DMK
  • 🗄️Structure
    • Structure
    • Oracle Grid Infrastructure & DMK
    • Oracle Database Multitenant – DMK features
  • 📃Scripts
    • Status script
    • O.S Start/Stop script integration
      • O.S Start/Stop script integration until Red Hat/Oracle Linux 6
      • O.S Start/Stop script integration since Red Hat/Oracle Linux 7
    • dmk.sh / dmk-core.pl
    • service_start_stop.ksh
    • database.ksh
    • db_crs.ksh
    • listener.ksh
    • listener_vcs.ksh
    • fsdisc.ksh
    • emctlagent.ksh
    • emctlgrid.ksh
    • opmnctl.ksh
    • goldengate.ksh
    • dgobserver.ksh
    • version.ksh|version
    • housekeeping.{ksh|cmd }
    • odiagentctl.{ksh}
    • Libraries
      • DMK_ENV.pm
      • DMK_STATUS.pm
  • ℹ️Appendix
  • 🧩Extension
    • dmk_dbbackup
      • Introduction
      • Release notes
      • Installation
      • Functionalities & Features
      • Structure
      • dmk_rman.{ksh|cmd}
      • dmk_dtpump.{ksh|cmd}
      • dmk_backup_report.{ksh|cmd}
      • Appendix
    • dmk_dbcreate
      • Introduction
      • Release notes
      • Installation & Upgrade & De-Installation
      • Functionalities & Features
      • Database creation
      • Structure
      • Bug fix :DMK-14-10 and Oracle 12c
      • Appendix
    • dmk_dbduplicate
      • Introduction
      • Release notes
      • Installation & Upgrade & De-Installation
      • Functionalities & Features
      • Database duplicates/clones
      • Structure
      • Scheduling
      • Example
      • Appendix
    • dmk_ha
      • Introduction
      • Release notes
      • Installation & Upgrade & De-Installation
      • Functionalities & Features
      • Structure
      • Scripts
      • Data Guard : archivelog management strategy (Oracle 10g/11g)
      • Data Guard monitoring
      • DMK_HA virtual IP solution for Unix/Linux
      • DMK_HA virtual IP solution for Microsoft Windows
      • Oracle GoldenGate with Oracle Active Data Guard
      • Appendix
    • dmk_sql
      • Introduction
      • Installation & Upgrade & De-installation
      • Functionalities & Features
      • Structure
      • References
      • Scripts
      • Generate Report
      • Search
  • 📄OFA
    • Introduction
    • OFA Naming guidelines
    • OFA directory structure
Powered by GitBook
On this page
  • What is a shell environment
  • What is an environment software
  • Interchangeability of environment software
  • Migration from BasEnv to DMK
  • Install DMK
  • Compare both environments
  • Using both environments selectively
  • Fully replace BasEnv by DMK
  • Redirect BasEnv calls to DMK
  • Combining both environments
  1. Installation and configuration

Migration to DMK

What is a shell environment

To work with Oracle, e.g. to start the instance or to run sqlplus, you will use a shell (usually bash or ksh). And in this shell you need variables, e.g.

  • ORACLE_HOME: Location of the Oracle software to use

  • ORACLE_SID: Identifier for the instance

  • NLS_LANG: The local language settings used to communicate with the Oracle server-process

  • TNS_ADMIN: Directory of tnsnames.ora, listener.ora, ... that should be used

  • PATH: A list of directories to look for executables, in the Oracle context: $ORACLE_HOME/bin

Optionally you can define aliases for your convenience

  • alias sq='sqlplus / as sysdba'

  • alias cdh='cd $ORACLE_HOME'

What is an environment software

An environment software for Oracle is a bundle of scripts and configuration files that will dynamically set the environment variables and aliases for a specific ORACLE_SID (SID). And it offers scripts/aliases to switch from one SID to another SID. To do that, it has to reset the old environment variables and to set the new environment variables. Example for the PATH variable: If SID1 uses Oracle version 19.19 and SID2 uses 19.22, then with a switch from SID1 to SID2, the old ORACLE_HOME directory must be replaced by the new ORACLE_HOME directory in the PATH variable. And if a database is updated to a new ORACLE_HOME, then the environment software has to detect that and update the environment automatically.

Additionally to the setting of the environment, a good environment software provides some helper scripts:

  • Show running/stopped Oracle daemons (instances, listeners, clusterware, ...)

  • Information/status of the current SID

  • Information/status of Grid Infrastructure

  • Information/status of Data Guard

  • Start/Stop scripts for

    • database-instance

    • listener

    • observer

    • ...

Examples of environment software

  • "oraenv" scrpt from Oracle. Minimalistic software

  • "DMK" from dbi Services

  • "BasEnv" from Trivadis

  • "ocob" from Opitz Consulting

  • self-programmed inhouse scripts

Interchangeability of environment software

Oracle-defined variables (ORACLE_HOME, NLS_LANG, ...) are identical in all environment software products. And in most products you will switch the environment by typing the name of the desired ORACLE_SID. So if you only use this core functionality you can use any product "out-of-the-box".

But for variables not defined by Oracle there are probably naming differences. Often you will have a variable with the version of the current ORACLE_HOME, but it is named differently. If you want to switch to another product, you have to learn the new name, and if such variables are used in scripts, adapt it in the these scripts. Or you can map the new name to the old name.

export ORACLE_VERSION=$DMK_ORA_VER

The same applies to the aliases. Learning the new aliases or defining the old aliases.

But sometimes there is a naming conflict. Same name, but different content. In this case you have to decide what to keep. It is recommended to keep the new one.

Migration from BasEnv to DMK

BasEnv is an often used product in CH/DE/AT of the former company Trivadis (acquired by Accenture) with a similar functionality to dbi Services DMK.

Install DMK

Open a new Oracle session without sourcing BasEnv. Probably you have to comment it in .bash_profile; Afterwards, install and configure DMK as described.

Compare both environments

Get an overview of all aliases and variables in a DMK and BasEnv environment and compare the output.

env |sort
alias |sort

Evaluate what basenv specific variables you use in your own scripts and what aliases you want to keep in the future. If you have many old scripts you do not want to touch, or you do not know which scripts are in use, then you should map the required variables.

There is a template dmk/template/etc/migrate_basenv_to_dmk.conf.tpl. This template contains the configuration to map DMK variable-names to BasEnv variable-names and some example aliases. Add the lines of this template to your dmk/etc/dmk.conf.local file in the [GLOBAL] section.

The following variables are defined differently

variable
BasEnv
DMK
DMK alternative

cdb

BasEnv software directory

ORACLE_BASE

cdd

cdd

diagnistic-directory

DMK software directory

cdal

The following aliases are defined differently

alias
BasEnv
DMK
DMK alternative

vid

vi drc*.log

vi dmk.conf.local

vidr

cdd

cd to diagnistic-directory

cd to DMK software directory

cdal

The variables/aliases cdl (directory of the tool installation) and etc (directory with the tool configuration files) are tool-specific. But the content is similar.

Using both environments selectively

If you do not automatically source one of the environment, you can create aliases to source the desired environment. Each of it can be used inependent.

alias basenv='. /u00/app/oracle/tvdtoolbox/dba/bin/basenv.sh'
alias dmkenv='. /u00/app/oracle/local/dmk/bin/dmk.sh'

Fully replace BasEnv by DMK

Remove sourcing of Basenv in your profile and add sourcing of DMK to your profile. Rename your basenv folder. So you can detect by an error message if a script still tries to access BasEnv.

Redirect BasEnv calls to DMK

Replace your basenv folder by a symlink to DMK and map basenv scripts to the equivalent dmk script by a symlink or a wrapper script.

cd /u00/app/oracle/tvdtoolbox/
mv basenv basenv.bck
ln -s /u00/app/oracle/local/dmk tvdtoolbox
cd /u00/app/oracle/local/dmk/bin
ln -s dmk.sh basenv.sh
ln -s dmk.sh oraenv.ksh
ln -s database.ksh db.ksh
ln -s dgobserver.ksh dg_observer.ksh
ln -s service_start_stop.ksh oracle_start_stop.ksh
echo 'status.pl c' > crsstat        && chmod +x crsstat
echo 'status.pl d $@' > dgstat      && chmod +x dgstat
echo 'status.pl i' > db_status.tvdp && chmod +x db_status.tvdp

If you mapped the variables and aliases as described above, your old scripts probably will work as before.

Combining both environments

This is not recommended. But if you use Perl libraries of Basenv, you can try it. Check your current basenv Perl variables env |grep PERL and add it to the dmk configuration.

var::TVD_BASE::=::nowarn::/u00/app/oracle/tvdtoolbox::
var::DBA_BASE::=::nowarn::$TVD_BASE/dba::
var::DMK_POST_PATH::+::end::$DBA_BASE/bin:$TVD_BASE/tvdperl-all/bin/::
var::LD_LIBRARY_PATH::+::end::$DBA_BASE/lib::
var::TVDPERL_BASE::=::nowarn::$TVD_BASE/tvdperl-all::
var::TVDPERLBIN::=::nowarn::/usr/bin/perl::
var::TVDPERLLIB::=::nowarn::$DBA_BASE/lib:$DBA_BASE/lib/perl::
var::TVDPERL_HOME::=::nowarn::$TVD_BASE/tvdperl-all::
PreviousVariables and aliasesNextStructure

Last updated 4 months ago

⚙️