[20170308]关于redo dump.txt
--//前一阵子在探究是否可以备库的备用日志来恢复主库,当主库在线日志丢失的情况下.遇到一些问题.
DUMP OF REDO FROM FILE '/mnt/ramdisk/book/redo01.log'
Opcodes *.*
RBAs: 0x000000.00000000.0000 thru 0xffffffff.ffffffff.ffff
SCNs: scn: 0x0000.00000000 thru scn: 0xffff.ffffffff
Times: creation thru eternity
VALIDATE ONLY
FILE HEADER:
Compatibility Vsn = 186647552=0xb200400
Db ID=1337401710=0x4fb7216e, Db Name='BOOK'
Activation ID=1337448558=0x4fb7d86e
Control Seq=36141=0x8d2d, File size=102400=0x19000
File Number=1, Blksiz=512, File Type=2 LOG
descrip:"Thread 0001, Seq# 0000000695, SCN 0x0003175d9565-0xffffffffffff"
thread: 1 nab: 0xffffffff seq: 0x000002b7 hws: 0x1 eot: 1 dis: 0
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
--不理解这里 hws: 0x1 eot: 1 dis: 0 分别表示什么?刘工给我的答复是:
eot : End Of Thread: indicates if this is the last log
hws = Hdr Write Seq#
dis : DISabled - true if thread disabled at end of this log
--eot 我个人理解就是当前主库正在使用的在线日志.就是状态STATUS=CURRENT.
--dis 就是thread disable的日志.
--hws header write seq# ,我自己还真不好猜测.
--//还是通过例子来猜测看看.
1.环境:
SYS@book> @ &r/ver
BANNER
--------------------------------------------------------------------------------
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
SYS@book> @ &r/logfile
GROUP# STATUS TYPE MEMBER IS_ GROUP# THREAD# SEQUENCE# BYTES BLOCKSIZE MEMBERS ARC STATUS FIRST_CHANGE# FIRST_TIME NEXT_CHANGE# NEXT_TIME
------ ------ ---------- -------------------------------- --- ------ ------- --------- ----------- --------- ------- --- ---------- ------------- ------------------- ------------ -------------------
1 ONLINE /mnt/ramdisk/book/redo01.log NO 1 1 704 52428800 512 1 YES INACTIVE 13277044174 2017-03-08 09:13:23 13277055255 2017-03-08 10:59:38
2 ONLINE /mnt/ramdisk/book/redo02.log NO 2 1 705 52428800 512 1 NO CURRENT 13277055255 2017-03-08 10:59:38 2.814750E+14
3 ONLINE /mnt/ramdisk/book/redo03.log NO 3 1 703 52428800 512 1 YES INACTIVE 13277042336 2017-03-08 09:01:26 13277044174 2017-03-08 09:13:23
4 STANDBY /mnt/ramdisk/book/redostb01.log NO
5 STANDBY /mnt/ramdisk/book/redostb02.log NO
6 STANDBY /mnt/ramdisk/book/redostb03.log NO
7 STANDBY /mnt/ramdisk/book/redostb04.log NO
7 rows selected.
2.eot : End Of Thread: indicates if this is the last log
SYS@book> alter session set events 'immediate trace name redohdr level 10';
Session altered.
$ grep hws /u01/app/oracle/diag/rdbms/book/book/trace/book_ora_6964.trc | grep eot
thread: 1 nab: 0x3ddb seq: 0x000002c0 hws: 0x9 eot: 0 dis: 0
thread: 1 nab: 0xffffffff seq: 0x000002c1 hws: 0x1 eot: 1 dis: 0
thread: 1 nab: 0x1d29 seq: 0x000002bf hws: 0x6 eot: 0 dis: 0
--//seq# =0x2c1 = 705,就是当前日志,eot=1.表示End Of Thread: indicates if this is the last log.
--//shutdown immediate,再启动到mount状态,执行:
SYS@book> alter session set events 'immediate trace name redohdr level 10';
Session altered.
$ grep hws /u01/app/oracle/diag/rdbms/book/book/trace/book_ora_7143.trc | grep eot
thread: 1 nab: 0x3ddb seq: 0x000002c0 hws: 0x9 eot: 0 dis: 0
thread: 1 nab: 0x119f seq: 0x000002c1 hws: 0x2 eot: 1 dis: 0
thread: 1 nab: 0x1d29 seq: 0x000002bf hws: 0x6 eot: 0 dis: 0
--//shutdown abort,再启动到mount状态,执行:
SYS@book> alter session set events 'immediate trace name redohdr level 10';
Session altered.
$ grep hws /u01/app/oracle/diag/rdbms/book/book/trace/book_ora_7236.trc | grep eot
thread: 1 nab: 0x3ddb seq: 0x000002c0 hws: 0xa eot: 0 dis: 0
thread: 1 nab: 0x119f seq: 0x000002c1 hws: 0x4 eot: 0 dis: 0
thread: 1 nab: 0xffffffff seq: 0x000002c2 hws: 0x2 eot: 1 dis: 0
--//可以发现eot=1就是当前日志.status=CURRENT.
--//另外我也在备库做了一次转储,发现eot=0.这也可能是我为什么使用它在主库恢复使用until canecl时的原因.
--//估计该eot标识就ok了.
3.dis : DISabled - true if thread disabled at end of this log
--//正好我们有一个数据库原来是rac环境,存在2个thread,现在已经改成单机使用,thread已经disable,看看这个的情况:
SYS@xxxxx> @ &r/ver1
PORT_STRING VERSION BANNER
------------------------------ -------------- ----------------------------------------------------------------
x86_64/Linux 2.4.xx 10.2.0.4.0 Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bi
SYS@xxxxx> @ &r/logfile
GROUP# STATUS TYPE MEMBER IS_ GROUP# THREAD# SEQUENCE# BYTES MEMBERS ARC STATUS FIRST_CHANGE# FIRST_TIME
------ ---------- ---------- ----------------------------------------- --- ------ ------- --------- ----------- ------- --- ---------- ------------- -------------------
1 ONLINE +G0/xxxxx/onlinelog/group_1.545.772789051 NO 1 1 51377 52428800 2 YES INACTIVE 17771842553 2017-03-08 11:18:51
1 ONLINE +G0/xxxxx/onlinelog/group_1.546.772789051 YES 1 1 51377 52428800 2 YES INACTIVE 17771842553 2017-03-08 11:18:51
2 ONLINE +G0/xxxxx/onlinelog/group_2.547.772789053 YES 2 1 51378 52428800 2 NO CURRENT 17771844804 2017-03-08 11:30:17
2 ONLINE +G0/xxxxx/onlinelog/group_2.548.772789051 NO 2 1 51378 52428800 2 NO CURRENT 17771844804 2017-03-08 11:30:17
3 ONLINE +G0/xxxxx/onlinelog/group_3.549.772789053 NO 3 2 97 52428800 2 YES INACTIVE 1301639448 2012-01-19 10:44:25
3 ONLINE +G0/xxxxx/onlinelog/group_3.550.772789055 YES 3 2 97 52428800 2 YES INACTIVE 1301639448 2012-01-19 10:44:25
4 ONLINE +G0/xxxxx/onlinelog/group_4.551.772789055 NO 4 2 98 52428800 2 YES ACTIVE 1301654779 2012-01-19 11:03:25
4 ONLINE +G0/xxxxx/onlinelog/group_4.552.772789055 YES 4 2 98 52428800 2 YES ACTIVE 1301654779 2012-01-19 11:03:25
5 ONLINE +G0/xxxxx/onlinelog/group_5.553.772789057 NO 5 1 51375 52428800 2 YES INACTIVE 17770789460 2017-03-08 10:34:59
5 ONLINE +G0/xxxxx/onlinelog/group_5.554.772789057 YES 5 1 51375 52428800 2 YES INACTIVE 17770789460 2017-03-08 10:34:59
6 ONLINE +G0/xxxxx/onlinelog/group_6.555.772789059 NO 6 1 51376 52428800 2 YES INACTIVE 17771481949 2017-03-08 11:08:53
6 ONLINE +G0/xxxxx/onlinelog/group_6.556.772789059 YES 6 1 51376 52428800 2 YES INACTIVE 17771481949 2017-03-08 11:08:53
7 ONLINE +G0/xxxxx/onlinelog/group_7.557.772789061 NO 7 2 95 52428800 2 YES INACTIVE 1301630320 2012-01-19 10:27:49
7 ONLINE +G0/xxxxx/onlinelog/group_7.558.772789061 YES 7 2 95 52428800 2 YES INACTIVE 1301630320 2012-01-19 10:27:49
8 ONLINE +G0/xxxxx/onlinelog/group_8.559.772789061 NO 8 2 96 52428800 2 YES INACTIVE 1301633802 2012-01-19 10:35:17
8 ONLINE +G0/xxxxx/onlinelog/group_8.560.772789063 YES 8 2 96 52428800 2 YES INACTIVE 1301633802 2012-01-19 10:35:17
16 rows selected.
SYS@xxxxx> alter session set events 'immediate trace name redohdr level 10';
Session altered.
$ grep hws /u01/app/oracle/admin/xxxxx/udump/xxxxx_ora_14297.trc | grep eot
thread: 1 nab: 0x14b8c seq: 0x0000c8b1 hws: 0x2 eot: 0 dis: 0
thread: 1 nab: 0xffffffff seq: 0x0000c8b2 hws: 0x1 eot: 1 dis: 0
thread: 2 nab: 0x2 seq: 0x00000061 hws: 0x2 eot: 0 dis: 0
thread: 2 nab: 0x2 seq: 0x00000062 hws: 0x2 eot: 1 dis: 2
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
thread: 1 nab: 0x14b84 seq: 0x0000c8af hws: 0x2 eot: 0 dis: 0
thread: 1 nab: 0x14b7f seq: 0x0000c8b0 hws: 0x2 eot: 0 dis: 0
thread: 2 nab: 0x2 seq: 0x0000005f hws: 0x2 eot: 0 dis: 0
thread: 2 nab: 0x2 seq: 0x00000060 hws: 0x2 eot: 0 dis: 0
--//慢慢体会DISabled - true if thread disabled at end of this log.也就是没有disable的话.这里应该都是0.
--//这里等于2,表示thread号.
4.hws = Hdr Write Seq#
--//header write seq# 什么意思?
SYS@book> alter session set events 'immediate trace name controlf level 3';
Session altered.
$ grep hws /u01/app/oracle/diag/rdbms/book/book/trace/book_ora_7265.trc
siz: 0x19000 seq: 0x000002c0 hws: 0xa bsz: 512 nab: 0x3ddb flg: 0x1 dup: 1
siz: 0x19000 seq: 0x000002c1 hws: 0x4 bsz: 512 nab: 0x119f flg: 0x1 dup: 1
siz: 0x19000 seq: 0x000002c2 hws: 0x2 bsz: 512 nab: 0xffffffff flg: 0x8 dup: 1
siz: 0x19000 seq: 0x00000000 hws: 0x1 bsz: 512 nab: 0x2 flg: 0x21 dup: 1
siz: 0x19000 seq: 0x00000000 hws: 0x1 bsz: 512 nab: 0x2 flg: 0x21 dup: 1
siz: 0x19000 seq: 0x00000000 hws: 0x1 bsz: 512 nab: 0x2 flg: 0x21 dup: 1
siz: 0x19000 seq: 0x00000000 hws: 0x1 bsz: 512 nab: 0x2 flg: 0x21 dup: 1
SYS@book> alter session set events 'immediate trace name redohdr level 10';
Session altered.
$ grep hws /u01/app/oracle/diag/rdbms/book/book/trace/book_ora_7281.trc | grep eot
thread: 1 nab: 0x3ddb seq: 0x000002c0 hws: 0xa eot: 0 dis: 0
thread: 1 nab: 0x119f seq: 0x000002c1 hws: 0x4 eot: 0 dis: 0
thread: 1 nab: 0xffffffff seq: 0x000002c2 hws: 0x2 eot: 1 dis: 0
thread: 0 nab: 0x2 seq: 0x00000000 hws: 0x1 eot: 0 dis: 0
thread: 0 nab: 0x2 seq: 0x00000000 hws: 0x1 eot: 0 dis: 0
thread: 0 nab: 0x2 seq: 0x00000000 hws: 0x1 eot: 0 dis: 0
thread: 0 nab: 0x2 seq: 0x00000000 hws: 0x1 eot: 0 dis: 0
--//很明显控制文件也记录类似的信息.但是还是不明白hws表示什么??