十年网站开发经验 + 多家企业客户 + 靠谱的建站团队
量身定制 + 运营维护+专业推广+无忧售后,网站问题一站解决
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