您的位置:首页 > 数据库 > Oracle

Oracle duplicate搭建dataguard (Backup-based duplication)

2015-10-16 15:02 309 查看
duplicate搭建DG (Backup-based duplication)
源库:

run
{
allocate channel ch1 device type disk;
allocate channel ch2 device type disk;
backup as compressed backupset database;
sql 'alter system archive log current';
release channel ch1;
release channel ch2;
}

查询出数据文件路径
select 'set newname for datafile '||FILE_ID||' to '||file_name||';' from dba_data_files;

select 'set newname for datafile '||FILE_ID||' to '||file_name||';' from dba_TEMP_files;

使用duplicate,要在备库有跟主库一样的备份目录并且有备份集在里面,在主库运行命令。

在备库上配置好pfile和standby controlfile

备库操作:
auxorcl是目标库tnsname。

rman target sys/oracle@orcl auxiliary sys/oracle@auxorcl;

run
{
set newname for datafile 1 to '/u01/app/oracle/oradata/auxorcl/system01.dbf';
set newname for datafile 2 to '/u01/app/oracle/oradata/auxorcl/sysaux01.dbf';
set newname for datafile 3 to '/u01/app/oracle/oradata/auxorcl/undotbs01.dbf';
set newname for datafile 4 to '/u01/app/oracle/oradata/auxorcl/users01.dbf';
set newname for datafile 5 to '/u01/app/oracle/oradata/auxorcl/test.dbf';
set newname for tempfile 1 to '/u01/app/oracle/oradata/auxorcl/temp01.dbf';
duplicate target database for standby;
}

本文出自 “Sysdba” 博客,请务必保留此出处http://sysdba.blog.51cto.com/10492366/1703515
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: