oracle克隆pdb,ORACLE_CDB/PDB克隆迁移转换

Oracle 12c PDB/CDB相关测试

1. 本地克隆pdb

1.1 环境检查

源环境和目标环境执行

数据库版本12.2.0.1.0.

$ sqlplus / as sysdba

SQL> show pdbs;

CON_ID CON_NAME                   OPEN MODE  RESTRICTED

---------- ------------------------------ ---------- ----------

2 PDB$SEED                READ ONLY  NO

3 ORCLPDB                 READ WRITE NO

4 TESTCLONEPDB              MOUNT NO

1.2 环境克隆

$ sqlplus / as sysdba

SQL> alter session set container= TESTCLONEPDB;

Session altered.

SQL> alter database open read only;

Database altered.

SQL > exit;

SQL> show pdbs;

CON_ID CON_NAME                   OPEN MODE  RESTRICTED

---------- ------------------------------ ---------- ----------

2 PDB$SEED                READ ONLY  NO

3 ORCLPDB                 READ WRITE NO

4 TESTCLONEPDB              READ WRITE NO

SQL> exit

SQL> create pluggable database testpdb from ORCLPDB file_name_convert=('orclpdb','testpdb');

Pluggable database created.

SQL> show pdbs;

CON_ID CON_NAME                   OPEN MODE  RESTRICTED

---------- ------------------------------ ---------- ----------

2 PDB$SEED                READ ONLY  NO

3 ORCLPDB                 READ WRITE NO

4 TESTCLONEPDB              READ WRITE NO

5 TESTPDB                   MOUNTED

SQL> alter session set container= TESTPDB;

Session altered.

SQL> show pdbs

CON_ID CON_NAME                   OPEN MODE  RESTRICTED

---------- ------------------------------ ---------- ----------

5 TESTPDB                   MOUNTED

SQL> alter database open;

Database altered.

SQL> show pdbs;

CON_ID CON_NAME                   OPEN MODE  RESTRICTED

---------- ------------------------------ ---------- ----------

5 TESTPDB                   READ WRITE NO

2. 跨服务器克隆pdb

2.1 本地复制异地进行插入方式

2.1.1 源环境克隆

源端执行:

$ sqlplus / as

你可能感兴趣的:(oracle克隆pdb)