ITPub博客

首页 > 数字化转型 > ERP > 数据缓存管理

数据缓存管理

原创 ERP 作者:lucky_lau 时间:2005-08-24 00:00:58 0 删除 编辑

Buffer manage=forground process+DBWR+LCK

Internal structure

1

db cache management

[@more@]

Buffer manage=forground process+DBWR+LCK

Internal structure

cache buffer chains

2. the LRUW list (dirty list)

3. LRU list2

cache buffer chains

1 cache buffer chains latch ->n hash table (buckets)->1 hash list->n buffer header->1 buffer block

Lru

Mru->lru

Block Status:free/pinned(pinned clean/pinned dirty)/dirty

Lruw

1. write dirty buffers/find clean buffers

foreground process begin search lru:

search_count=0;

lock lru;

point=tail of lru;

search lru:

if block.status=dirty then

block->lruw;

dirty buffers inspected+=1;

elseif block.status=free then

free buffers inspected+=1;

search_count+=1;

release lock;

return;

else

null;

end if;

if search>=foreground scan depth(_db_block_max_scan_count) then

raise eventwrite dirty buffers/find clean buffers;

wait= free buffer;

return;

end if;

point=point->mru;

end;

2.write dirty buffers when idle

Write out per _db_block_no_idle_writes(s)

3.write checkpoint -needed buffers/recovery end

Cache Management Process flow

Begin process:

Bucket=Hash(block.dba);

Lock latch(bucket);

Search hash(list(bucket)):

Found:

Pin block;

If hashlist.block.scn>block.scn then

CR(block);

Consistent read count+=1;

Else

Db block read count+=1;

End;

Else

Lock latch(lru);

foreground process begin search lru:

End search;

db cache management

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/4584/viewspace-805056/,如需转载,请注明出处,否则将追究法律责任。

下一篇: logminer示例
请登录后发表评论 登录
全部评论

注册时间:2008-02-26

  • 博文量
    20
  • 访问量
    608333