How to Create (Or Drop) a Pluggable Database

Introduction

The following explains how to create a pluggable database using the seed database.

Step-By-Step

1. Create Directory Path and Connect to the Container Database

  • mkdir /u01/app/oracle/oradata/mycontainerdb/myplugdb3
  • sqlplus / as sysdba

2. Create the Pluggable Database

  • SQL> CREATE PLUGGABLE DATABASE myplugdb3
  • SQL> ADMIN USER myadminuser
  • SQL> IDENTIFIED BY mypassword ROLES=(DBA)
  • SQL> FILE_NAME_CONVERT=('/u01/app/oracle/oradata/mycontainerdb/pdbseed','/u01/app/oracle/oradata/mycontainerdb/myplugdb3')
  • SQL> /

3. Check the Status of the New Pluggable Database

  • SQL> SELECT PDB_NAME, STATUS FROM CDB_PDBS;
  • SQL> SELECT NAME, OPEN_MODE FROM V$PDBS;

Note: The open_mode of the new pluggable database will be mounted.

4. Drop the Pluggable Database

  • SQL> DROP PLUGGABLE DATABASE myplugdb3 INCLUDING DATAFILES;
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License