===== 问题 =====

日志损坏无法应用日志(开启MRP应用系统会因无法应用日志而关闭)
Completed: ALTER DATABASE RECOVER MANAGED STANDBY DATABASE USING CURRENT LOGFILE DISCONNECT FROM SESSION
Incomplete read from log member '/arch/2_1119_997386564.dbf'. Trying next member.
Incomplete read from log member '/arch/2_1119_997386564.dbf'. Trying next member.
Errors in file /oracle/app/oracle/diag/rdbms/orcldg/orcl/trace/orcl_pr00_40712.trc (incident=108241):
ORA-00353: log corruption near block 2056 change 15781869802803 time 07/31/2019 06:57:33
ORA-00334: archived log: '/arch/2_1119_997386564.dbf'
Incident details in: /oracle/app/oracle/diag/rdbms/orcldg/orcl/incident/incdir_108241/orcl_pr00_40712_i108241.trc
Errors with log /arch/2_1119_997386564.dbf
Fri Aug 02 08:53:53 2019
Dumping diagnostic data in directory=[cdmp_20190802085353], requested by (instance=1, osid=40712 (PR00)), summary=[incident=108241].
MRP0: Detected read corruption! Retry recovery once log is re-fetched...
Errors in file /oracle/app/oracle/diag/rdbms/orcldg/orcl/trace/orcl_pr00_40712.trc:
ORA-00354: corrupt redo log block header
ORA-00353: log corruption near block 2056 change 15781869802803 time 07/31/2019 06:57:33
ORA-00334: archived log: '/arch/2_1119_997386564.dbf'
Managed Standby Recovery not using Real Time Apply
Recovery interrupted!
Fri Aug 02 08:53:54 2019
Sweep [inc][108241]: completed

==== 备库损坏的日志 ====
ORA-00334: archived log: '/arch/1_1091_997386564.dbf'
ORA-00334: archived log: '/arch/2_1119_997386564.dbf'
ORA-00334: archived log: '/arch/1_1093_997386564.dbf'
RA-00334: archived log: '/arch/2_1120_997386564.dbf'
==== 手动传输损坏的日志到备库 ====
分几种情况
1、主库归档日志还保留,直接将备库损坏的日志scp至备库
2、主库归档日志已清理,rman备份还保留,rman恢复归档日志后传输到备库
3、主库归档日志已清理,无备份,只能重新搭建adg了

#下面说一下第二种情况

1、查看归档日志备份信息
rman target /
RMAN>list backup of archivelog from logseq 1080 until logseq 1100;


