How to drop pluggable database in Oracle Database 19c

How to drop pluggable database in Oracle Database 19c:


Steps to drop pluggable database:


1) Source CDB env and connect as sysdba:


[oracle@ora19cdatabase ~]$ sqlplus / as sysdba

SQL*Plus: Release 19.0.0.0.0 - Production on Mon Nov 25 09:09:02 2024
Version 19.22.0.0.0

Copyright (c) 1982, 2023, Oracle.  All rights reserved.


Connected to:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.22.0.0.0

SQL> show pdbs

    CON_ID CON_NAME                       OPEN MODE  RESTRICTED
---------- ------------------------------ ---------- ----------
         2 PDB$SEED                       READ ONLY  NO
         4 TEST1                     READ WRITE NO  --> Pluggable database to be dropped

2) Stop Pluggable database:


SQL> alter pluggable database "TEST1"  close;

Pluggable database altered.

3) Unplug/backup Pluggable database to a file:


SQL> alter pluggable database "TEST1" unplug into '/home/oracle/TEST1_pdb_19c.xml';

Pluggable database altered.

4) Drop Pluggable database:


SQL> drop pluggable database "TEST1";

Pluggable database dropped.

SQL> show pdbs

    CON_ID CON_NAME                       OPEN MODE  RESTRICTED
---------- ------------------------------ ---------- ----------
         2 PDB$SEED                       READ ONLY  NO
SQL>



Post a Comment

0 Comments