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
源库:
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
相关文章推荐
- oracle开启闪回
- oracle 11G DG物理备库与快照备库的互相转换
- oracle运行失败的类型
- oracle中number数据类型对应java中的基本数据类型
- Oracle递归查询
- ORACLE“监听程序未启动或数据库服务未注册到该监听程序”解决方法
- oracle系统包—-dbms_output用法
- oracle如何导入数据库
- mybatis 调用 oracle 返回结果集 存储过程
- oracle中表中含有的日期字段如何作为筛选条件
- Oracle如何插入在特殊字符: & 和 ' (各种解决方案)
- 成功部署SSIS中含有Oracle数据库连接的ETL包
- 包子的 oracle 学习笔记---触发器
- Oracle 锁与session
- oracle中escape的使用
- PowerDesigner连接oracle数据库时出现由于系统错误 1114 (oracle in oradb11g_home1)指定驱动程序无法加载 sqlstate=IM003
- oracle 11gR2 RAC 连接实例时遇到ora-12537,求指点
- java 插入oracle中clob字段
- Oracle 10g RAC TAF介绍
- vs2015安装ORACLE的DbFirst