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
  • DMK configuration and variables of pluggabable database(s)
  • Configuration
  • Variables
  • Oracle Multitenant Database core integration
  • List pluggable databases & setting environment
  • Pluggable database administration
  1. Structure

Oracle Database Multitenant – DMK features

This chapter presents the DMK features related to Oracle Multitenant ("Pluggable Databases") architecture

PreviousOracle Grid Infrastructure & DMKNextScripts

Last updated 1 month ago

DMK configuration and variables of pluggabable database(s)

Configuration

There is no Oracle configuration file or OS-process to identify PDBs, so you can only know which PDBs exist with a select in the CDB.

DMK Release 1: In this release the pluggable databases are added as a comma-separated list after the start-flag of the /etc/oratab entry

DMK Release 2:

For each pluggable database an (empty) file will be created below $DMK_ORA_ADMIN_SID/dmk/pdbs; That is automatically done

  • the 1st time the database (cdb) is detected (and is open)

  • each time " inst" (alias istat) is called

  • If DMK is sourced for the SID and the variable DMK_NO_PDB_CHECK is NOT set or 0.

The PDB file $DMK_ORA_ADMIN_SID/dmk/pdbs/PDBNAME (initially created empty) can be used for PDB specific settings, e.g. for PDB1 of instance DBICDB. The format is the same as dmk.conf or $ORACLE_SID.conf

[DBICDB.PDB1]
var::TESTVARPDB01::=::nowarn::TestValue::

If DMK detects a new PDB, it creates the empty configuration file, or if it detects the removal of a PDB, it deletes the configuration file described above. Because "status.pl inst" (alias istat) is executed and not sourced, it only can update the configuration files, but not the environment. To get the new PDB alias, you have to re-source DMK, The status.pl utility gives you the information to do so:

INFO: New PDB found: 'WEBP'
INFO: Old PDB deleted: 'WEBT'

**************************************************************
WARNING: Changes in PDBs detected. Re-source your environment!
**************************************************************

Variables

DMK_PDBS_$ORACLE_SID

For each container database instance this variable is generated with a space-separated list of the user PDBs (not PDB$SEED and CDB$ROOT), e.g. "PDB1 PDB2 PDB3". If the variable is empty, then it is a container database without a PDB.

DMK_SID_PDB_NAME, DMK_SID_PDB

DMK_SID_PDB_NAME contains the name of the current PDB or CDB$ROOT. DMK_SID_PDB contains the string to be printed in the prompt, e.g. ' (PDB1)'.

DMK_NO_SID_PDB_ALIASES

For each known PDB an alias SID.PDB will be generated. If this variable is set to 1, the aliases will not be generated.

DMK_PDB_CHECK

To check if there are new PDBs or if PDBs are deleted, a login to the container database is required. To reduce the overhead, DMK will per default only check for PDB changes if the instance status is shown (. dmk.sh -s SID (alias SID) -or- status.pl i (alias istat).

If you have a very agile environment with often add/remove of PDBs to an existing CDB, then it is recommended to set this variable to 1.

#dmk.conf.local
var::DMK_NO_PDB_CHECK::=::nowarn::1::

DMK_ORA12C_PDBS

Do NOT use this variable. It is obsolete, the name is misleading and it will be removed in a future release. Use DMK_PDBS_$ORACLE_SID instead.

Oracle Multitenant Database core integration

List pluggable databases & setting environment

The listing of the pluggable databases of the current SID have been added to the database status script (alias istat). Alternatively you can also use the “lspdb” alias.

Example: Setting the ORACLE_SID for database DBICDB:

Example: Output of the command lspdb

oracle@vmoel58:/home/oracle/ [CDBUTF8 (CDB$ROOT)] lspdb
******** dbi services Ltd. ********
DBICDB -- Pluggable database(s)
-----------------------------------
PDB name : Open Mode
-----------------------------------
LMA : READ WRITE
PDB$SEED : READ ONLY
PDB1 : READ WRITE
***********************************

To list all (known) PDBs, use the lspdbs.pl script (alias lspdbs). It is based on the DMK_PDBS_<SID> variables.

sid:      pdb's
--------  -----
DB1830:   PDB
DB18SE:
DB1970:   PDB01 PDB02
DB2100A:  DB2100PDB1

Pluggable database administration

This feature allows performing the “alter session set container” within sqlplus automatically, using an operating system alias. The current container name is displayed within the default prompt. This works through an SQL-statement, defined by the variable DMK_EXEC_SQL_SCRIPT in DMK.conf.default. If you specify it, DMK will append the statement to your script by creating a temporary execution copy.

The PDBs are defined as a (empty) file in $DMK_ORA_ADMIN_SID/dmk/pdbs/; Optionally you can define PDB-specific variables and aliases in it.

Example of setting the environment for a pluggable database:

oracle@vmoel58:/u01/app/oracle/local/dmk/ [CDBUTF8 (CDB$ROOT)] pdb1
oracle@vmoel58:/u01/app/oracle/local/dmk/ [CDBUTF8(PDB1)] sqh
SQL*Plus: Release 19.12.0.0 Production on Sun Jun 30 10:31:00 2021
Copyright (c) 2021, 2013, Oracle. All rights reserved.
Connected to:
Oracle Database 19c Enterprise Edition Release 19.12.0.0 - 64bit Production
With the Partitioning, OLAP, Advanced Analytics and Real Application Testing
options
SQL> show con_name
CON_NAME
------------------------------
PDB1

New with Release 2:

Instead of setting first the environment for the CDB, then the environment for the PDB (which still works), you can directly set a pdb environment with the alias <CDB>.<PDB>, in the example above with

CDBUTF8.PDB1
cdbutf8.pdb1

If you call the instance-status (istat), the PDB files will be updated, but aliases and variables are not yet set because status.pl is executed and not sourced. Re-source dmk, then the environment is updated.

🗄️
ℹ️
ℹ️
status.pl