본문 바로가기

Database/Oracle

48 - [Oracle 19C] Dropping PDB using SQL

 

 

SQL> show pdbs

    CON_ID CON_NAME			  OPEN MODE  RESTRICTED
---------- ------------------------------ ---------- ----------
	 2 PDB$SEED			  READ ONLY  NO
	 3 ORCLPDB			  READ WRITE NO
	 4 PDB1 			  READ WRITE NO
	 5 PDB2 			  READ WRITE NO


SQL> drop pluggable database pdb2 including datafiles;
drop pluggable database pdb2 including datafiles
*
ERROR at line 1:
ORA-65025: Pluggable database PDB2 is not closed on all instances.


SQL> alter pluggable database pdb2 close;
Pluggable database altered.


SQL> drop pluggable database pdb2 including datafiles;
Pluggable database dropped.


SQL> show pdbs

    CON_ID CON_NAME			  OPEN MODE  RESTRICTED
---------- ------------------------------ ---------- ----------
	 2 PDB$SEED			  READ ONLY  NO
	 3 ORCLPDB			  READ WRITE NO
	 4 PDB1 			  READ WRITE NO