合 Oracle对pdb进行重命名(改名)
脚本
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | -- 步骤1、启动pdb到受限模式(在pdb里边操作) alter session set container=pdblhr3; alter pluggable database pdblhr3 close immediate; alter pluggable database pdblhr3 open restricted; -- 或: shutdown immediate startup open restrict -- 步骤2、进入pdb里边对pdb进行重命名 alter session set container=pdblhr3; select * from global_name; alter pluggable database pdblhr3 rename global_name to pdbprod3; -- 步骤3、正常关闭和启动pdb alter pluggable database close immediate; alter pluggable database open; -- 或 shutdown immediate startup |
例如:将JDE重命名为JDEPROD
1 2 3 4 5 6 | alter pluggable database JDE close immediate; alter pluggable database JDE open restricted; alter session set container=JDE; alter pluggable database rename global_name to JDEPROD; alter pluggable database close immediate; alter pluggable database open; |