Oracle Cache Buffer Internals
-
Upload
saeed-meethal -
Category
Documents
-
view
120 -
download
20
Transcript of Oracle Cache Buffer Internals
-
Oracle Buffer CacheOracle Buffer CacheInternalsInternals
SUNDARSUNDAR
BY
-
AgendaAgenda
Buffer Cache Management concept Hash Algorithm Cache buffers chains Latch Hash buckets Cache/hash chain Block Header Buffer Cache Working sets Lists Cache buffer lru Latch Touch count Examples
-
Buffer cache
DBWR
Data buffer cache
I need file 29, block 13
is it already in the cache?
1GBBlack Box
13:12:38 SQL> select * from test1where id=100;
ID DESC1---------- ----------
100 BUFFER1
Elapsed: 00:00:00.00
13:12:38 SQL>
13:12:38 SQL> select * from test1where id=100;
ID DESC1---------- ----------
100 BUFFER1
Elapsed: 00:00:00.00
13:12:38 SQL>
PROCESS
SQL >
-
Transaction Layer
Lock Management Layer
Generic LayerOperating System Dependencies
Services Layer
Access LayerData Layer
User Program InterfaceOracle Call Interface
Net connection
UPIOCI
KT
KJKG
S
KS
KAKD
SQL >
Oracle Kernel Function Names
Recursive Program InterfaceRPI
DEFAULT
KEEP, RECYCLE
2K, 4K, 8K, 16K and 32K
Oracle rdbms Kernel
Cache LayerKC
-
Real worldReal worldproblemsproblems
-
ConceptConcept
Delivery person
Storage area
Delivery Addr
Storage Unit
Delivery personStorage areaStorage Unit #Delivery address
Delivery Management system
-
Delivery Addr
Location # 1
Location # 2
Location # 3
Location # 4
Location # 5
Location # 6
Location # 7
Location # n
Delivery person
Delivery Management system
5 15 16 21 14 2
13 17 12 22 30
24 4 7 25 29 23
1 11 18 8 27
10 19 20 3 26 9
Storage area
6
28
Security
Street/gate
00
Unique Item
Unit #
-
Delivery Addr
Location # 1
Location # 2
Location # 3
Location # 4
Location # 5
Location # 6
Location # 7
Location # n
5 15 16 21 14 2
13 17 12 22 30
24 4 7 25 29 23
1 11 18 8 27
10 19 20 3 26 9
Storage area
60
1
2
3
4
Street #Security #
28
Delivery person
Delivery Management system
-
9790837669 6255484134272013 6
9689827568 6154474033261912 5
9588817467 6053463932251811 4
9487807366 59524538312417103
10093867972 6558514437302316 9 2
9992857871 6457504336292215 8 1
9891847770 6356494235282114 7
151413121110987654321
6
5
4
3
2
1
0
MOD ( 10, 7) = 3 MOD ( 100, 7) = 2
H
ASH
Chains
Hash Algorithm
-
Delivery Addr.
Location # 1
Location # 2
Location # 3
Location # 4
Location # 5
Location # 6
Location # 7
Location # n
5 10 15 20 25 30
1 11 16 21 26
2 7 12 17 22 27
3 8 13 18 28
4 9 14 19 24 29
Storage area
6
2328
0
1
2
3
4
Street #Security #
Mod ( Storage area # / 5 )
Hash
mod ( 28 / 5 ) = 3
Delivery person
Delivery Management system
-
87654408854861
8760600656582
9795003218994
42156786783n
334432014432420
Time Waited
Total people Imm Get
TotalPeople waited
Total People visited
Street#/Gate #
Security Log
-
Buffer CacheBuffer Cache
-
Delivery person
Security
Storage area
Cache buffer Chains latch
Hash table /Bucket #
Street/gate #
Hash chain(BH)
Process
Data Block Loc
Security Logs v$latch_children
Real world to Oracle world
Delivery Addr.
Storage Unit # DBA # + Classes #
-
Latch #
Cache buffer Chains latch
Hash table /Bucket #
Buffer_cacheHash chain
Oracle rdbms
PROCESS # nPROCESS # n
012
Location # 1
Location # 2Location # 3Location # n
PROCESS
Building Hash Bucket
Delivery Management system
Storage areaSecurityDelivery person Delivery AddrStreet #
-
buffer tsn: 4rdba: 0x0740000d (29/13)scn: 0x0000.00054ec3 seq: 0x03 flg: 0x02 tail: 0x4ec30603frmt: 0x02 chkval: 0x0000 type: 0x06=trans data
buffer tsn: 4rdba: 0x0740000d (29/13)scn: 0x0000.00054ec3 seq: 0x03 flg: 0x02 tail: 0x4ec30603frmt: 0x02 chkval: 0x0000 type: 0x06=trans data
Save undo header5Segment header4Save undo block3Sort block2Data block1DescriptionClassBlock header
DataSegmentheader
L1BMB
L2BMB
dataFile SpaceHeader
DBA Classes
dba / Classes
-
n012345
Latch # n
Latch # 2
Latch # 1BH BH BH BH
BH BH BH BH
BH BH BH
BH BH BH BH
BH BH BH BH
BH BH BH BH
Building Hash Bucket
Buffer cacheHash chainHash table /Bucket #Cache buffer Chains latch
PROCESS #1
PROCESS #2
PROCESS #3
Server processes
BH = Block Header
-
Buffer_cache
BH BH BH BH BH
BH BH BH BH
0
1
Latch # 1
PROCESS #1
PROCESS #2
PROCESS #3
Cache buffer Chains latch Hash table Hash chain
Building Hash Bucket
Block Address
-
01Latch # 1
PROCESS #1
2
hash
Hash table Hash chain
DBA + Class
Buffer cache
BH BH
BH
BH BH BH
PROCESS
Building Hash Bucket
-
Reading a blockReading a block
-
Gets hash chain latch
walks along, does not find copy of block 29.13(file_id,block#)
gets cache buffers lru chain(LRU) latch
walks AUX list, finds empty buffer
Insert free buffer in the middle of the LRU - MAIN list
Add that header to hash ( BH )
Read the block to memory (buffer cache )
Release latches
Gets hash chain latch
walks along, does not find copy of block 29.13(file_id,block#)
gets cache buffers lru chain(LRU) latch
walks AUX list, finds empty buffer
Insert free buffer in the middle of the LRU - MAIN list
Add that header to hash ( BH )
Read the block to memory (buffer cache )
Release latches
Reading a block
-
Hash chain
rdba: 0x0740000d (29/13) class: 1
0
1
2
Hash table
BH BH BH
BH BH
BH
Oops!!Latch # 1
PROCESS #1
DBA + Class
hash
Reading a block
SQL >
-
Cache buffers lru chains
LRU #
REPL/LRU
LRU-WDBWR
PROCESS
Cache buffers lru chains
LRU - Least Recently Used
-
LRU - replacement list
LRU-W - write list
LRU - replacement list
LRU-W - write list
Buffer Headers are Linked one of the List
DBWR
disk
BH BH BH
BH BH BH
LRU
LRU-W
LRU Lists
1. Dirty Buffer2. Pinned Buffer3. Free Buffer
REPL/LRULRU-WLRU-XO
LRU-XR
LRU-REQ
Working Set
-
Main list
- pinned / dirty buffers
Auxiliary list
- Empty Buffers
Main list
- pinned / dirty buffers
Auxiliary list
- Empty Buffers
Each LRU contains
Main and Auxiliary Lists
REPL/LRU
LRU-W
MAIN
AUX
Hot End Cold End
MAIN
AUX
Sets # 1
-
BH BH BH BH BH0
1
2
n
BH BH BH BH BH BH
BH BH BH BH BH
BH BH BH
BH BH
BH BH BH
BH BH
BH BH BH BH
BH BH BH
BH
BH3
Sets # 1
Working Sets
Sets # 2 Sets # n
-
BH BH BH
BH BH
0
1Latch # 1
PROCESS #1
2 BH
DBA + Class
hash
rdba: 0x0740000d (29/13) class: 1
Hash table Hash chain
MAIN
AUX
Hot End Cold EndLRU List
LRU # 1
BH
Reading a block
Free Blocks
Midpoint Insertion
-
BH BH BH
BH BH
0
1Latch # 1
PROCESS #1
2 BH
DBA + Class
hash
rdba: 0x0740000d (29/13) class: 1
Hash table Hash chain
MAIN
AUX
Hot End Cold EndWorking sets
LRU # 1
BH
Free Blocks
Buffer cache
disk
Reading a block
PROCESS #1Midpoint Insertion
-
BH BH BH
BH BH
0
1Latch # 1
PROCESS #1
2 BH
DBA + Class
hash
rdba: 0x0740000d (29/13) class: 1
Hash table Hash chain
BHFound!!!
Reading a block
-
HEAD : [9ffcb018,9ffcb018]file#Block: (29/13)class : 1 block loc : 0x9fa00000status : XCURRENTobj : 17918Flags : only_sequential_accesslru : [9ffcb1a8,9ffcaf88]
HEAD : [9ffcb018,9ffcb018]file#Block: (29/13)class : 1 block loc : 0x9fa00000status : XCURRENTobj : 17918Flags : only_sequential_accesslru : [9ffcb1a8,9ffcaf88]
CHAIN: 16652 : BH (0x9ffcb018)
BH BH BH
BH BH BH
Buffer Header ( BH )
09FA00000
Memory
2F06C203
0000A206
09FA2BFF0
8K
Hash chain
-
Little bit about Little bit about Touch countTouch count
Block#
Touch count #
-
2 0
112
283
122
610
671
200
77 12
6 4
5122
MAIN
AUX
Read block 551
Update block
Hot End Cold End
Single-Block Reads
2 0
112
281
122
610
671
200
51
MAIN
Midpoint Insertion
-
77 12
6 4
5122
AUX
Read block 12
Hot End Cold End
Single-Block Reads
2 0
112
281
122
610
671
200
51
MAIN
2 0
112
281
123
610
671
200
51
MAIN
Increment touch count
-
Hot End Cold End
2 0
112
281
122
610
671
200
51
MAIN
Block movement
DBWR
77 12
6 4
5122
AUX
2 0
110
281
122
610
671
200
51
MAIN
PROCESS
-
12 13 14 15 16 17 1811 2019
DB_FILE_MULTIBLOCK_READ_COUNT = 8
Read block 40- 47
02 03 04 0501 080706
Update block
41 42 43 4440 474645
Hot End Cold End
Multi-Block Reads
19181716 4713 14 1512 46 45 44 43 42 4111 2040
Midpoint Insertion
-
Buffer cache
DBWR
Black Box
0123
n
BH BH BH BH
BH BH BH BH
BH BH BH
BH BH BH BH
BH BH BH BHLatch # n
Latch # 2
Latch # 1
LRU # 1
LRU # N
Hot End Cold EndCache buffer LRU latch
Working sets
Set # n
Set # 2
Set # 1
Buffer Cache Black Box
-
Buffer CacheBuffer CacheExample Example 11
-
SQL> show sgaTotal System Global Area 1979711488 bytesFixed Size 2085000 bytesVariable Size 889196408 bytesDatabase Buffers 1073741824 bytesRedo Buffers 14688256 bytes
Oracle SGA
Create tablespace buffertest DATAFILE '/mnt/poc/ETLTEST/buffertest_01.dbf' size 5M autoextend on extent management local SEGMENT SPACE MANAGEMENT AUTO;
-
SQL> insert into test1 VALUES (100,'BUFFER1');
1 row created.
SQL > Create table test1 (id number, desc1 varchar2(10) ) tablespace buffertest ;
SQL> select object_id,object_name from dba_objectswhere object_name='TEST1
OBJECT_ID OBJECT_NAM---------- ----------
17918 TEST1
Data Input
SQL> select * from test1;ID DESC1
---------- ----------
100 BUFFER1
-
SQL> SELECT SEGMENT_NAME,HEADER_FILE,HEADER_BLOCK,BYTES,BLOCKS,EXTENTSFROM DBA_SEGMENTS WHERE SEGMENT_NAME LIKE 'TEST1'
SEGMENT_NA HEADER_FILE HEADER_BLOCK BYTES BLOCKS EXTENTS---------- ----------- ------------ ---------- ---------- ----------
TEST1 29 11 65536 8 1
SQL> SELECT SEGMENT_NAME,HEADER_FILE,HEADER_BLOCK,BYTES,BLOCKS,EXTENTSFROM DBA_SEGMENTS WHERE SEGMENT_NAME LIKE 'TEST1'
SEGMENT_NA HEADER_FILE HEADER_BLOCK BYTES BLOCKS EXTENTS---------- ----------- ------------ ---------- ---------- ----------
TEST1 29 11 65536 8 1
1 select ROWID,DBMS_ROWID.ROWID_OBJECT(rowid) "OBJECT",2 DBMS_ROWID.ROWID_RELATIVE_FNO(rowid) "FILE",3 DBMS_ROWID.ROWID_BLOCK_NUMBER(rowid) "BLOCK",4 DBMS_ROWID.ROWID_ROW_NUMBER(rowid) "ROW",ID,DESC15* from TEST1
ROWID OBJECT FILE BLOCK ROW ID DESC1------------------ ---------- ---------- ---------- ---------- ---------- ----------
AAAEX+AAdAAAAANAAA 17918 29 13 0 100 BUFFER1
1 select ROWID,DBMS_ROWID.ROWID_OBJECT(rowid) "OBJECT",2 DBMS_ROWID.ROWID_RELATIVE_FNO(rowid) "FILE",3 DBMS_ROWID.ROWID_BLOCK_NUMBER(rowid) "BLOCK",4 DBMS_ROWID.ROWID_ROW_NUMBER(rowid) "ROW",ID,DESC15* from TEST1
ROWID OBJECT FILE BLOCK ROW ID DESC1------------------ ---------- ---------- ---------- ---------- ---------- ----------
AAAEX+AAdAAAAANAAA 17918 29 13 0 100 BUFFER1
Data Input
SQL> select OWNER,SEGMENT_NAME,EXTENT_ID,FILE_ID,BLOCK_ID,BYTES,BLOCKS from dba_extents where SEGMENT_NAME='TEST1';
OWNER SEGMENT_NA EXTENT_ID FILE_ID BLOCK_ID BYTES BLOCKS----- ---------- ---------- ---------- ---------- ---------- ----------
SYS TEST1 0 29 9 65536 8
SQL> select OWNER,SEGMENT_NAME,EXTENT_ID,FILE_ID,BLOCK_ID,BYTES,BLOCKS from dba_extents where SEGMENT_NAME='TEST1';
OWNER SEGMENT_NA EXTENT_ID FILE_ID BLOCK_ID BYTES BLOCKS----- ---------- ---------- ---------- ---------- ---------- ----------
SYS TEST1 0 29 9 65536 8
-
SQL> select * from test1;
Execution Plan----------------------------------------------------------
Plan hash value: 4122059633
---------------------------------------------------------------------------
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |---------------------------------------------------------------------------
| 0 | SELECT STATEMENT | | 1 | 11 | 3 (0)| 00:00:01 || 1 | TABLE ACCESS FULL| TEST1 | 1 | 11 | 3 (0)| 00:00:01 |---------------------------------------------------------------------------
SQL> select * from test1;
Execution Plan----------------------------------------------------------
Plan hash value: 4122059633
---------------------------------------------------------------------------
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |---------------------------------------------------------------------------
| 0 | SELECT STATEMENT | | 1 | 11 | 3 (0)| 00:00:01 || 1 | TABLE ACCESS FULL| TEST1 | 1 | 11 | 3 (0)| 00:00:01 |---------------------------------------------------------------------------
SQL> select * from test1;ID DESC1
---------- ----------
100 BUFFER1
Explain Plan
-
DataSegmentheader
L1BMB
L2BMB
data
11109 12 13 14 15 162
SQL> select HLADDR,DBABLK,DBARFIL ,ba,NXT_HASH, PRV_HASH ,decode(state,0,'free',1,'xcur',2,'scur',3,'cr', 4,'read',5,'mrec' ,6,'irec',7,'write',8,'pi') statefrom x$bh where DBARFIL=29 order by 3;
HLADDR DBABLK DBARFIL BA NXT_HASH PRV_HASH STATE-------- ------ ------ ------- --------- --------- -----
0D44DC9A8 2 29 0A0550000 0D44DCBE0 0D44DCBE0 xcur0D47FD418 11 29 09F668000 0D47FD610 09FFCC228 cr0D47FD418 11 29 09FA22000 09FFAC758 0D47FD610 xcur0D45DD590 12 29 09FE24000 0D45DD748 0D45DD748 xcur0D43BD708 13 29 09F296000 0D43BD880 0D43BD880 xcur0D472D880 14 29 09F666000 0D472D9B8 0D472D9B8 xcur0D450D9F8 15 29 09FA20000 0D450DAF0 0D450DAF0 xcur0D487DB70 16 29 09FE22000 0D487DC28 0D487DC28 xcur
SQL> select HLADDR,DBABLK,DBARFIL ,ba,NXT_HASH, PRV_HASH ,decode(state,0,'free',1,'xcur',2,'scur',3,'cr', 4,'read',5,'mrec' ,6,'irec',7,'write',8,'pi') statefrom x$bh where DBARFIL=29 order by 3;
HLADDR DBABLK DBARFIL BA NXT_HASH PRV_HASH STATE-------- ------ ------ ------- --------- --------- -----
0D44DC9A8 2 29 0A0550000 0D44DCBE0 0D44DCBE0 xcur0D47FD418 11 29 09F668000 0D47FD610 09FFCC228 cr0D47FD418 11 29 09FA22000 09FFAC758 0D47FD610 xcur0D45DD590 12 29 09FE24000 0D45DD748 0D45DD748 xcur0D43BD708 13 29 09F296000 0D43BD880 0D43BD880 xcur0D472D880 14 29 09F666000 0D472D9B8 0D472D9B8 xcur0D450D9F8 15 29 09FA20000 0D450DAF0 0D450DAF0 xcur0D487DB70 16 29 09FE22000 0D487DC28 0D487DC28 xcur
X$BH
File SpaceHeader
64k ( 8 blocks )
-
16652
69528
78532
116784
178664
216916
240544
09F668000
09FE24000
09FA22000
09FE22000
09F296000
09F666000
09FA20000
0A0550000
09F66800009FA22000
0A0550000
09FE24000
09F296000
09F666000
09FA20000
09FE22000
(0x9ff8bfc8)
(0xa0fa3298)
(0x9ffcc118)
(0x9ffee338)
(0x9ffac648)
(0x9ffee228)
0x9ffcc228) (0x9ffac758)
0D44DC9A8
0D47FD418
0D45DD590
0D43BD708
0D472D880
0D450D9F8
0D487DB70
Cache buffer BH dump
Cache buffer Chains latch
Hash table /Bucket # Hash chain ( BH )
Buffer cacheaddresses
2
13
12
11
14
15
16
-
CHAIN: 69528 LOC: 0xd44dcbe0 HEAD: [a0fa3298,a0fa3298]BH (0xa0fa3298) file#: 29 rdba: 0x07400002 (29/2) class: 13 ba: 0xa0550000
set: 9 blksize: 8192 bsi: 0 set-flg: 2 pwbcnt: 22dbwrid: 0 obj: -1 objn: 1 tsn: 28 afn: 29hash: [d44dcbe0,d44dcbe0] lru: [a0fa3428,a0fa3208]lru-flags: debug_dumpckptq: [NULL] fileq: [NULL] objq: [cf3cf018,cf3cf018]st: XCURRENT md: NULL tch: 1flags: gotten_in_current_modeLRBA: [0x0.0.0] HSCN: [0xffff.ffffffff] HSUB: [65535]scn: 0x0000.003fab68 seq: 0x02 flg: 0x04 tail: 0xab681d02frmt: 0x02 chkval: 0x43f5 type: 0x1d=KTFB Bitmapped File Space Header
CHAIN: 69528 LOC: 0xd44dcbe0 HEAD: [a0fa3298,a0fa3298]BH (0xa0fa3298) file#: 29 rdba: 0x07400002 (29/2) class: 13 ba: 0xa0550000
set: 9 blksize: 8192 bsi: 0 set-flg: 2 pwbcnt: 22dbwrid: 0 obj: -1 objn: 1 tsn: 28 afn: 29hash: [d44dcbe0,d44dcbe0] lru: [a0fa3428,a0fa3208]lru-flags: debug_dumpckptq: [NULL] fileq: [NULL] objq: [cf3cf018,cf3cf018]st: XCURRENT md: NULL tch: 1flags: gotten_in_current_modeLRBA: [0x0.0.0] HSCN: [0xffff.ffffffff] HSUB: [65535]scn: 0x0000.003fab68 seq: 0x02 flg: 0x04 tail: 0xab681d02frmt: 0x02 chkval: 0x43f5 type: 0x1d=KTFB Bitmapped File Space Header
Cache buffer BH dump
-
BH (0x9ffcc228) file#: 29 rdba: 0x0740000b (29/11) class: 4 ba: 0x9fa22000set: 9 blksize: 8192 bsi: 0 set-flg: 2 pwbcnt: 22dbwrid: 0 obj: 17918 objn: 17918 tsn: 28 afn: 29hash: [9ffac758,d47fd610] lru: [9ffce4a8,9ffcc198]lru-flags: debug_dumpckptq: [NULL] fileq: [NULL] objq: [ce0e1750,9ffcc208]st: XCURRENT md: NULL tch: 1flags:LRBA: [0x0.0.0] HSCN: [0xffff.ffffffff] HSUB: [65535]scn: 0x0000.003fabab seq: 0x02 flg: 0x04 tail: 0xabab2302frmt: 0x02 chkval: 0xee4e type: 0x23=PAGETABLE SEGMENT HEADER
BH (0x9ffac758) file#: 29 rdba: 0x0740000b (29/11) class: 4 ba: 0x9f668000set: 12 blksize: 8192 bsi: 0 set-flg: 2 pwbcnt: 15dbwrid: 1 obj: 17918 objn: -1 tsn: 28 afn: 29hash: [d47fd610,9ffcc228] lru: [9ffad5a8,9ffac6c8]lru-flags: debug_dumpckptq: [NULL] fileq: [NULL] objq: [ce0ed7e8,9ffac738]st: CR md: NULL tch: 1cr: [scn: 0x0.3fb424],[xid: 0x0.0.0],[uba: 0x0.0.0],[cls: 0x0.3fb424],[sfl: 0x0]flags:scn: 0x0000.003fabab seq: 0x02 flg: 0x04 tail: 0xabab2302frmt: 0x02 chkval: 0xee4e type: 0x23=PAGETABLE SEGMENT HEADER
BH (0x9ffcc228) file#: 29 rdba: 0x0740000b (29/11) class: 4 ba: 0x9fa22000set: 9 blksize: 8192 bsi: 0 set-flg: 2 pwbcnt: 22dbwrid: 0 obj: 17918 objn: 17918 tsn: 28 afn: 29hash: [9ffac758,d47fd610] lru: [9ffce4a8,9ffcc198]lru-flags: debug_dumpckptq: [NULL] fileq: [NULL] objq: [ce0e1750,9ffcc208]st: XCURRENT md: NULL tch: 1flags:LRBA: [0x0.0.0] HSCN: [0xffff.ffffffff] HSUB: [65535]scn: 0x0000.003fabab seq: 0x02 flg: 0x04 tail: 0xabab2302frmt: 0x02 chkval: 0xee4e type: 0x23=PAGETABLE SEGMENT HEADER
BH (0x9ffac758) file#: 29 rdba: 0x0740000b (29/11) class: 4 ba: 0x9f668000set: 12 blksize: 8192 bsi: 0 set-flg: 2 pwbcnt: 15dbwrid: 1 obj: 17918 objn: -1 tsn: 28 afn: 29hash: [d47fd610,9ffcc228] lru: [9ffad5a8,9ffac6c8]lru-flags: debug_dumpckptq: [NULL] fileq: [NULL] objq: [ce0ed7e8,9ffac738]st: CR md: NULL tch: 1cr: [scn: 0x0.3fb424],[xid: 0x0.0.0],[uba: 0x0.0.0],[cls: 0x0.3fb424],[sfl: 0x0]flags:scn: 0x0000.003fabab seq: 0x02 flg: 0x04 tail: 0xabab2302frmt: 0x02 chkval: 0xee4e type: 0x23=PAGETABLE SEGMENT HEADER
CHAIN: 216916 LOC: 0xd47fd610 HEAD: [9ffcc228,9ffac758]
Cache buffer BH dump
-
CHAIN: 16651 LOC: 0xd43bd870 HEAD: [NULL]CHAIN: 16652 LOC: 0xd43bd880 HEAD: [9ff8bfc8,9ff8bfc8]
BH (0x9ff8bfc8) file#: 29 rdba: 0x0740000d (29/13) class: 1 ba: 0x9f296000set: 11 blksize: 8192 bsi: 0 set-flg: 2 pwbcnt: 24dbwrid: 0 obj: 17918 objn: 17918 tsn: 28 afn: 29hash: [d43bd880,d43bd880] lru: [9ff8c158,9ff8bf38]lru-flags: debug_dumpckptq: [NULL] fileq: [NULL] objq: [ce0e2860,ce0e2860]st: XCURRENT md: NULL tch: 1flags: only_sequential_accessLRBA: [0x0.0.0] HSCN: [0xffff.ffffffff] HSUB: [65535]scn: 0x0000.003fabab seq: 0x03 flg: 0x06 tail: 0xabab0603frmt: 0x02 chkval: 0x0c13 type: 0x06=trans data
CHAIN: 16651 LOC: 0xd43bd870 HEAD: [NULL]CHAIN: 16652 LOC: 0xd43bd880 HEAD: [9ff8bfc8,9ff8bfc8]
BH (0x9ff8bfc8) file#: 29 rdba: 0x0740000d (29/13) class: 1 ba: 0x9f296000set: 11 blksize: 8192 bsi: 0 set-flg: 2 pwbcnt: 24dbwrid: 0 obj: 17918 objn: 17918 tsn: 28 afn: 29hash: [d43bd880,d43bd880] lru: [9ff8c158,9ff8bf38]lru-flags: debug_dumpckptq: [NULL] fileq: [NULL] objq: [ce0e2860,ce0e2860]st: XCURRENT md: NULL tch: 1flags: only_sequential_accessLRBA: [0x0.0.0] HSCN: [0xffff.ffffffff] HSUB: [65535]scn: 0x0000.003fabab seq: 0x03 flg: 0x06 tail: 0xabab0603frmt: 0x02 chkval: 0x0c13 type: 0x06=trans data
CHAIN: 116784 LOC: 0xd45dd748 HEAD: [9ffee338,9ffee338]BH (0x9ffee338) file#: 29 rdba: 0x0740000c (29/12) class: 1 ba: 0x9fe24000set: 10 blksize: 8192 bsi: 0 set-flg: 2 pwbcnt: 27dbwrid: 1 obj: 17918 objn: 17918 tsn: 28 afn: 29hash: [d45dd748,d45dd748] lru: [9ffee4c8,9ffee2a8]lru-flags: debug_dumpckptq: [NULL] fileq: [NULL] objq: [ce0f2988,9ffee318]st: XCURRENT md: NULL tch: 1flags: only_sequential_accessLRBA: [0x0.0.0] HSCN: [0xffff.ffffffff] HSUB: [65535]scn: 0x0000.003fabab seq: 0x01 flg: 0x04 tail: 0xabab0601frmt: 0x02 chkval: 0x1a0e type: 0x06=trans data
CHAIN: 116784 LOC: 0xd45dd748 HEAD: [9ffee338,9ffee338]BH (0x9ffee338) file#: 29 rdba: 0x0740000c (29/12) class: 1 ba: 0x9fe24000set: 10 blksize: 8192 bsi: 0 set-flg: 2 pwbcnt: 27dbwrid: 1 obj: 17918 objn: 17918 tsn: 28 afn: 29hash: [d45dd748,d45dd748] lru: [9ffee4c8,9ffee2a8]lru-flags: debug_dumpckptq: [NULL] fileq: [NULL] objq: [ce0f2988,9ffee318]st: XCURRENT md: NULL tch: 1flags: only_sequential_accessLRBA: [0x0.0.0] HSCN: [0xffff.ffffffff] HSUB: [65535]scn: 0x0000.003fabab seq: 0x01 flg: 0x04 tail: 0xabab0601frmt: 0x02 chkval: 0x1a0e type: 0x06=trans data
Cache buffer BH dump
-
CHAIN: 178664 LOC: 0xd472d9b8 HEAD: [9ffac648,9ffac648]BH (0x9ffac648) file#: 29 rdba: 0x0740000e (29/14) class: 1 ba: 0x9f666000set: 12 blksize: 8192 bsi: 0 set-flg: 2 pwbcnt: 15dbwrid: 1 obj: 17918 objn: 17918 tsn: 28 afn: 29hash: [d472d9b8,d472d9b8] lru: [9ffac7d8,9ffac5b8]lru-flags: debug_dumpckptq: [NULL] fileq: [NULL] objq: [9ffac848,ce0ed7e8]st: XCURRENT md: NULL tch: 1flags: only_sequential_accessLRBA: [0x0.0.0] HSCN: [0xffff.ffffffff] HSUB: [65535]scn: 0x0000.003fabab seq: 0x01 flg: 0x04 tail: 0xabab0601frmt: 0x02 chkval: 0x71a8 type: 0x06=trans data
CHAIN: 178664 LOC: 0xd472d9b8 HEAD: [9ffac648,9ffac648]BH (0x9ffac648) file#: 29 rdba: 0x0740000e (29/14) class: 1 ba: 0x9f666000set: 12 blksize: 8192 bsi: 0 set-flg: 2 pwbcnt: 15dbwrid: 1 obj: 17918 objn: 17918 tsn: 28 afn: 29hash: [d472d9b8,d472d9b8] lru: [9ffac7d8,9ffac5b8]lru-flags: debug_dumpckptq: [NULL] fileq: [NULL] objq: [9ffac848,ce0ed7e8]st: XCURRENT md: NULL tch: 1flags: only_sequential_accessLRBA: [0x0.0.0] HSCN: [0xffff.ffffffff] HSUB: [65535]scn: 0x0000.003fabab seq: 0x01 flg: 0x04 tail: 0xabab0601frmt: 0x02 chkval: 0x71a8 type: 0x06=trans data
CHAIN: 78532 LOC: 0xd450daf0 HEAD: [9ffcc118,9ffcc118]BH (0x9ffcc118) file#: 29 rdba: 0x0740000f (29/15) class: 1 ba: 0x9fa20000
set: 9 blksize: 8192 bsi: 0 set-flg: 2 pwbcnt: 22dbwrid: 0 obj: 17918 objn: 17918 tsn: 28 afn: 29hash: [d450daf0,d450daf0] lru: [9ffcc2a8,9ffcc088]lru-flags: debug_dumpckptq: [NULL] fileq: [NULL] objq: [9ffcc318,ce0e1750]st: XCURRENT md: NULL tch: 1flags: only_sequential_accessLRBA: [0x0.0.0] HSCN: [0xffff.ffffffff] HSUB: [65535]buffer tsn: 28 rdba: 0x0740000f (29/15)scn: 0x0000.003fabab seq: 0x01 flg: 0x04 tail: 0xabab0601frmt: 0x02 chkval: 0xc95c type: 0x06=trans data
CHAIN: 78532 LOC: 0xd450daf0 HEAD: [9ffcc118,9ffcc118]BH (0x9ffcc118) file#: 29 rdba: 0x0740000f (29/15) class: 1 ba: 0x9fa20000
set: 9 blksize: 8192 bsi: 0 set-flg: 2 pwbcnt: 22dbwrid: 0 obj: 17918 objn: 17918 tsn: 28 afn: 29hash: [d450daf0,d450daf0] lru: [9ffcc2a8,9ffcc088]lru-flags: debug_dumpckptq: [NULL] fileq: [NULL] objq: [9ffcc318,ce0e1750]st: XCURRENT md: NULL tch: 1flags: only_sequential_accessLRBA: [0x0.0.0] HSCN: [0xffff.ffffffff] HSUB: [65535]buffer tsn: 28 rdba: 0x0740000f (29/15)scn: 0x0000.003fabab seq: 0x01 flg: 0x04 tail: 0xabab0601frmt: 0x02 chkval: 0xc95c type: 0x06=trans data
Cache buffer BH dump
-
CHAIN: 240544 LOC: 0xd487dc28 HEAD: [9ffee228,9ffee228]BH (0x9ffee228) file#: 29 rdba: 0x07400010 (29/16) class: 1 ba: 0x9fe22000
set: 10 blksize: 8192 bsi: 0 set-flg: 2 pwbcnt: 27dbwrid: 1 obj: 17918 objn: 17918 tsn: 28 afn: 29hash: [d487dc28,d487dc28] lru: [9ffee3b8,9ffee198]lru-flags: debug_dumpckptq: [NULL] fileq: [NULL] objq: [9ffee428,ce0f2988]st: XCURRENT md: NULL tch: 1flags: only_sequential_accessLRBA: [0x0.0.0] HSCN: [0xffff.ffffffff] HSUB: [65535]scn: 0x0000.003fabab seq: 0x01 flg: 0x04 tail: 0xabab0601frmt: 0x02 chkval: 0x96a9 type: 0x06=trans data
CHAIN: 240544 LOC: 0xd487dc28 HEAD: [9ffee228,9ffee228]BH (0x9ffee228) file#: 29 rdba: 0x07400010 (29/16) class: 1 ba: 0x9fe22000
set: 10 blksize: 8192 bsi: 0 set-flg: 2 pwbcnt: 27dbwrid: 1 obj: 17918 objn: 17918 tsn: 28 afn: 29hash: [d487dc28,d487dc28] lru: [9ffee3b8,9ffee198]lru-flags: debug_dumpckptq: [NULL] fileq: [NULL] objq: [9ffee428,ce0f2988]st: XCURRENT md: NULL tch: 1flags: only_sequential_accessLRBA: [0x0.0.0] HSCN: [0xffff.ffffffff] HSUB: [65535]scn: 0x0000.003fabab seq: 0x01 flg: 0x04 tail: 0xabab0601frmt: 0x02 chkval: 0x96a9 type: 0x06=trans data
Cache buffer BH dump
-
SQL> select HLADDR ,NAME,a.DBABLK, GETS,MISSES,IMMEDIATE_GETS imm_get,2 IMMEDIATE_MISSES imm_miss,SPIN_GETS,SLEEP1 from x$bh a,v$latch_children b3* where a.hladdr = b.addr and DBARFIL=29 order by 3 ;
HLADDR NAME DBABLK GETS MISSES IMM_GET IMM_MISS SPIN_GETS SLEEP1--------- -------------------------- ---- ------ ------- ------- --------- ------
0D44DC9A8 cache buffers chains 2 1884 0 81 0 0 00D47FD418 cache buffers chains 11 1776 0 84 0 0 00D47FD418 cache buffers chains 11 1776 0 84 0 0 00D45DD590 cache buffers chains 12 1791 0 85 0 0 00D43BD708 cache buffers chains 13 1915 0 84 0 0 00D472D880 cache buffers chains 14 2008 0 85 0 0 00D450D9F8 cache buffers chains 15 1893 0 82 0 0 00D487DB70 cache buffers chains 16 1893 0 82 0 0 0
8 rows selected.
SQL> select HLADDR ,NAME,a.DBABLK, GETS,MISSES,IMMEDIATE_GETS imm_get,2 IMMEDIATE_MISSES imm_miss,SPIN_GETS,SLEEP1 from x$bh a,v$latch_children b3* where a.hladdr = b.addr and DBARFIL=29 order by 3 ;
HLADDR NAME DBABLK GETS MISSES IMM_GET IMM_MISS SPIN_GETS SLEEP1--------- -------------------------- ---- ------ ------- ------- --------- ------
0D44DC9A8 cache buffers chains 2 1884 0 81 0 0 00D47FD418 cache buffers chains 11 1776 0 84 0 0 00D47FD418 cache buffers chains 11 1776 0 84 0 0 00D45DD590 cache buffers chains 12 1791 0 85 0 0 00D43BD708 cache buffers chains 13 1915 0 84 0 0 00D472D880 cache buffers chains 14 2008 0 85 0 0 00D450D9F8 cache buffers chains 15 1893 0 82 0 0 00D487DB70 cache buffers chains 16 1893 0 82 0 0 0
8 rows selected.
v$latch_children
Latch Waits
cache buffers chains
-
SQL> create index idxtest1 on TEST1(ID) tablespace buffertest;
SQL>SELECT SEGMENT_NAME,HEADER_FILE,HEADER_BLOCK,BYTES,BLOCKS,EXTENTS FROM DBA_SEGMENTS WHERE SEGMENT_NAME LIKE 'IDXTEST1'
SEGMENT_NA HEADER_FILE HEADER_BLOCK BYTES BLOCKS EXTENTS---------- ----------- ------------ ---------- ---------- ----------
IDXTEST1 29 19 65536 8 1
SQL>SELECT SEGMENT_NAME,HEADER_FILE,HEADER_BLOCK,BYTES,BLOCKS,EXTENTS FROM DBA_SEGMENTS WHERE SEGMENT_NAME LIKE 'IDXTEST1'
SEGMENT_NA HEADER_FILE HEADER_BLOCK BYTES BLOCKS EXTENTS---------- ----------- ------------ ---------- ---------- ----------
IDXTEST1 29 19 65536 8 1
Index creation
SQL> select object_id,object_name from dba_objects where object_name='IDXTEST1';OBJECT_ID OBJECT_NAME
---------- --------------
18092 IDXTEST1
-
SQL> select * from test1 where id=100;
Execution Plan----------------------------------------------------------
Plan hash value: 3873210734
----------------------------------------------------------------------------------------
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |----------------------------------------------------------------------------------------
| 0 | SELECT STATEMENT | | 1 | 11 | 2 (0)| 00:00:01 || 1 | TABLE ACCESS BY INDEX ROWID| TEST1 | 1 | 11 | 2 (0)| 00:00:01 ||* 2 | INDEX RANGE SCAN | IDXTEST1 | 1 | | 1 (0)| 00:00:01 |----------------------------------------------------------------------------------------
SQL> select * from test1 where id=100;
Execution Plan----------------------------------------------------------
Plan hash value: 3873210734
----------------------------------------------------------------------------------------
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |----------------------------------------------------------------------------------------
| 0 | SELECT STATEMENT | | 1 | 11 | 2 (0)| 00:00:01 || 1 | TABLE ACCESS BY INDEX ROWID| TEST1 | 1 | 11 | 2 (0)| 00:00:01 ||* 2 | INDEX RANGE SCAN | IDXTEST1 | 1 | | 1 (0)| 00:00:01 |----------------------------------------------------------------------------------------
SQL> select * from test1 where id=100;
ID DESC1---------- ----------
100 BUFFER1
Explain Plan
-
SQL> select HLADDR,DBABLK,DBARFIL ,ba,NXT_HASH, PRV_HASH ,decode(state,0,'free',1,'xcur',2,'scur',3,'cr', 4,'read',5,'mrec',6,'irec',7,'write',8,'pi') state from x$bh whereDBARFIL=29 order by 2 ;
HLADDR DBABLK DBARFIL BA NXT_HASH PRV_HASH STATE---------- -------- ------- --------- --------- --------- -----
0D44DC9A8 2 29 0A0488000 0D44DCBE0 0D44DCBE0 xcur0D43BD708 13 29 09FA00000 0D43BD880 0D43BD880 xcur0D458DE88 20 29 09F638000 0D458E040 0D458E040 xcur
SQL> select HLADDR,DBABLK,DBARFIL ,ba,NXT_HASH, PRV_HASH ,decode(state,0,'free',1,'xcur',2,'scur',3,'cr', 4,'read',5,'mrec',6,'irec',7,'write',8,'pi') state from x$bh whereDBARFIL=29 order by 2 ;
HLADDR DBABLK DBARFIL BA NXT_HASH PRV_HASH STATE---------- -------- ------- --------- --------- --------- -----
0D44DC9A8 2 29 0A0488000 0D44DCBE0 0D44DCBE0 xcur0D43BD708 13 29 09FA00000 0D43BD880 0D43BD880 xcur0D458DE88 20 29 09F638000 0D458E040 0D458E040 xcur
INDEX
DataSegmentheader
L1BMB
L2BMB
191817 20 21 22 23 242File SpaceHeader
64k ( 8 blocks )
X$BH
-
CHAIN: 69528 LOC: 0xd44dcbe0 HEAD: [a0f9c858,a0f9c858]BH (0xa0f9c858) file#: 29 rdba: 0x07400002 (29/2) class: 13 ba: 0xa0488000set: 9 blksize: 8192 bsi: 0 set-flg: 2 pwbcnt: 23dbwrid: 0 obj: -1 objn: 1 tsn: 28 afn: 29hash: [d44dcbe0,d44dcbe0] lru: [a0f9c9e8,a0f9c7c8]lru-flags: debug_dumpckptq: [NULL] fileq: [NULL] objq: [cf3a9348,cf3a9348]st: XCURRENT md: NULL tch: 2flags: gotten_in_current_modeLRBA: [0x0.0.0] HSCN: [0xffff.ffffffff] HSUB: [65535]scn: 0x0000.004110b0 seq: 0x02 flg: 0x04 tail: 0x10b01d02frmt: 0x02 chkval: 0x4393 type: 0x1d=KTFB Bitmapped File Space Header
CHAIN: 69528 LOC: 0xd44dcbe0 HEAD: [a0f9c858,a0f9c858]BH (0xa0f9c858) file#: 29 rdba: 0x07400002 (29/2) class: 13 ba: 0xa0488000set: 9 blksize: 8192 bsi: 0 set-flg: 2 pwbcnt: 23dbwrid: 0 obj: -1 objn: 1 tsn: 28 afn: 29hash: [d44dcbe0,d44dcbe0] lru: [a0f9c9e8,a0f9c7c8]lru-flags: debug_dumpckptq: [NULL] fileq: [NULL] objq: [cf3a9348,cf3a9348]st: XCURRENT md: NULL tch: 2flags: gotten_in_current_modeLRBA: [0x0.0.0] HSCN: [0xffff.ffffffff] HSUB: [65535]scn: 0x0000.004110b0 seq: 0x02 flg: 0x04 tail: 0x10b01d02frmt: 0x02 chkval: 0x4393 type: 0x1d=KTFB Bitmapped File Space Header
CHAIN: 16652 LOC: 0xd43bd880 HEAD: [9ffcb018,9ffcb018]BH (0x9ffcb018) file#: 29 rdba: 0x0740000d (29/13) class: 1 ba: 0x9fa00000set: 9 blksize: 8192 bsi: 0 set-flg: 2 pwbcnt: 23dbwrid: 0 obj: 17918 objn: 17918 tsn: 28 afn: 29hash: [d43bd880,d43bd880] lru: [9ffcb1a8,9ffcaf88]lru-flags: debug_dumpckptq: [NULL] fileq: [NULL] objq: [ce0fc8b0,ce0fc8b0]st: XCURRENT md: NULL tch: 1flags:LRBA: [0x0.0.0] HSCN: [0xffff.ffffffff] HSUB: [65535]scn: 0x0000.003fabab seq: 0x03 flg: 0x06 tail: 0xabab0603frmt: 0x02 chkval: 0x0c13 type: 0x06=trans data
CHAIN: 16652 LOC: 0xd43bd880 HEAD: [9ffcb018,9ffcb018]BH (0x9ffcb018) file#: 29 rdba: 0x0740000d (29/13) class: 1 ba: 0x9fa00000set: 9 blksize: 8192 bsi: 0 set-flg: 2 pwbcnt: 23dbwrid: 0 obj: 17918 objn: 17918 tsn: 28 afn: 29hash: [d43bd880,d43bd880] lru: [9ffcb1a8,9ffcaf88]lru-flags: debug_dumpckptq: [NULL] fileq: [NULL] objq: [ce0fc8b0,ce0fc8b0]st: XCURRENT md: NULL tch: 1flags:LRBA: [0x0.0.0] HSCN: [0xffff.ffffffff] HSUB: [65535]scn: 0x0000.003fabab seq: 0x03 flg: 0x06 tail: 0xabab0603frmt: 0x02 chkval: 0x0c13 type: 0x06=trans data
Cache buffer BH dump
-
CHAIN: 102160 LOC: 0xd458e040 HEAD: [9ffaadd8,9ffaadd8]BH (0x9ffaadd8) file#: 29 rdba: 0x07400014 (29/20) class: 1 ba: 0x9f638000set: 12 blksize: 8192 bsi: 0 set-flg: 2 pwbcnt: 19dbwrid: 1 obj: 18092 objn: 18092 tsn: 28 afn: 29hash: [d458e040,d458e040] lru: [9ffab078,9ffaad48]lru-flags: debug_dumpckptq: [NULL] fileq: [NULL] objq: [ce0f3548,ce0f3548]st: XCURRENT md: NULL tch: 1flags:LRBA: [0x0.0.0] HSCN: [0xffff.ffffffff] HSUB: [65535]scn: 0x0000.004110b8 seq: 0x01 flg: 0x04 tail: 0x10b80601frmt: 0x02 chkval: 0x1176 type: 0x06=trans data
CHAIN: 102160 LOC: 0xd458e040 HEAD: [9ffaadd8,9ffaadd8]BH (0x9ffaadd8) file#: 29 rdba: 0x07400014 (29/20) class: 1 ba: 0x9f638000set: 12 blksize: 8192 bsi: 0 set-flg: 2 pwbcnt: 19dbwrid: 1 obj: 18092 objn: 18092 tsn: 28 afn: 29hash: [d458e040,d458e040] lru: [9ffab078,9ffaad48]lru-flags: debug_dumpckptq: [NULL] fileq: [NULL] objq: [ce0f3548,ce0f3548]st: XCURRENT md: NULL tch: 1flags:LRBA: [0x0.0.0] HSCN: [0xffff.ffffffff] HSUB: [65535]scn: 0x0000.004110b8 seq: 0x01 flg: 0x04 tail: 0x10b80601frmt: 0x02 chkval: 0x1176 type: 0x06=trans data
Cache buffer BH dump
-
SQL> select HLADDR ,NAME,a.DBABLK, GETS,MISSES,IMMEDIATE_GETS imm_get,2 IMMEDIATE_MISSES imm_miss,SPIN_GETS,SLEEP1 from x$bh a,v$latch_children b3* where a.hladdr = b.addr and DBARFIL=29 order by 3 ;
HLADDR NAME DBABLK GETS MISSES IMM_GET IMM_MISS SPIN_GETS SLEEP1--------- -------------------------- ---- ------ ------- ------- --------- ------
0D44DC9A8 cache buffers chains 2 198 0 45 0 0 00D43BD708 cache buffers chains 13 196 0 44 0 0 00D458DE88 cache buffers chains 20 197 0 44 0 0 0
3 rows selected.
SQL> select HLADDR ,NAME,a.DBABLK, GETS,MISSES,IMMEDIATE_GETS imm_get,2 IMMEDIATE_MISSES imm_miss,SPIN_GETS,SLEEP1 from x$bh a,v$latch_children b3* where a.hladdr = b.addr and DBARFIL=29 order by 3 ;
HLADDR NAME DBABLK GETS MISSES IMM_GET IMM_MISS SPIN_GETS SLEEP1--------- -------------------------- ---- ------ ------- ------- --------- ------
0D44DC9A8 cache buffers chains 2 198 0 45 0 0 00D43BD708 cache buffers chains 13 196 0 44 0 0 00D458DE88 cache buffers chains 20 197 0 44 0 0 0
3 rows selected.
Latch Waits
cache buffers chains
v$latch_children
-
Touch countTouch count
-
SQL> select addr,HLADDR,DBABLK,DBARFIL ,ba,NXT_HASH, PRV_HASH ,decode (state,0,'free',1,'xcur',2,'scur',3,'cr','read',5,'mrec',6,'irec',7,'write',8,'pi') state,tch,tim2* from x$bh where DBARFIL=29 order by 3
HLADDR DBABLK DBARFIL BA NXT_HASH PRV_HASH STAT TCH TIM--------- --- ------- --------- --------- --------- ---- ---- ----------
0D44DC9A8 2 29 0A0488000 0D44DCBE0 0D44DCBE0 xcur 2 12837303900D43BD708 13 29 09FA00000 0D43BD880 0D43BD880 xcur 1 12837303900D458DE88 20 29 09F638000 0D458E040 0D458E040 xcur 1 1283730390
SQL> select addr,HLADDR,DBABLK,DBARFIL ,ba,NXT_HASH, PRV_HASH ,decode (state,0,'free',1,'xcur',2,'scur',3,'cr','read',5,'mrec',6,'irec',7,'write',8,'pi') state,tch,tim2* from x$bh where DBARFIL=29 order by 3
HLADDR DBABLK DBARFIL BA NXT_HASH PRV_HASH STAT TCH TIM--------- --- ------- --------- --------- --------- ---- ---- ----------
0D44DC9A8 2 29 0A0488000 0D44DCBE0 0D44DCBE0 xcur 2 12837303900D43BD708 13 29 09FA00000 0D43BD880 0D43BD880 xcur 1 12837303900D458DE88 20 29 09F638000 0D458E040 0D458E040 xcur 1 1283730390
Touch count
-
09:10:22 SQL> select HLADDR,DBABLK,DBARFIL ,ba,NXT_HASH, PRV_HASH ,decode (state,0,'free',1,'xcur',2,'scur',3,'cr','read',5,'mrec' ,6,'irec',7,'write',8,'pi') state,tch,tim from x$bh where DBARFIL=29 order by 3 ;
HLADDR DBABLK DBARFIL BA NXT_HASH PRV_HASH STAT TCH TIM--------- ------ ------- --------- --------- --------- ---- --- ----------
0D44DC9A8 2 29 0A0488000 0D44DCBE0 09DF7AC98 xcur 2 12837303900D43BD708 13 29 09FA00000 0D43BD880 0D43BD880 xcur 4 12837894220D458DE88 20 29 09F638000 0D458E040 0D458E040 xcur 4 1283789422
09:10:42 SQL> select * from test1 where ID=100;
ID DESC1---------- ----------
100 BUFFER1
09:11:01 SQL> HLADDR DBABLK DBARFIL BA NXT_HASH PRV_HASH STAT TCH TIM--------- ------ ------- --------- --------- --------- ---- --- ----------
0D44DC9A8 2 29 0A0488000 0D44DCBE0 09DF7AC98 xcur 2 12837303900D43BD708 13 29 09FA00000 0D43BD880 0D43BD880 xcur 5 12837894460D458DE88 20 29 09F638000 0D458E040 0D458E040 xcur 5 1283789446
09:11:02 SQL>
09:10:22 SQL> select HLADDR,DBABLK,DBARFIL ,ba,NXT_HASH, PRV_HASH ,decode (state,0,'free',1,'xcur',2,'scur',3,'cr','read',5,'mrec' ,6,'irec',7,'write',8,'pi') state,tch,tim from x$bh where DBARFIL=29 order by 3 ;
HLADDR DBABLK DBARFIL BA NXT_HASH PRV_HASH STAT TCH TIM--------- ------ ------- --------- --------- --------- ---- --- ----------
0D44DC9A8 2 29 0A0488000 0D44DCBE0 09DF7AC98 xcur 2 12837303900D43BD708 13 29 09FA00000 0D43BD880 0D43BD880 xcur 4 12837894220D458DE88 20 29 09F638000 0D458E040 0D458E040 xcur 4 1283789422
09:10:42 SQL> select * from test1 where ID=100;
ID DESC1---------- ----------
100 BUFFER1
09:11:01 SQL> HLADDR DBABLK DBARFIL BA NXT_HASH PRV_HASH STAT TCH TIM--------- ------ ------- --------- --------- --------- ---- --- ----------
0D44DC9A8 2 29 0A0488000 0D44DCBE0 09DF7AC98 xcur 2 12837303900D43BD708 13 29 09FA00000 0D43BD880 0D43BD880 xcur 5 12837894460D458DE88 20 29 09F638000 0D458E040 0D458E040 xcur 5 1283789446
09:11:02 SQL>
Touch count
-
Direct memory Direct memory updateupdate
-
BH BH
BH
0
1Latch #
PROCESS #1
n BH
Hash table Hash chain Buffer cache
8 K
BH
Direct memory update
SQL >
-
SQL> create table blkinmemory (id number,desc2 varchar2(10)) tablespace TBLSIZE;
Table created.
SQL> insert into blkinmemory VALUES(546,'BUFFER1');
1 row created.
SQL> COMMIT;
Commit complete.
SQL> create table blkinmemory (id number,desc2 varchar2(10)) tablespace TBLSIZE;
Table created.
SQL> insert into blkinmemory VALUES(546,'BUFFER1');
1 row created.
SQL> COMMIT;
Commit complete.
Direct memory update
-
Direct memory update
CHAIN: 251736 LOC: 0xd48ba850 HEAD: [9ffcc668,9ffcc668]BH (0x9ffcc668) file#: 16 rdba: 0x04000008 (16/8)
class: 1 ba: 0x9fa2a000set: 9 blksize: 8192 bsi: 0 set-flg: 2 pwbcnt: 191dbwrid: 0 obj: 18427 objn: 18427 tsn: 15 afn: 16hash: [d48ba850,d48ba850] lru: [9ffcc908,9ffcc5d8]lru-flags: debug_dumpckptq: [NULL] fileq: [NULL] objq:
[ce0e30b0,ce0e30b0]st: XCURRENT md: NULL tch: 2flags: only_sequential_access
-
BH BH
BH
0
251736Latch #
PROCESS #1
n BH
Hash table Hash chain Buffer cache
0x09FA27FF0
0x09fa2a000
2F06C203
8 K
ba: 0x9fa2a000
Direct memory update
3806c2032F06C203
dump( 546,16), dump( 555,16)
SQL >
0x9ffcc668
updated
0x09FA27FF0
0x09fa2a0008 K
3806c203
DBWR
disk
-
6:20:45 SQL> select * from blkinmemory;
ID DESC2---------- ----------
546 BUFFER1
Elapsed: 00:00:00.00
16:21:09 SQL> ORADEBUG SETMYPIDStatement processed.16:21:14 SQL> oradebug peek 0x09FA27FF0 4[09FA27FF0, 09FA27FF4) = 2F06C20316:21:20 SQL> oradebug poke 0x09FA27FF0 4 0x3806c203BEFORE: [09FA27FF0, 09FA27FF4) = 2F06C203AFTER: [09FA27FF0, 09FA27FF4) = 3806C20316:21:27 SQL> select * from blkinmemory;
ID DESC2---------- ----------
555 BUFFER1
Elapsed: 00:00:00.0016:21:34 SQL>
Direct memory update
-
Total System Global Area 1979711488 bytesFixed Size 2085000 bytesVariable Size 889196408 bytesDatabase Buffers 1073741824 bytesRedo Buffers 14688256 bytesDatabase mounted.Database opened.SQL> set time on16:24:14 SQL> set timing on16:24:18 SQL> select * from blkinmemory;
ID DESC2---------- ----------
546 BUFFER1
Elapsed: 00:00:00.0016:24:27 SQL>
Total System Global Area 1979711488 bytesFixed Size 2085000 bytesVariable Size 889196408 bytesDatabase Buffers 1073741824 bytesRedo Buffers 14688256 bytesDatabase mounted.Database opened.SQL> set time on16:24:14 SQL> set timing on16:24:18 SQL> select * from blkinmemory;
ID DESC2---------- ----------
546 BUFFER1
Elapsed: 00:00:00.0016:24:27 SQL>
Direct memory update
-
Oracle wait Events
cache buffers chains cache buffers lru chain buffer busy waits free buffer waits read by other session db file single block read db file sequential read
cache buffers chains cache buffers lru chain buffer busy waits free buffer waits read by other session db file single block read db file sequential read
BH BH BH
BH BH BH
0
1
Latch # 1
PROCESS #1
PROCESS #2
PROCESS #3
Hash table Hash chain
MAIN
AUX
Hot End Cold EndLRU List
LRU # 1Free Blocks
Midpoint Insertion
DBWR
disk
-
Redobuffer
Shared pool
Black Box
Buffer cache
DBWR
Disk
DBWRDBWR
Localtion of Block Box
ARCH LGWR
Disk
CKPT
PMON SMON
SGA
-
SGA Internal ASM Internal RDS concept EXADATA concept RMAN Internal Control file Internal LMT Internal
Other oracle presentations: