- 最后登录
- 2023-8-16
- 在线时间
- 1686 小时
- 威望
- 2135
- 金钱
- 50532
- 注册时间
- 2011-10-12
- 阅读权限
- 200
- 帖子
- 5207
- 精华
- 39
- 积分
- 2135
- UID
- 2
|
7#
发表于 2013-6-23 20:46:44
SQL> select * from v$version;
BANNER
----------------------------------------------------------------
Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - 64bi
PL/SQL Release 10.2.0.5.0 - Production
CORE 10.2.0.5.0 Production
TNS for Linux: Version 10.2.0.5.0 - Production
NLSRTL Version 10.2.0.5.0 - Production
[oracle@vrh8 ~]$ ps -ef|grep dbw
oracle 4321 1 0 Jun15 ? 00:01:04 ora_dbw0_G10R25
oracle 29550 29527 0 08:02 pts/2 00:00:00 grep dbw
SQL> oradebug setospid 4321
Oracle pid: 5, Unix process pid: 4321, image: oracle@vrh8.oracle.com (DBW0)
SQL> oradebug suspend;
Statement processed.
HANG住 DBWR
SQL> select dbms_rowid.rowid_block_number(rowid),dbms_rowid.rowid_relative_fno(rowid) from dirty_int;
DBMS_ROWID.ROWID_BLOCK_NUMBER(ROWID) DBMS_ROWID.ROWID_RELATIVE_FNO(ROWID)
------------------------------------ ------------------------------------
67154 1
67154 1
67154 1
SQL> update dirty_int set t1=t1+10;
3 rows updated.
SQL> select state,dirty_queue,count(*) from x$bh group by state,dirty_queue;
STATE DIRTY_QUEUE COUNT(*)
---------- ----------- ----------
1 0 4
0 0 54490
3 0 2
没有 DIRTY_QUEUE!=0的buffer
等10分钟
SQL> exec dbms_lock.sleep(600);
SQL> select state,dirty_queue,count(*) from x$bh group by state,dirty_queue;
STATE DIRTY_QUEUE COUNT(*)
---------- ----------- ----------
1 0 1434
0 0 53060
3 0 2
另一个session中:
SQL> oradebug setmypid
Statement processed.
SQL> oradebug dump buffers 1;
Statement processed.
BH (0x7cfb58e8) file#: 1 rdba: 0x00410652 (1/67154) class: 1 ba: 0x7c77a000
set: 3 blksize: 8192 bsi: 0 set-flg: 2 pwbcnt: 20
dbwrid: 0 obj: 93542 objn: 93542 tsn: 0 afn: 1
hash: [80fbea78,a41d1dc0] lru: [77f87d58,82f94518]
lru-flags: debug_dump
obj-flags: object_ckpt_list
ckptq: [77f7c538,77f87d08] fileq: [78f9a9c8,a38cd1b8] objq: [97901a40,97901a40]
st: XCURRENT md: NULL tch: 1
flags: buffer_dirty gotten_in_current_mode redo_since_read
LRBA: [0x50a.14094.0] HSCN: [0x0.bd81c6] HSUB: [3]
BH (0x80fbea78) file#: 1 rdba: 0x00410652 (1/67154) class: 1 ba: 0x8088c000
set: 3 blksize: 8192 bsi: 0 set-flg: 2 pwbcnt: 20
dbwrid: 0 obj: 93542 objn: 93542 tsn: 0 afn: 1
hash: [7fff9398,7cfb58e8] lru: [a42358f8,7fff9418]
lru-flags: debug_dump moved_to_tail
ckptq: [NULL] fileq: [NULL] objq: [7fff9488,97901a30]
st: CR md: NULL tch: 2
cr: [scn: 0x0.bd81c5],[xid: 0x0.0.0],[uba: 0x0.0.0],[cls: 0x0.bd81c5],[sfl: 0x0],[lc: 0x0.0]
flags: gotten_in_current_mode redo_since_read
BH (0x7fff9398) file#: 1 rdba: 0x00410652 (1/67154) class: 1 ba: 0x7ff70000
set: 3 blksize: 8192 bsi: 0 set-flg: 2 pwbcnt: 20
dbwrid: 0 obj: 93542 objn: 93542 tsn: 0 afn: 1
hash: [73f85368,80fbea78] lru: [80fbeaf8,8cff8868]
lru-flags: debug_dump moved_to_tail
ckptq: [NULL] fileq: [NULL] objq: [86fd43a8,80fbeb68]
st: CR md: NULL tch: 1
cr: [scn: 0x0.bd81bf],[xid: 0x0.0.0],[uba: 0x0.0.0],[cls: 0x0.bd81bf],[sfl: 0x0],[lc: 0x0.0]
flags: only_sequential_access
BH (0x73f85368) file#: 1 rdba: 0x00410652 (1/67154) class: 1 ba: 0x731ca000
set: 3 blksize: 8192 bsi: 0 set-flg: 2 pwbcnt: 20
dbwrid: 0 obj: 93542 objn: 93542 tsn: 0 afn: 1
hash: [73f85258,7fff9398] lru: [73f852d8,77fc5648]
lru-flags: debug_dump on_auxiliary_list
ckptq: [NULL] fileq: [NULL] objq: [NULL]
st: FREE md: NULL tch: 0
flags:
BH (0x73f85258) file#: 1 rdba: 0x00410652 (1/67154) class: 1 ba: 0x731c8000
set: 3 blksize: 8192 bsi: 0 set-flg: 2 pwbcnt: 20
dbwrid: 0 obj: 93542 objn: 93542 tsn: 0 afn: 1
hash: [73f829f8,73f85368] lru: [73f82a78,73f853e8]
lru-flags: debug_dump on_auxiliary_list
ckptq: [NULL] fileq: [NULL] objq: [NULL]
st: FREE md: NULL tch: 0
flags:
BH (0x73f829f8) file#: 1 rdba: 0x00410652 (1/67154) class: 1 ba: 0x7317c000
set: 3 blksize: 8192 bsi: 0 set-flg: 2 pwbcnt: 20
dbwrid: 0 obj: 93542 objn: 93542 tsn: 0 afn: 1
hash: [a41d1dc0,73f85258] lru: [79f7f668,73f852d8]
lru-flags: debug_dump moved_to_tail on_auxiliary_list
ckptq: [NULL] fileq: [NULL] objq: [NULL]
st: FREE md: NULL tch: 0
flags:
开一个新session flush buffer_cache会被HANG
SQL> alter system flush buffer_cache;
再开一个session查询:
SQL> select state,dirty_queue,count(*) from x$bh group by state,dirty_queue;
STATE DIRTY_QUEUE COUNT(*)
---------- ----------- ----------
1 0 34
1 3 37
0 0 54425
有37个Xcurrent buffer 的dirty queue为3了
SQL> oradebug setmypid
Statement processed.
SQL> oradebug dump buffers 1;
Statement processed.
SQL> oradebug tracefile_name
/s01/admin/G10R25/udump/g10r25_ora_29896.trc
BH (0x7cfb58e8) file#: 1 rdba: 0x00410652 (1/67154) class: 1 ba: 0x7c77a000
set: 3 blksize: 8192 bsi: 0 set-flg: 2 pwbcnt: 0
dbwrid: 0 obj: 93542 objn: 93542 tsn: 0 afn: 1
hash: [80fbea78,a41d1dc0] lrux-rng: [74fd1478,7dfd28a8]
lru-flags: debug_dump
obj-flags: object_ckpt_list
ckptq: [77f7c538,77f87d08] fileq: [78f9a9c8,a38cd1b8] objq: [97901a40,97901a40]
st: XCURRENT md: NULL tch: 1
flags: buffer_dirty gotten_in_current_mode redo_since_read
flush_after_writing
LRBA: [0x50a.14094.0] HSCN: [0x0.bd81c6] HSUB: [3]
lru: [77f87d58,82f94518] VS lrux-rng: [74fd1478,7dfd28a8]
可以看出 LRU到LRU-X的移动 是这么触发的吧?
|
|