重庆思庄Oracle、Redhat认证学习论坛

标题: 使用UNPLUG方式在CDB之间移动PDB [打印本页]

作者: 郑全    时间: 2022-11-13 17:35
标题: 使用UNPLUG方式在CDB之间移动PDB
从CDB1 把PBB1 拔下,再插入到CDB2里面去


1.从CDB1拔下PDB1
  1.1 连接到CDB1
     sql>conn sys/sztech_4U@cdb1 as sysdba
     sql>alter pluggable database pdb1
          unplug into '/tmp/pdb1.xml';

  1.2 从cdb1删除pdb1        
     sql>drop pluggable database pdb1;

2.把pdb1插入到cdb2
2.1 登录到cdb2
    sql>connect sys/sztech_4U@cdb2 as sysdba
2.2 检查pdb1是否可以插入
    sql>
    set serveroutput on

    DECLARE
      l_result BOOLEAN;
    BEGIN
      l_result := DBMS_PDB.check_plug_compatibility(pdb_descr_file => '/tmp/pdb1.xml',pdb_name => 'pdb1');
      IF l_result THEN
        DBMS_OUTPUT.PUT_LINE('compatible');
      ELSE
        DBMS_OUTPUT.PUT_LINE('incompatible');
      END IF;
    END;
    /
    结果为      compatible 才行。

2.3    插入
   SQL> create pluggable database pdb1
        using '/tmp/pdb1.xml' nocopy;

       Pluggable database created.
2.4 打开PDB1
   sql> alter pluggable database pdb1 open;

   sql>show pdbs;






欢迎光临 重庆思庄Oracle、Redhat认证学习论坛 (http://bbs.cqsztech.com/) Powered by Discuz! X3.2