LRU is an important linked list in buffer cache, its function I no longer detailed, already has a lot of relevant information. This is mainly discussed with you the main LRU, auxiliary LRU role.
Let's look at a test first.
Step 1: Environment introduction
Let's look at the size of the buffer cache:
Sql> Show SGA
Total System Global area 1073741824 bytes
Fixed Size 1284344 bytes
Variable Size 960497416 bytes
Database buffers 104857600 bytes
Redo buffers 7102464 bytes
Buffer Cache Size 100M.
Take a look at the test table size:
Sql> Set Linesize 1000
Sql> Col segment_name for A30
Sql> sql> Select segment_name,bytes/1024/1024 from dba_segments where segment_name= ' a3_70m ';
Segment_name bytes/1024/1024
------------------------------ ---------------
a3_70m 80
Sql> sql> Select segment_name,bytes/1024/1024 from dba_segments where segment_name= ' a4_70m ';
Segment_name bytes/1024/1024
------------------------------ ---------------
a4_70m 80
Two test tables, a3_70m, a4_70m, each size 80M. Originally wanted to build their two size to 70M, so the name with the suffix _70m, but built a little bit, however, this has no
That will not affect our test results.
Step 2: Refresh buffer cache pool, observe the length of LRU chain
Sql> alter system flush Buffer_cache;
Sql> Select Cnum_set,cnum_repl,anum_repl,cnum_write, anum_write from X$kcbwds;
Cnum_set Cnum_repl Anum_repl cnum_write anum_write
---------- ---------- ---------- ---------- ----------
0 0 0 0 0
0 0 0 0 0
0 0 0 0 0
0 0 0 0 0
6238 6238 6219 0 0
6237 6237 6224 0 0
0 0 0 0 0
0 0 0 0 0
0 0 0 0 0
0 0 0 0 0
0 0 0 0 0
Cnum_set Cnum_repl Anum_repl cnum_write anum_write
---------- ---------- ---------- ---------- ----------
0 0 0 0 0
0 0 0 0 0
0 0 0 0 0
0 0 0 0 0
0 0 0 0 0
Rows selected.
This view returns 16 rows, but only two rows have data. The other lines are 0, what's the reason?
Check the select name from V$latch_children where name = ' Cache buffers LRU chain '; You know, I have a total of 16 cache buffers LRU
Chain Latch, but only two were used.