本帖最后由 郑全 于 2021-10-29 18:45 编辑
使用 DBCA 克隆远端PDB
远端:192.168.133.120,cdb1 /pdb1
本地:192.168.133.121, cdb2/pdb2
1.前提
两个CDB(我们这里就叫cdb1,cdb2),都必须开始归档
都使用本地UNDO
select name,LOCAL_UNDO from v$containers;
NAME LOCAL_UNDO
------------------------------ ----------
CDB$ROOT 0
PDB$SEED 1
PDB1 1
2.操作前准备
1.登录源端,连接到cdb1
sql>connect sys/oracle_4U@cdb1 as sysdba
2.创建一个通用用户用于 DBLINK的创建
sql>create user c##remote_user identified by oracle_4U container=all;
3.授予create session,create pluggable database权限
sql>grant create session,create pluggable database to c##remote_user container=all;
4.退出
sql>exit;
3.使用dbca 克隆远程pdb
把cdb1中pdb1 克隆到cdb2 中,取名为pdb2
dbca -silent -createPluggableDatabase -createFromRemotePDB \
-remotePDBName pdb1 \
-remoteDBConnString 192.168.133.121:1521/cdb1 \
-remoteDBSYSDBAUserName SYS \
-remoteDBSYSDBAUserPassword oracle_4U \
-sysDBAUserName sys \
-sysDBAPassword oracle_4U \
-dbLinkUsername c##remote_user \
-dbLinkUserPassword oracle_4U \
-sourceDB cdb2 -pdbName pdb2
错误:
[FATAL] [DBT-19401] Archive log mode is not enabled in the (cdb1) database.
CAUSE: (cdb1) database should be configured with archive log mode to perform the operation.
必须开启归档
[FATAL] [DBT-08101] The selected PDB (pdb1) is not open.
CAUSE: PDB has to be open in READ WRITE mode to perform the configuration.
-remoteDBConnString 192.168.133.121:1521/cdb1
[FATAL] [DBT-19402] Local undo mode is not enabled in the (cdb1) container database.
CAUSE: Local undo mode should be enabled in the (cdb1) container database to perform the operation.
远端必须为 本地UNDO模式
|