2、主库恢复1091日志文件至本地
RMAN> run{
2> set archivelog destination to '/rman_bak/archbak';
3> restore archivelog SEQUENCE BETWEEN 1080 AND 1100;
4> } executing command: SET ARCHIVELOG DESTINATION Starting restore at 02-AUG-19
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=872 instance=orcl1 device type=DISK archived log for thread 1 with sequence 1092 is already on disk as file +ARCH/archivelog/1_1092_997386564.dbf
archived log for thread 1 with sequence 1093 is already on disk as file +ARCH/archivelog/1_1093_997386564.dbf
archived log for thread 1 with sequence 1094 is already on disk as file +ARCH/archivelog/1_1094_997386564.dbf
archived log for thread 1 with sequence 1095 is already on disk as file +ARCH/archivelog/1_1095_997386564.dbf
archived log for thread 1 with sequence 1096 is already on disk as file +ARCH/archivelog/1_1096_997386564.dbf
archived log for thread 1 with sequence 1097 is already on disk as file +ARCH/archivelog/1_1097_997386564.dbf
archived log for thread 1 with sequence 1098 is already on disk as file +ARCH/archivelog/1_1098_997386564.dbf
archived log for thread 1 with sequence 1099 is already on disk as file +ARCH/archivelog/1_1099_997386564.dbf
archived log for thread 1 with sequence 1100 is already on disk as file +ARCH/archivelog/1_1100_997386564.dbf
channel ORA_DISK_1: starting archived log restore to user-specified destination
archived log destination=/rman_bak/archbak
channel ORA_DISK_1: restoring archived log
archived log thread=1 sequence=1080
channel ORA_DISK_1: restoring archived log
archived log thread=1 sequence=1081
channel ORA_DISK_1: restoring archived log
archived log thread=1 sequence=1082
channel ORA_DISK_1: restoring archived log
archived log thread=1 sequence=1083
channel ORA_DISK_1: reading from backup piece /rman_bak/bak/arch_20190801_23241_1
channel ORA_DISK_1: piece handle=/rman_bak/bak/arch_20190801_23241_1 tag=TAG20190801T022702
channel ORA_DISK_1: restored backup piece 1
channel ORA_DISK_1: restore complete, elapsed time: 00:00:01
channel ORA_DISK_1: starting archived log restore to user-specified destination
archived log destination=/rman_bak/archbak
channel ORA_DISK_1: restoring archived log
archived log thread=1 sequence=1084
channel ORA_DISK_1: restoring archived log
archived log thread=1 sequence=1085
channel ORA_DISK_1: restoring archived log
archived log thread=1 sequence=1086
channel ORA_DISK_1: restoring archived log
archived log thread=1 sequence=1087
channel ORA_DISK_1: reading from backup piece /rman_bak/bak/arch_20190801_23242_1
channel ORA_DISK_1: piece handle=/rman_bak/bak/arch_20190801_23242_1 tag=TAG20190801T022702
channel ORA_DISK_1: restored backup piece 1
channel ORA_DISK_1: restore complete, elapsed time: 00:00:01
channel ORA_DISK_1: starting archived log restore to user-specified destination
archived log destination=/rman_bak/archbak
channel ORA_DISK_1: restoring archived log
archived log thread=1 sequence=1088
channel ORA_DISK_1: restoring archived log
archived log thread=1 sequence=1089
channel ORA_DISK_1: reading from backup piece /rman_bak/bak/arch_20190801_23243_1
channel ORA_DISK_1: piece handle=/rman_bak/bak/arch_20190801_23243_1 tag=TAG20190801T022702
channel ORA_DISK_1: restored backup piece 1
channel ORA_DISK_1: restore complete, elapsed time: 00:00:01
channel ORA_DISK_1: starting archived log restore to user-specified destination
archived log destination=/rman_bak/archbak
channel ORA_DISK_1: restoring archived log
archived log thread=1 sequence=1090
channel ORA_DISK_1: restoring archived log
archived log thread=1 sequence=1091
channel ORA_DISK_1: reading from backup piece /rman_bak/bak/arch_20190802_23296_1
channel ORA_DISK_1: piece handle=/rman_bak/bak/arch_20190802_23296_1 tag=TAG20190802T022801
channel ORA_DISK_1: restored backup piece 1
channel ORA_DISK_1: restore complete, elapsed time: 00:00:03
Finished restore at 02-AUG-19


3、将1091#日志文件传输到备库
4、备库开启MRP应用并查看日志应用情况
ALTER DATABASE RECOVER MANAGED STANDBY DATABASE USING CURRENT LOGFILE DISCONNECT FROM SESSION;
SELECT NAME,applied FROM v$archived_log where applied='NO';
日志部分输出:
Media Recovery Log /arch/2_1125_997386564.dbf
Fri Aug 02 10:49:25 2019
Media Recovery Log /arch/1_1098_997386564.dbf
Fri Aug 02 10:49:36 2019
Media Recovery Log /arch/2_1126_997386564.dbf
Fri Aug 02 10:50:43 2019
Media Recovery Log /arch/1_1099_997386564.dbf
Fri Aug 02 10:50:57 2019

#查看进程状态:
select process,status,thread#,sequence# from v$managed_standby order by 3,1;
PROCESS STATUS THREAD# SEQUENCE#
--------- ------------ ---------- ----------
RFS IDLE 0 0
RFS IDLE 0 0
RFS IDLE 0 0
ARCH CLOSING 1 1457
ARCH CLOSING 1 1073
MRP0 APPLYING_LOG 1 1095
RFS WRITING 1 1458
ARCH CLOSING 2 1485
ARCH CLOSING 2 1483
RFS WRITING 2 1486 ORA-00334: archived log: '/arch/1_1156_997386564.dbf' Incomplete read from log member '/arch/2_1183_997386564.dbf'. Trying next member.
Incomplete read from log member '/arch/2_1183_997386564.dbf'. Trying next member.
Errors in file /oracle/app/oracle/diag/rdbms/orcldg/orcl/trace/orcl_pr00_1605.trc (incident=108235):
ORA-00353: log corruption near block 6152 change 15781873869856 time 07/31/2019 13:22:46
ORA-00334: archived log: '/arch/2_1183_997386564.dbf MRP0: Background Media Recovery process shutdown (orcl)
Fri Aug 02 13:10:28 2019


