duplicate在线创建物理备库
1、primary上设置相关参数
alter system set log_archive_config='dg_config=(orcl,orcla,orclb)' scope=both sid='*';
alter system set log_archive_dest_1='LOCATION=+ARCH/ORCL/ARCHIVELOG valid_for=(all_logfiles,all_roles) db_unique_name=orcl' scope=both sid='*';
alter system set log_archive_dest_2='service=orcla valid_for=(online_logfiles,primary_role) db_unique_name=orcla lgwr async ' scope=both sid='*';
alter system set log_archive_dest_3='service=orclb valid_for=(online_logfiles,primary_role) db_unique_name=orclb lgwr async' scope=both sid='*';
alter system set log_archive_dest_state_2='defer' scope=both sid='*';
alter system set log_archive_dest_state_3='defer' scope=both sid='*';
alter system set log_archive_max_processes=30 sid='*';
alter system set fal_server='orcla,orclb' scope=both sid='*';
alter system set fal_client='orcl' scope=both sid='*';
alter system set standby_file_management='auto';
alter system set db_file_name_convert='+ORADATA','+ORADATA' scope=spfile;
alter system set log_file_name_convert='+ORADATA','+ORADATA' scope=spfile;
2、添加standby redo
alter database add standby logfile thread 1 group 4('/data0/u01/app/oracle/oradata/ora11g/standby_redo04.log') size 50m;
alter database add standby logfile thread 1 group 5('/data0/u01/app/oracle/oradata/ora11g/standby_redo05.log') size 50m;
alter database add standby logfile thread 1 group 6('/data0/u01/app/oracle/oradata/ora11g/standby_redo06.log') size 50m;
alter database add standby logfile thread 1 group 7('/data0/u01/app/oracle/oradata/ora11g/standby_redo07.log') size 50m;
-
alter database add standby logfile thread 1 group 5 size 50m , group 6 size 50m , group 7 size 50m;
alter database add standby logfile thread 2 group 8 size 50m , group 9 size 50m , group 10 size 50m;
--
3、备库
安装软件, 配置环境变量
配置监听文件listener.ora和tnsnames.ora
--注意linstener.ora 中的SID_NAME指定的是$ORACLE_SID
DUPLICATE TARGET DATABASE
FOR STANDBY FROM ACTIVE DATABASE
DORECOVER
SPFILE SET "db_unique_name"="orcla" SET LOG_ARCHIVE_DEST_2="service=orcla ASYNC REGISTER
VALID_FOR=(online_logfile,primary_role)" SET FAL_CLIENT="orcla"
SET FAL_SERVER="orcl"
NOFILENAMECHECK;
针对以上过程,rman会自动拷贝server端的参数文件到standby端,然后启动到nomount状态,还原控制文件,并拷贝所有的数据文件、临时表空间和归档日志到备库。然后进行recovery
4、在primary端(standby端均可)登录rman
rman target sys/oracle@orcl auxiliary sys/oracle@orcla nocatalog
duplicate target database for standby from active database nofilenamecheck
ALTER DATABASE OPEN READ ONLY;
RECOVER MANAGED STANDBY DATABASE USING CURRENT LOGFILE DISCONNECT FROM SESSION;
SQL> col DEST_NAME format a30
SQL> col DESTINATION format a30
SQL> SELECT dest_name, status, destination FROM v$archive_dest;
参考--http://www.cnblogs.com/Bccd/p/6362786.html
免责声明:
① 本站未注明“稿件来源”的信息均来自网络整理。其文字、图片和音视频稿件的所属权归原作者所有。本站收集整理出于非商业性的教育和科研之目的,并不意味着本站赞同其观点或证实其内容的真实性。仅作为临时的测试数据,供内部测试之用。本站并未授权任何人以任何方式主动获取本站任何信息。
② 本站未注明“稿件来源”的临时测试数据将在测试完成后最终做删除处理。有问题或投稿请发送至: 邮箱/279061341@qq.com QQ/279061341