DMK_ENV.pm

NAME

DMK_ENV.pm -- Core DMK library to set/get the environment, used by DMK perl scripts

SYNOPSIS

use DMK_ENV;

it exports the following functions and procedures that can directly be called by another perl-script:

  • set_internal_config_var()

  • set_internal_config_alias()

  • modify_path()

  • get_env()

  • get_home_version()

  • get_pdbfiles()

  • get_processes()

  • read_ora_homes()

  • read_ora_sids()

  • read_orabasetab()

  • read_dmk_config()

  • write_ora_sids()

and it exports the following global variables:

  • $iswin

    For Unix=0, for Windows=1

  • $iswin

    Is the script running in an interactive terminal (tty -s)? 1=yes

  • %orahomes

    Information about ORACLE_HOME's from $etc/ora_homes. For a detailed field description, see the header of the configuration file. For the current home, additional information is gathered: rel (release), ver (version), rooh (read-ony OH, roohctl)

      $orahomes{'/u00/app/oracle/product/19.7.0'} => {
         'oracle_base' => '/u00/app/oracle',
         'product' => 'rdbms_ee',
         'invname' => 'OraDB19Home1',
         'rooh' => 0,
         'dbs' => '/u00/app/oracle/product/19.7.0/dbs',
         'existing' => 1,
         'version' => 'AUTO',
         'ver' => '190700',
         'rel' => 1900,
         'name' => 'rdbms1900'
      },
  • %orasids

    Information about ORACLE_SID's from $etc/ora_sids (existing=1) or a new detected ORACLE_SID. For a detailed field description, see the header of the configuration file.

      $orasids{'DB1970'} => {
         'home' => '/u00/app/oracle/product/19.7.0',
         'crstype' => '',
         'admin' => '/u00/app/oracle/admin/DB1970A',
         'existing' => 1,
         'instances' => '',
         'type' => 'I'
      },
  • %dmk_config_var

    Information about variables set by dmk-core.pl ([INTERNAL]) or from configuration files. For details about setting the variables, see $DMK_HOME/bin/dmk-core.pl The hash is structured by section (INTERNAL/GLOBAL/SID/[ORACLE_SID]/[ORACLE_SID.PDB]), followed by the variable name.

    This hash is built by the "Tie::IxHash" module, so the chronoligical order is preserved in a loop.

      $dmk_config_var{'GLOBAL'}{'ORATAB'} => {
         'name' => 'ORATAB',       #field 2 of config line
         'warn' => 1,              # = with nooption
         'value' => '/etc/oratab', # field 5
         'line' => 'var::ORATAB::=::nooption::"/etc/oratab"::
      },
  • %dmk_config_alias

    Information about aliases set by dmk-core.pl ([INTERNAL], usually "SID", "SID.PDB" and "cdd.*" aliases) or from configuration files. The hash is structured by section (INTERNAL/GLOBAL/SID/[ORACLE_SID]/[ORACLE_SID.PDB]), followed by the alias name.

      $dmk_config_alias{'GLOBAL'}{'cda'} => {
         'name' => 'cda',                      #field 2 of config line
         'option' => 'var_noforce',            #field 3
         'value' => 'cd ${DMK_ORA_ADMIN_SID}', #field 4
         'line' => 'alias::cda::var_noforce::\'cd ${DMK_ORA_ADMIN_SID}\'::'
      },
  • @sidlist

    array with all ORACLE_SID's from $etc/ora_sids (1st field)

  • @ora_homes

    array with all lines of $etc/ora_homes

  • $ora_homes_changed

    Set to 1 if a change is detected with ORACLE_HOME's, e.g. a home was deleted (compared to ora_homes)

  • @ora_sids

    array with all lines of $etc/ora_sids

  • $ora_sids_changed

    Set to 1 if a change is detected with ORACLE_SID's, e.g. a SID was deleted or added (compared to ora_sids)

  • $initialsid

    Which SID should be set if dmk.sh is sourced without a SID. DMK automatically chooses a SID, but this can be overridden by the variable DMK_INITIALSID in the [GLOBAL] section

  • $grid_home

    ORACLE_HOME of the used Grid-Infrasture.

  • $host_short

    The hostname without domain.

  • $separator

    Directory separator within a PATH variable. For Unix it is ":"

  • $DMK_ORATAB_STAT,

  • $DMK_ORAGCHOMELIST_STAT

  • $DMK_ORAINVENTORY_STAT

  • $DMK_ORA_HOMES_STAT

  • $DMK_ORA_SIDS_STAT

    All these DMK_[configfile]_STAT variables contain the size in bytes and the timestamp in sec since 1970. It is used to detect changes of the environment. If it is unchanged, the time-consuming process of re-read the whole environment can be omitted.

FUNCTIONS, PROCEDURES

PROCEDURE set_internal_config_var

set variables generated by dmk (not via configfile), It is a wrapper to fill the %dmk_config_var hash

Parameter

  • $VAR: DMK variable name (usually uppercase)

  • $value: value of the variable

  • $option: nooption, nowarn (default)

POD ERRORS

Hey! The above document had some coding errors, which are explained below:

  • Around line 207:

    Unterminated F<...> sequence

Last updated