- 最后登录
- 2016-6-27
- 在线时间
- 134 小时
- 威望
- 351
- 金钱
- 2586
- 注册时间
- 2012-3-16
- 阅读权限
- 60
- 帖子
- 188
- 精华
- 6
- 积分
- 351
- UID
- 309
|
3#
发表于 2012-5-12 10:41:23
谢谢刘大,不过我的实验结果和你的不一样:
drop table t;
create table t(processed_flag varchar2(1)) tablespace users;
insert into t values('N');
insert into t values('Y');
commit;
select * from t;
insert into t values('A');
--在另外一个会话查询t以生成一致块
select dbms_rowid.rowid_relative_fno(rowid) REL_FNO,dbms_rowid.rowid_block_number(rowid) BLOCKNO from t;
select file#,block#,status from v$bh where file# = 4 and block#=539;
FILE# BLOCK# STATUS
4 539 xcur
4 539 cr
4 539 cr
alter system dump datafile 4 block 531;
查看trace文件:
Block dump from cache:
Dump of buffer cache at level 4 for tsn=4, rdba=16777755
BH (0xe4fae4b8) file#: 4 rdba: 0x0100021b (4/539) class: 1 ba: 0xe479e000
set: 20 pool 3 bsz: 8192 bsi: 0 sflg: 2 pwc: 29,19
dbwrid: 0 obj: 74941 objn: 74941 tsn: 4 afn: 4 hint: f
hash: [0xe4f94958,0x124980b10] lru: [0xe4fae6d0,0xe4fae470]
ckptq: [NULL] fileq: [NULL] objq: [NULL]
st: CR md: NULL tch: 1
cr: [scn: 0x0.1a6e6f],[xid: 0x7.1a.418],[uba: 0xc0059e.ec.8],[cls: 0x0.1a6e6f],[sfl: 0x0],[lc: 0x0.1a6e6f]
flags: only_sequential_access
cr pin refcnt: 0 sh pin refcnt: 0
BH (0xe4f948a8) file#: 4 rdba: 0x0100021b (4/539) class: 1 ba: 0xe44e8000
set: 19 pool 3 bsz: 8192 bsi: 0 sflg: 2 pwc: 32,19
dbwrid: 0 obj: 74941 objn: 74941 tsn: 4 afn: 4 hint: f
hash: [0xe3f880a8,0xe4fae568] lru: [0xe4f94ac0,0xe4f94860]
ckptq: [NULL] fileq: [NULL] objq: [NULL]
st: CR md: NULL tch: 1
cr: [scn: 0x0.1a6e6e],[xid: 0x7.1a.418],[uba: 0xc0059e.ec.8],[cls: 0x0.1a6e6e],[sfl: 0x0],[lc: 0x0.1a6e6e]
flags: only_sequential_access
cr pin refcnt: 0 sh pin refcnt: 0
BH (0xe3f87ff8) file#: 4 rdba: 0x0100021b (4/539) class: 1 ba: 0xe3396000
set: 17 pool 3 bsz: 8192 bsi: 0 sflg: 2 pwc: 20,19
dbwrid: 0 obj: 74941 objn: 74941 tsn: 4 afn: 4 hint: f
hash: [0xecfd9298,0xe4f94958] lru: [0xe3f88210,0xe3f87fb0]
obj-flags: object_ckpt_list
ckptq: [0xe3f877a8,0xe3f88258] fileq: [0x12320f880,0x12320f880] objq: [0x120f316e8,0x120f316e8]
st: XCURRENT md: NULL tch: 3
flags: buffer_dirty redo_since_read
LRBA: [0x1a.a6c4.0] LSCN: [0x0.1a6e67] HSCN: [0x0.1a6e6f] HSUB: [1]
cr pin refcnt: 0 sh pin refcnt: 0
Block dump from disk:
buffer tsn: 4 rdba: 0x0100021b (4/539)
scn: 0x0000.00000000 seq: 0x01 flg: 0x05 tail: 0x00000001
frmt: 0x02 chkval: 0xa41b type: 0x00=unknown
Hex dump of block: st=0, typ_found=0
Dump of memory from 0x00002B3B78047000 to 0x00002B3B78049000
2B3B78047000 0000A200 0100021B 00000000 05010000 [................]
2B3B78047010 0000A41B 00000000 00000000 00000000 [................]
2B3B78047020 00000000 00000000 00000000 00000000 [................]
Repeat 508 times
2B3B78048FF0 00000000 00000000 00000000 00000001 [................]
Dump of memory from 0x00002B3B78047014 to 0x00002B3B78048FFC
2B3B78047010 00000000 00000000 00000000 [............]
2B3B78047020 00000000 00000000 00000000 00000000 [................]
Repeat 508 times
2B3B78048FF0 00000000 00000000 00000000 [............]
End dump data blocks tsn: 4 file#: 4 minblk 539 maxblk 539
--可以见到这里没有找到插入的数据
alter system flush buffer_cache;
alter system dump datafile 4 block 531;
查看trace文件:
Block header dump: 0x0100021b
Object id on Block? Y
seg/obj: 0x124bd csc: 0x00.1a6e6f itc: 2 flg: E typ: 1 - DATA
brn: 0 bdba: 0x1000218 ver: 0x01 opc: 0
inc: 0 exflg: 0
Itl Xid Uba Flag Lck Scn/Fsc
0x01 0x0005.010.00000571 0x00c0066a.01bd.20 C--- 0 scn 0x0000.001a6e68
0x02 0x0007.01a.00000418 0x00c0059e.00ec.08 ---- 1 fsc 0x0000.00000000
bdba: 0x0100021b
data_block_dump,data header at 0x2b3b78047064
===============
tsiz: 0x1f98
hsiz: 0x18
pbl: 0x2b3b78047064
76543210
flag=--------
ntab=1
nrow=3
frre=-1
fsbo=0x18
fseo=0x1f89
avsp=0x1f65
tosp=0x1f65
0xe:pti[0] nrow=3 offs=0
0x12:pri[0] offs=0x1f93
0x14:pri[1] offs=0x1f8e
0x16:pri[2] offs=0x1f89
block_row_dump:
tab 0, row 0, @0x1f93
tl: 5 fb: --H-FL-- lb: 0x0 cc: 1
col 0: [ 1] 4e
tab 0, row 1, @0x1f8e
tl: 5 fb: --H-FL-- lb: 0x0 cc: 1
col 0: [ 1] 59
tab 0, row 2, @0x1f89
tl: 5 fb: --H-FL-- lb: 0x2 cc: 1
col 0: [ 1] 41
end_of_block_dump
End dump data blocks tsn: 4 file#: 4 minblk 539 maxblk 539
--这里找到了插入的数据
可见alter system dump应该是从硬盘上取的数据,刘大怎么看? |
|