創建PDB
create pluggable database sc_new file_name_convert=('pdbseed','sc_new ');
克隆PDB
create pluggable database pdb2 from pdb1;
刪除PDB
刪除PDB之前需要將PDB先關閉,使用drop pluggable database命令,如下:
alter pluggable database sc_new close;
drop pluggable database sc_new including datafiles;
拔出和插入PDB
關閉PDB
alter pluggable database testpdb4 close immediate;
拔出PDB
拔出PDB的時候指定xml位置,xml中記錄了PDB的信息,例如數據文件目錄,DBID,PDB參數等等
alter pluggable database testpdb4 unplug into '/home/oracle/testpdb4.xml';
被拔出的PDB只能被刪除,不能做其它操作,例如mount,打開等.
插入PDB
使用create pluggable database指定xml位置來插入PDB
create pluggable database testpdb4 using '/home/oracle/testpdb4.xml' nocopy;
V$SERVICES視圖可以顯示數據庫中的可用服務。