首先需要关闭PDB,然后执行删除命令。
[oracle@server ~]$ sqlplus / as sysdba
SQL*Plus: Release 12.2.0.1.0 Production on Wed Apr 17 14:13:20 2019
Copyright (c) 1982, 2016, Oracle. All rights reserved.
Connected to:
Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production
SQL> show pdbs
CON_ID CON_NAME OPEN MODE RESTRICTED
---------- ------------------------------ ---------- ----------
2 PDB$SEED READ ONLY NO
3 ORCLPDB1 MOUNTED
4 ORCLPDB2 MOUNTED
5 ORCLPDB3 MOUNTED
6 LKAPP_ROOT MOUNTED
7 LKAPP_ONE MOUNTED
8 LKAPP_TWO MOUNTED
SQL> drop pluggable database LKAPP_TWO including datafiles;
Pluggable database dropped.
SQL> drop pluggable database LKAPP_ONE including datafiles;
Pluggable database dropped.
SQL> drop pluggable database LKAPP_root including datafiles;
Pluggable database dropped.
SQL> drop pluggable database ORCLPDB3 including contents and datafiles;
drop pluggable database ORCLPDB3 including contents and datafiles
*
ERROR at line 1:
ORA-02000: missing DATAFILES keyword
SQL> drop pluggable database ORCLPDB3 including datafiles;
Pluggable database dropped.
SQL> show pdbs
CON_ID CON_NAME OPEN MODE RESTRICTED
---------- ------------------------------ ---------- ----------
2 PDB$SEED READ ONLY NO
3 ORCLPDB1 MOUNTED
4 ORCLPDB2 MOUNTED
本文介绍了如何在Oracle 12c中删除PDB(Pluggable Database)。首先,需要关闭或分离PDB,然后使用SQL命令`DROP PLUGGABLE DATABASE`配合`INCLUDING DATAFILES`选项来删除包括数据文件在内的整个PDB。示例中展示了删除多个PDB的步骤,并处理了遇到的错误情况。
2211

被折叠的 条评论
为什么被折叠?



