在12C R1 版本中,PDB数据库克隆需要将源库置于READ ONLY模式,然后才能进行数据库的克隆,影响数据库的使用。 在12C R2版本中,oracle引入了hot clone的功能,可以通过在线的方式对PDB数据库进行复制,在线的业务不受影响。 --本地热克隆 SQL> !mkdir–p /oracle/app/oracle/oradata/orcl/pdb2 SQL> CREATE PLUGGABLE DATABASE pdb2 frompdb1 CREATE_FILE_DEST='/oracle/app/oracle/oradata/orcl/pdb2';
SQL> ALTER PLUGGABLE DATABAE pdb2 open;
--除了本地热克隆,还可以对远端数据库(PDB/NO-CDB)进行热克隆: --对远端数据库进行热克隆需要先DBLINK(DBLINK可以指向远端CDB,也可以指向要复制的PDB): ORCL = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = 12c-test)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = orcl) ) ) pdb1 = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = 12c-test)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = pdb1) ) )
SQL> create database link orcl connect to system identified by oracle using'orcl'; SQL> !mkdir –p /oracle/app/oracle/oradata/bak/bakpdb2 SQL> create pluggable database bakpdb2from pdb1@orclCREATE_FILE_DEST='/oracle/app/oracle/oradata/bak/bakpdb2'; SQL> alter pluggable database bakpdb2 open;
|