oracle11g dg方案
合集下载
相关主题
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
跳归档恢复
• 归档丢失,重建备库
– SELECT CURRENT_SCN FROM V$DATABASE;
• 增量备份 • 同步控制文件 • 数据变化不频繁,恢复过一个丢失半年归档的 数据库 • reset database to incarnation 2;
跳归档恢复
• 主库: • BACKUP INCREMENTAL FROM SCN 2291364 DATABASE FORMAT '/home/oracle/backup_stage/sdataguru_%U' tag 'FORSTANDBY'; • 备份控制文件 • 备库: • 恢复控制文件 • catalog start with '/U01/backup_stage/increment_backup'; • Recover managed standby database cancel; • recover database noredo ; • col CURRENT_SCN format 9999999999999999999999 • SELECT CURRENT_SCN FROM V$DATABASE; • recover managed standby database disconnect from session;
知识点概览
• • • • • • • • • 简单搭建Data Guard Failover Switchover ADG Snapshot Standby 跳归档恢复 备库的设计方案 闪回数据库 故障分析
简单搭建Data Guard
• fs.aio-max-nr= 3145728 • cat /proc/swk.baidu.coms/fs/aio-max-nr • sysctl -w fs.aio-max-nr=3145728 • rman target sys/oracle@dataguru auxiliary sys/oracle@sdataguru nocatalog • Duplicate target database for standby from active database nofilenamecheck; • create configuration dg_dataguru as primary database is dataguru connect identifier is dataguru; • add database sdataguru as connect identifier is sdataguru maintained as physical;
Failover to physical standby
1.resolve gap SELECT thread#, low_sequence#, high_sequence# FROM v$archive_gap; ALTER DATABASE REGISTER PHYSICAL LOGFILE 'filespec1‘ 2.Finish recover ALTER DATABASE RECOVER MANAGED STANDBY DATABASE FINISH FORCE; 3. Convert to primary ALTER DATABASE COMMIT TO SWITCHOVER TO PRIMARY Reinstate 避免重复搭建Data Guard, 原理 原来的主库开启 闪回数据库
备库的设计方案
备库的设计方案
极端环境的恢复
闪回数据库
闪回数据库
• Startup mount • Alter database flashback on;
11g的改进 Alter database flashback on Alter database flashback off
故障分析
Active Data Guard
• Select open_mode from v$database;
– READ ONLY WITH APPLY
• Recover managed standby database disconnect from session; • Recover managed standby database disconnect from session using current logfile;
Snapshot Standby
• • • • • • • • 可读可写的备库 切换为Snapshot Standby select database_role,open_mode from v$database; Dgmgrl convert database sdataguru to snapshot standby; SQL Alter database convert to snapshot standby; 切换回Physical Standby dgmgrl convert database sdataguru to physical standby; SQL alter database convert to physical standby; 切换角色之后,需要重启备库
Drop Datafile导致的Oracle Bug 10.2.0.4.0 – Add datafile – Drop datafile – MRP shutdown – Bug 5623467 - Corrupt redo from ALTER TABLESPACE DROP DATAFILE (文档 ID 5623467.8)
11g备库无法开启ADG的原因分析 – Show parameter compatible – 备库的compatible为11.1.0.7以上
Switchover
• 1.Verify that it is possible select database_role,switchover_status from v$database; • 2.Initiate the switchover operation on the primary database alter database commit to switchover to physical standby with session shutdown wait; • 3.Shut down and restart the original primary instance • 5.Verify the switchover status in standby • 6.Switch the physical standby database role to the primary role alter database commit to switchover to primary; • 7.open the new primary database • 8.Start recover alter database recover managed standby database disconnect from session; alter database recover managed standby database using current logfile Disconnect from session;