
从本地克隆
create pluggable database PDB2 from PDB1
file_name_convert=('pdb1','pdb2')
parallel 8;
创建完毕后新pdb是mount状态,需要open一下
alter pluggable database pdb2 open;
创建快照pdb
alter system set clonedb=true scope=spfile;
startup force
alter pluggable database pdb1 open read only;
create pluggable database pdbsnap1 from pdb1 snapshot cope file_name_convert('pdb1','pdbsnap');
alter pluggable database pdbsnap open;
--记得把pdb1设置为read write状态
删除旧的pdb
alter pluggable database pdb1 close;
drop pluggable database pdb1 including datafiles;
pdb改名
conn as sysdba
sho pdbs
alter pluggable database &1 close immediate;
alter pluggable database &1 open restricted;
alter pluggable database &1 rename global_name to &2;
alter pluggable database &2 close immediate;
alter pluggable database &2 open;
sho pdbs
建议将上述脚本存为 renpdb.sql ,执行时:
SQL> @renpdb pdb1 pdbnew
详见阅读原文




