Oracle Database Multitenant – DMK features
This chapter presents the DMK features related to Oracle Multitenant ("Pluggable Databases") architecture
Last updated
This chapter presents the DMK features related to Oracle Multitenant ("Pluggable Databases") architecture
Last updated
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
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:
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.
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.
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
To list all (known) PDBs, use the lspdbs.pl script (alias lspdbs). It is based on the DMK_PDBS_<SID> variables.
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:
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
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.