Drop pluggable database in oracle
=> connect to the container database
=> close the pluggable database
=> unplug the pluggable database (optional)
=> drop the pluggable database
.if we are using the command without including datafiles , this only remove pdb not underline datafiles etc .
SQL> alter session set container =cdb$root;
Session altered.
SQL> show pdbs
CON_ID CON_NAME OPEN MODE RESTRICTED
---------- ------------------------------ ---------- ----------
2 PDB$SEED READ ONLY NO
3 PDB READ WRITE NO
4 DEMO1 READ WRITE NO
SQL>
SQL> alter pluggable database demo1 close immediate;
Pluggable database altered.
SQL> show pdbs
CON_ID CON_NAME OPEN MODE RESTRICTED
---------- ------------------------------ ---------- ----------
2 PDB$SEED READ ONLY NO
3 PDB READ WRITE NO
4 DEMO1 MOUNTED
SQL> drop pluggable database demo1 including datafiles;
Pluggable database dropped.
SQL> show pdbs
CON_ID CON_NAME OPEN MODE RESTRICTED
---------- ------------------------------ ---------- ----------
2 PDB$SEED READ ONLY NO
3 PDB READ WRITE NO
SQL>
No comments:
Post a Comment