设为首页 加入收藏

TOP

Oracle 11g DataGuard使用总结(二)
2015-08-31 20:00:17 来源: 作者: 【 】 浏览:206
Tags:Oracle 11g DataGuard 使用 总结
? 修改local_listener为stest11g
? ? ? ? 配置 db_file_name_convert
? ? ? ? ? ? ? log_file_name_convert
? ? db_file_name_convert='/DATA/app/oracle/oradata/test11g','/DATA/app/oracle/oradata/test11g','/DATA/app/oracle/fast_recovery_area/test11g','/DATA/app/oracle/fast_recovery_area/test11g'? ? ? ? ? ? ? log_file_name_convert='/DATA/app/oracle/oradata/test11g','/DATA/app/oracle/oradata/test11g','/DATA/app/oracle/fast_recovery_area/test11g','/DATA/app/oracle/fast_recovery_area/test11g'
检查db_recovery_file_dest 和其它的文件路径是否有效(adump,oradata)
? ? ? ? ? ? ? fal_server
? ? ? ? ? ? ? fal_client
生成spfile
这个时候被库的工作就基本完成了,剩下的就是使用rman来恢复,dg broker来配置了。


?数据复制恢复
?启动备库到nomount阶段
SQL> create spfile from pfile;
?File created.
?SQL> startup nomount
?SQL> !ps -ef|grep dmon_test11g
?oracle? 17773? ? 1? 0 11:44 ?? ? ? ? 00:00:00 ora_dmon_test11g
?oracle? 17779 17733? 0 11:44 pts/0? ? 00:00:00 /bin/bash -c ps -ef|grep dmon_test11g
?oracle? 17781 17779? 0 11:44 pts/0? ? 00:00:00 grep dmon_test11g


检查参数是否生效
?备库通过rman复制数据文件
$? rman target sys/xxxx@test11g auxiliary sys/xxxxx@stest11g nocatalog
?Recovery Manager: Release 11.2.0.4.0 - Production on Mon Jul 27 11:46:23 2015
?Copyright (c) 1982, 2011, Oracle and/or its affiliates.? All rights reserved.
?connected to target database: TEST11G (DBID=1038061657)
?using target database control file instead of recovery catalog
?connected to auxiliary database: TEST11G (not mounted)
?RMAN> duplicate target database for standby from active database nofilenamecheck;


配置完成,数据复制工作就告一段落。
?开始配置dg broker


主库执行:
$ dgmgrl /
?DGMGRL for Linux: Version 11.2.0.4.0 - 64bit Production
?Copyright (c) 2000, 2009, Oracle. All rights reserved.
?Welcome to DGMGRL, type "help" for information.
?Connected.
?DGMGRL> create configuration dg_test11g as
?> primary database is test11g
?> connect identifier is test11g;
?Configuration "dg_test11g" created with primary database "test11g"
?DGMGRL> add database stest11g as
?> connect identifier is stest11g
?> maintained as physical;
?Database "stest11g" added
这个时候配置还没有生效
DGMGRL> show configuration;
?Configuration - dg_test11g
? Protection Mode: MaxPerformance
? Databases:
? ? test11g? - Primary database
? ? stest11g - Physical standby database
?Fast-Start Failover: DISABLED
?Configuration Status:
DISABLED
启用配置
DGMGRL> enable? configuration;
然后再次查看,如果配置没有问题,就会生效。
DGMGRL> show configuration;
?Configuration - dg_test11g
? Protection Mode: MaxPerformance
? Databases:
? ? test11g? - Primary database
? ? stest11g - Physical standby database
?Fast-Start Failover: DISABLED
?Configuration Status:
SUCCESS
接着进行再次验证
DGMGRL> enable database test11g;
?Enabled.
?DGMGRL> enable database stest11g;
?Enabled.
?DGMGRL>
?DGMGRL> show configuration;
?Configuration - dg_test11g
? Protection Mode: MaxPerformance
? Databases:
? ? test11g? - Primary database
? ? stest11g - Physical standby database
?Fast-Start Failover: DISABLED
?Configuration Status:
SUCCESS


?dataguard的搭建就完成了,可以在主库切换日志查看是否在备库数据库日志中会应用日志
Media Recovery Waiting for thread 1 sequence 12 (in transit)
Recovery of Online Redo Log: Thread 1 Group 4 Seq 12 Reading mem 0
? Mem# 0: /DATA/app/oracle/oradata/test11g/redo04.log


?11g备库使用active dataguard特性。
SQL> alter database open;
?Database altered.


?SQL>? recover managed standby database using current logfile disconnect from session;
?Media recovery complete.


?switchover的问题答疑
?如果出现下面的错误,很可能当前操作系统用户下安装了多个数据库实例,取消默认的ORACLE_SID即可。
?或者直接使

首页 上一页 1 2 3 下一页 尾页 2/3/3
】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
分享到: 
上一篇对MySQL event的相关理解 下一篇MySQL普通表转换为分区表(MySQL-..

评论

帐  号: 密码: (新用户注册)
验 证 码:
表  情:
内  容: