Skip to content

Creating Databases and Pluggable Databases in Containers

Sean Scott edited this page Oct 21, 2020 · 1 revision

Concepts

There are four environment variables that control how a databases and pluggable databases are created.

  • ORACLE_SID: Case-sensitive ORACLE_SID. Default is ORCL for non-container databases, ORCLCDB for container databases, and XE for 18c Express Edition.
  • PDB_COUNT: The number of pluggable databases to be created. Setting PDB_COUNT to 0 creates a non-container database. Ignored in version 11 and when PDB_LIST is set.
  • ORACLE_PDB: Case sensitive pluggable database name. Ignored in version 11. If PDB_COUNT is 1, ORACLE_PDB is used for the name of the single pluggable database created in the container database. If PDB_COUNT > 1, ORACLE_PDB is used as the prefix for all pluggable databases created in the container database. Default is XEPDB for 18c Express Edition, ORCLPDB for all others.
  • PDB_LIST: A comma-delimited, case-sensitive list of pluggable databases to be created. Ignored in version 11. Causes a container database to be created and overrides entries in PDB_COUNT and ORACLE_PDB. Default is not set.

Creating Non-Container Databases

Include -e PDB_COUNT=0 in the docker run command and leave PDB_LIST unset.

Creating Container Databases

A Single Pluggable Database

The default for container-enabled versions is to create a single pluggable database. To specify a name for the PDB, include -e ORACLE_PDB=<NAME> in the docker run command.

Multiple Pluggable Databases

To create multiple, numbered pluggable databases with the same prefix, include -e ORACLE_PDB=<PREFIX> and -e PDB_COUNT=<X> to create pluggable databases with prefix .

To create multiple, custom-named pluggable databases, include -e PDB_LIST="PDB1,PDB2, ... PDBn" in the docker run command. The presence of PDB_LIST overrides settings for PDB_COUNT and ORACLE_PDB.