日志文件头中的SCN主要分以下3类:
1、FIRST_CHANGE
2、NEXT_CHANGE
3、RESETLOGS_CHANGE#
- FIRST_CHANGE#
FIRST_CHANGE#表示该在线日志文件被重用时的SCN。可以从VKaTeX parse error: Expected 'EOF', got '#' at position 25: …RY.FIRST_CHANGE#̲列查询,如下所示: SQL> …log_history where SEQUENCE#=81;
FIRST_CHANGE#
719049
- NEXT_CHANGE#
NEXT_CHANGE#表示该日志文件重用结束时的SCN。可以从VKaTeX parse error: Expected 'EOF', got '#' at position 24: …ORY.NEXT_CHANGE#̲列查询,如下所示: SQL> …log_history where SEQUENCE#=81;
NEXT_CHANGE#
719556
- RESETLOGS_CHANGE#
RESETLOGS_CHANGE#表示数据库以RESETLOGS方式打开时的SCN。通常它和数据文件头的RESETLOGS_CHANGE#相同。可以从VKaTeX parse error: Expected 'EOF', got '#' at position 30: …ESETLOGS_CHANGE#̲列查询,如下所示: SQL> …log_history where SEQUENCE#=81;
RESETLOGS_CHANGE#
1
同样,也可以通过DUMP日志文件头获取上述SCN:
ALTER SESSION SET EVENTS ‘immediate trace name redohdr level n’;
1 控制文件中的redo log信息
2 level 1 + 文件头信息
3 level 2 + 日志文件头信息
10 level 3
观察跟踪文件,“reset logs scn”表示RESETLOGS_CHANGE,“Low scn”表示FIRST_CHANGE,“Next scn”表示NEXT_CHANGE。如下所示:
FILE HEADER:
Compatibility Vsn = 169870592=0xa200500
Db ID=1692549314=0x64e240c2, Db Name=‘ORA10205’
Activation ID=1692520386=0x64e1cfc2
Control Seq=730=0x2da, File size=102400=0x19000
File Number=2, Blksiz=512, File Type=2 LOG
descrip:“Thread 0001, Seq# 0000000081, SCN 0x0000000af8c9-0x0000000afac4”
thread: 1 nab: 0x186cd seq: 0x00000051 hws: 0x2 eot: 0 dis: 0
reset logs count: 0x2efbf702 scn: 0x0000.00000001
Low scn: 0x0000.000af8c9 07/29/2012 11:17:47
Next scn: 0x0000.000afac4 07/29/2012 11:18:36
Enabled scn: 0x0000.00000001 07/10/2012 10:25:09
Thread closed scn: 0x0000.000af8c9 07/29/2012 11:17:47
Disk cksum: 0xb3ea Calc cksum: 0xb3ea
Terminal Recovery Stop scn: 0x0000.00000000
Terminal Recovery Stamp 01/01/1988 00:00:00
Most recent redo scn: 0x0000.00000000
Largest LWN: 3645 blocks
Miscellaneous flags: 0x0
Thread internal enable indicator: thr: 0, seq: 0 scn: 0x0000.00000000
通过比对DUMP文件和二进制日志文件头,可知上述SCN在日志文件头的位置,具体如下所示:
offset 164-167
resetlogs change
offset 168-169
resetlogs change wrap
offset 180-183
low scn
offset 184-185
low scn wrap
offset 192-195
next scn
offset 196-197
scn wrap