#手动传输日志:1_1156_997386564.dbf、/arch/2_1183_997386564.dbf
Media Recovery Log /arch/1_1156_997386564.dbf
Media Recovery Log /arch/2_1183_997386564.dbf
Completed: ALTER DATABASE RECOVER MANAGED STANDBY DATABASE USING CURRENT LOGFILE DISCONNECT FROM SESSION
Media Recovery Log /arch/2_1184_997386564.dbf
Fri Aug 02 14:53:11 2019


#核查以下日志是否applied
ORA-00334: archived log: '/arch/1_1166_997386564.dbf'
ORA-00334: archived log: '/arch/1_1163_997386564.dbf' /arch/1_1091_997386564.dbf
/arch/2_1119_997386564.dbf
/arch/1_1093_997386564.dbf
/arch/2_1120_997386564.dbf
/arch/2_1124_997386564.dbf
/arch/1_1156_997386564.dbf
/arch/2_1183_997386564.dbf
/arch/1_1158_997386564.dbf
/arch/1_1159_997386564.dbf
/arch/1_1160_997386564.dbf
/arch/1_1161_997386564.dbf
/arch/2_1190_997386564.dbf
/arch/1_1163_997386564.dbf
/arch/1_1166_997386564.dbf
/arch/2_1228_997386564.dbf ORA-16014: log 18 sequence# 1487 not archived, no available destinations
ORA-00312: online log 18 thread 2: '/oradata/orcldg/onlinelog/stdby_redo18.log ORA-00334: archived log: '/arch/2_1230_997386564.dbf'
ORA-00334: archived log: '/arch/2_1243_997386564.dbf'
ORA-00334: archived log: '/arch/2_1245_997386564.dbf'
ORA-00334: archived log: '/arch/1_1223_997386564.dbf'
ORA-00334: archived log: '/arch/2_1254_997386564.dbf'
ORA-00334: archived log: '/arch/1_1228_997386564.dbf' SQL> SELECT NAME,applied FROM v$archived_log where name like '%2_1254%'; NAME APPLIED
------------------------------ ---------
/arch/2_1254_997386564.dbf NO
/arch/2_1254_997386564.dbf YES
#以下日志已应用(展示的为未应用的状态):
tips:重新应用的日志有两个状态,实际以数据库日志和MRP进程状态为准

NAME APPLIED
------------------------------ ---------
/
arch/1_1091_997386564.dbf NO
/arch/2_1119_997386564.dbf NO
/arch/1_1092_997386564.dbf NO
/arch/1_1093_997386564.dbf NO
/arch/2_1124_997386564.dbf NO
/arch/1_1156_997386564.dbf NO
/arch/1_1158_997386564.dbf NO
/arch/1_1159_997386564.dbf NO
/arch/1_1160_997386564.dbf NO
/arch/1_1161_997386564.dbf NO
/arch/2_1190_997386564.dbf NO
/arch/1_1163_997386564.dbf NO
/arch/1_1166_997386564.dbf NO
/arch/2_1228_997386564.dbf NO
/arch/2_1243_997386564.dbf NO
/arch/2_1245_997386564.dbf NO
/arch/1_1223_997386564.dbf NO
/arch/2_1254_997386564.dbf NO
/arch/1_1228_997386564.dbf NO
/arch/1_1203_997386564.dbf
NO

#查看进程状态

select process,status,thread#,sequence# from v$managed_standby order by 3,1;
PROCESS STATUS THREAD# SEQUENCE#
--------- ------------ ---------- ----------
RFS IDLE 0 0
RFS IDLE 0 0
RFS IDLE 0 0
ARCH CLOSING 1 1457
ARCH CLOSING 1 1073
MRP0 APPLYING_LOG 1 1095
RFS WRITING 1 1458
ARCH CLOSING 2 1485
ARCH CLOSING 2 1483
RFS WRITING 2 1486

 


 
 

