1.获得归档日志暴增时段的一个归档日志:可以查询v$archived_log视图,结合completion_time列进行定位 2.对该归档日志进行转储dump ALTER SYSTEM DUMP LOGFILE /u01/oracle/V7323/dbs/arch1_76.dbf; --请将路径修改成当时的redo归档的路径 以上命令会在user_
ALTER SYSTEM DUMP LOGFILE '/u01/oracle/V7323/dbs/arch1_76.dbf';--请将路径修改成当时的redo归档的路径
以上命令会在user_dump_dest中生成一个trace文件,请将该trace文件传到linux中(root用户or oracle用户均可)
[root@hosta ~]# grep -A2 "^REDO RECORD" his_ora_29032886_dump_arch.trc > redo.log4.
[root@hosta ~]# grep OBJ: redo.log |awk -F "OBJ:" &#39;{print $2}&#39;|awk &#39;{print $1}&#39;|sort -n|uniq -c |sort -n -r 2038012 4294967295 <----出现了2038012次。 107 60635 60 60464 30 59848 29 62992 29 60669 9 59810 8 60706 8 59842OBJ:4294967295,这个是undo的redo记录,出现了2038012次,也就是说:产生redo最多的为undo操作
[root@hosta ~]# grep OBJ: redo.log |awk -F "OBJ:" &#39;{print $2}&#39; | more 4294967295 SCN:0x0001.96090e1b SEQ: 1 OP:5.2 4294967295 SCN:0x0001.96090e1e SEQ: 1 OP:5.4 4294967295 SCN:0x0001.96090e1f SEQ: 1 OP:5.2 4294967295 SCN:0x0001.96090e20 SEQ: 1 OP:5.4 4294967295 SCN:0x0001.96090e21 SEQ: 1 OP:5.2 4294967295 SCN:0x0001.96090e22 SEQ: 1 OP:5.4 4294967295 SCN:0x0001.96090e23 SEQ: 1 OP:5.2 4294967295 SCN:0x0001.96090e24 SEQ: 1 OP:5.4 4294967295 SCN:0x0001.96090e25 SEQ: 1 OP:5.2 4294967295 SCN:0x0001.96090e26 SEQ: 1 OP:5.4 4294967295 SCN:0x0001.96090e27 SEQ: 1 OP:5.2 4294967295 SCN:0x0001.96090e28 SEQ: 1 OP:5.4 4294967295 SCN:0x0001.96090e29 SEQ: 1 OP:5.2 4294967295 SCN:0x0001.96090e29 SEQ: 2 OP:5.4
OP:5.2 Undo Header OP:5.4 Commit
[root@hosta ~]# grep -A2 "^CHANGE #" his_ora_29032886_dump_arch.trc > redo_c.log6.
[root@hosta ~]# grep OBJ: redo_c.log |awk -F "OBJ:" &#39;{print $2}&#39;|awk &#39;{print $1}&#39;|sort -n|uniq -c |sort -n -r---这是对object_id按照出现的次数进行倒序排列,举例:
[root@hosta ~]# grep OBJ: redo_c.log |awk -F "OBJ:" &#39;{print $2}&#39;|awk &#39;{print $1}&#39;|sort -n|uniq -c |sort -n -r 3057384 4294967295 1018128 15 279 60669 174 60635这是说明:OBJ:4294967295 出现了3057384次;
[root@hosta ~]# grep OBJ: redo_c.log | more CHANGE #1 TYP:0 CLS:15 AFN:1 DBA:0x00400009 OBJ:4294967295 SCN:0x0001.96090e1b SEQ: 1 OP:5.2 CHANGE #2 TYP:0 CLS:16 AFN:1 DBA:0x0040000a OBJ:4294967295 SCN:0x0001.96090e1a SEQ: 1 OP:5.1 CHANGE #3 TYP:2 CLS: 1 AFN:1 DBA:0x0040006a OBJ:15 SCN:0x0001.96090e1b SEQ: 1 OP:11.5 CHANGE #1 TYP:0 CLS:15 AFN:1 DBA:0x00400009 OBJ:4294967295 SCN:0x0001.96090e1e SEQ: 1 OP:5.4 CHANGE #1 TYP:0 CLS:15 AFN:1 DBA:0x00400009 OBJ:4294967295 SCN:0x0001.96090e1f SEQ: 1 OP:5.2 CHANGE #2 TYP:0 CLS:16 AFN:1 DBA:0x0040000a OBJ:4294967295 SCN:0x0001.96090e1e SEQ: 1 OP:5.1 CHANGE #3 TYP:2 CLS: 1 AFN:1 DBA:0x0040006a OBJ:15 SCN:0x0001.96090e1f SEQ: 1 OP:11.5 CHANGE #1 TYP:0 CLS:15 AFN:1 DBA:0x00400009 OBJ:4294967295 SCN:0x0001.96090e20 SEQ: 1 OP:5.4 CHANGE #1 TYP:0 CLS:15 AFN:1 DBA:0x00400009 OBJ:4294967295 SCN:0x0001.96090e21 SEQ: 1 OP:5.2 CHANGE #2 TYP:0 CLS:16 AFN:1 DBA:0x0040000a OBJ:4294967295 SCN:0x0001.96090e20 SEQ: 1 OP:5.1 CHANGE #3 TYP:2 CLS: 1 AFN:1 DBA:0x0040006a OBJ:15 SCN:0x0001.96090e21 SEQ: 1 OP:11.5
OP:5.1 Undo Recorder OP:5.2 Undo Header OP:5.4 Commit OP:11.5 Update Row Piece,也就是update操作,根据obj:15,就能确认是哪个对象上的update