您好,登录后才能下订单哦!
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
免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。