dataguard日志损坏处理的更多相关文章

  1. 大话RAC介质恢复---联机日志损坏

    对联机日志的损坏要根据日志状态进行分析,联机日志一般会有Current.Active和Inactive三种状态.Inactive状态不会造成数据丢失.而Active和Current状态的日志一般会造成 ...

  2. sql日志损坏造成数据库置疑解决办法

    --如果确定是日志损坏造成,请用下面的方法恢复日志文件.--第一步--use mastergo sp_configure 'allow updates', 1reconfigure with over ...

  3. dataguard日志自动删除

    dataguard日志自动删除 1.判断日志是否已经应用到今天.2.删除3天前的日志.3.主机.备机分别配置 ----check_del_arch.sh#!/bin/shORACLE_HOME=/ho ...

  4. Oracle redo 日志损坏的几种情况下的恢复

    Oracle redo 日志损坏的几种情况下的恢复 第一:损坏的redo为非正在使用的redo log 1.归档模式,不是当前正在日志损坏,数据库打开模式. 模拟损坏:SQL> select * ...

  5. Oracle联机日志损坏解决办法

    关于此问题,在网上找到一篇不错的文章. 大家都清楚,联机日志分为当前联机日志和非当前联机日志. ---------------------------------------------------- ...

  6. ORACLE DATAGUARD 日志传输状态监控

    ORACLE DATAGUARD的主备库同步,主要是依靠日志传输到备库,备库应用日志或归档来实现.当主.备库间日志传输出现GAP,备库将不再与主库同步.因此需对日志传输状态进行监控,确保主.备库间日志 ...

  7. 模拟状态为active的日志损坏的数据恢复实验(不完全恢复)

    1查看当前日志状态 首先不完全恢复是会丢失数据的,由此在当前打开的数据中我们创建一些测试数据,用来验证当我们进行完不完全恢复后该数据是否还存在. 2模拟删除CURRENT状态的日志 3启动数据验证错误 ...

  8. 模拟状态为inactive的日志损坏的恢复实验(完全恢复)

    1查看当前日志状态 从这里可以看到我们现在有三组日志,每组日志中只有1个成员.为了演示这个实验,我们为每个组增加1个成员. 2为每组增加组成员 添加后我们验证一下目前各日志成员的状态: 从上面的视图中 ...

  9. SQL 2005 日志损坏的恢复方法

    SQL 在突然停电或者非正常关机下,可能会出现日期文件错误,导致数据库不正常.恢复数据库方法如下 1.数据库服务停掉 将数据库文件备份 例如数据库名为 DTMS 则将 DTMS.mdf 备份出来. 2 ...

随机推荐

  1. Windows中的工作组和域

    目录 工作组 工作组的访问 工作组的优缺点 域 ​域结构 域的原理 部署域架构 如何加入域 域中主机的登录 SRV出错及解决办法 SRV记录注册不成功的可能原因 禁用域中的账户 将计算机退出域 工作组 ...

  2. 攻防世界Web刷题记录(新手区)

    攻防世界Web刷题记录(新手区) 1.ViewSource 题如其名 Fn + F12 2.get post 3.robots robots.txt是搜索引擎中访问网站的时候要查看的第一个文件.当一个 ...

  3. IntelliJ IDEA中项目的包和目录结构显示设置

    在新建的目录下再创建一个新目录时,出现了目录没有分层显示,这样使用起来十分不方便. 解决方案:点击右上方的设置按钮,将"compact middle packages"取消勾选,实 ...

  4. 内存回收导致关键业务抖动案例分析-论云原生OS内存QoS保障

    蒋彪,腾讯云高级工程师,10+年专注于操作系统相关技术,Linux内核资深发烧友.目前负责腾讯云原生OS的研发,以及OS/虚拟化的性能优化工作. 导语 云原生场景,相比于传统的IDC场景,业务更加复杂 ...

  5. 认识WPF

    新开一节WPF桌面开发的讲解,这节先初步认识一下什么是WPF. 1.简介 WPF是 Windows Presentation Foundation 的英文缩写,意为"窗体呈现基础" ...

  6. Unity API笔记

    1. 返回某范围的随机数 Random.Range method. static float Range(float min, float max); returns a float – return ...

  7. 关于有符号数和无符号数的转换 - C/C++

    转载自:http://www.94cto.com/index/Article/content/id/59973.html 1.引例: 今天在做了一道关于有符号数和无符号数相互转换及其左移/右移的问题, ...

  8. [DB] MapReduce 例题

    词频统计(word count) 一篇文章用哈希表统计即可 对互联网所有网页的词频进行统计(Google搜索引擎的需求),无法将所有网页读入内存 map:将单词提取出来,对每个单词输入一个<wo ...

  9. megacli修复raid1硬盘

    megacli修复raid1硬盘 By HKL, Tuesday 27 August 2019, 评论 [ Hardware Operating ] 使用megaraid修复raid1掉线硬盘 使用说 ...

  10. s9 Linux 进程管理命令

    9.1 ps:查看进程 9.2-3 pstree & pgrep 9.4-6 kill & killall & pkill 9.7 top:实时显示系统中各个进程的资源占用状况 ...