Wednesday, September 9, 2015

VIMAL:CREATION OF CONTAINER DATABASE

Creation of a CDB

The CREATE DATABASE ... ENABLE PLUGGABLE DATABASE SQL statement creates a new CDB. If you do not specify the ENABLE PLUGGABLE DATABASE clause, then the newly created database is a non-CDB and can never contain PDBs.

Along with the root (CDB$ROOT), Oracle Database automatically creates a seed PDB (PDB$SEED). The following graphic shows a newly created CDB:

Determining Whether a Database Is a CDB

SQL> SELECT NAME, CDB, CON_ID FROM V$DATABASE;


Creating a pluggable Database

SQL> CREATE PLUGGABLE DATABASE hrpdb  ADMIN USER dba1 IDENTIFIED BY password

If you clone from a remote CDB, then you must use a database link.

The following SQL statement clones a PDB named salespdb from the plugged-in PDB named hrpdb:

SQL > CREATE PLUGGABLE DATABASE salespdb FROM hrpdb

No comments:

Post a Comment