Oracle数据库数据恢复、性能优化

找回密码
注册
搜索
热搜: 活动 交友 discuz
发新帖
1#
发表于 2012-1-30 22:54:30
今天比较晚了 ,这个问题明天会回复。

回复 显示全部楼层 道具 举报

2#
发表于 2012-1-31 15:10:18
ODM research : this is internal research only , maclean don't ensure all he had told you is always right.


For Free List

1.在heap中unused memory 总是保存在一条Free-list上
2. Heap总是 最少有一条 Free-List
3.  初始化堆heap的 程序调用者(KGH Function Caller)可以指定以下属性:
a. heap中Freelist 空闲列表的数量(The number of free list )
b. chunk内存块的分布范围(The range of chunks to put on them.)

4. memory manger(KGH) 保证 heap中的每一块空闲内存Free Chunk 总是在某一条Free list上


Free List Buck 结构 kghbk-> Kernel Generic shared Heap manager Bucket

回复 显示全部楼层 道具 举报

3#
发表于 2012-1-31 21:51:45
ODM Test:
  1. SQL> show parameter sga_target

  2. NAME                                 TYPE        VALUE
  3. ------------------------------------ ----------- ------------------------------
  4. sga_target                           big integer 0
  5. SQL> show parameter shared_pool_size

  6. NAME                                 TYPE        VALUE
  7. ------------------------------------ ----------- ------------------------------
  8. shared_pool_size                     big integer 200M


  9. SQL> select * from v$version;

  10. BANNER
  11. ----------------------------------------------------------------
  12. Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - 64bi
  13. PL/SQL Release 10.2.0.1.0 - Production
  14. CORE    10.2.0.1.0      Production
  15. TNS for Linux: Version 10.2.0.1.0 - Production
  16. NLSRTL Version 10.2.0.1.0 - Production

  17. SQL> oradebug setmypid;
  18. Statement processed.
  19. SQL> oradebug dump heapdump 536870914;
  20. Statement processed.
  21. SQL> oradebug tracefile_name;
  22. /s01/admin/G10R21/udump/g10r21_ora_3755.trc

  23. HEAP DUMP heap name="sga heap(1,0)"  desc=0x600332a8
  24. extent sz=0xfe0 alt=216 het=32767 rec=9 flg=-126 opc=0


  25. FREE LISTS:
  26. Bucket 0 size=32
  27. Bucket 1 size=40
  28.   Chunk        0802e99a8 sz=       40    free      "               "
  29.   Chunk        0805fac20 sz=       40    free      "               "
  30. ......................

  31. Bucket 2 size=48
  32.   Chunk        0803ec120 sz=       48    free      "               "
  33.   Chunk        08051d580 sz=       48    free      "               "
  34.   Chunk        0804d9670 sz=       48    free      "               "
  35.   Chunk        0805cc008 sz=       48    free      "               "

  36. ................................

  37. Bucket 251 size=12360
  38.   Chunk        08024c3f0 sz=    12496    free      "               "
  39. Bucket 252 size=16408
  40.   Chunk        08026e088 sz=    16592    free      "               "
  41.   Chunk        080256510 sz=    20480    free      "               "
  42.   Chunk        081f8c4f0 sz=    24688    free      "               "
  43. Bucket 253 size=32792
  44. Bucket 254 size=65560
  45.   Chunk        081f30f28 sz=   361928    free      "               "
  46.   Chunk        08019bd80 sz=   714344    free      "               "
  47. Total free space   =  1191752
复制代码
size > 65560bytes=64k  chunks always stored in Bucket 254 ,  空闲列表最大有0-254 共255个 Buckets(Heap free lists contain 255 buckets)

Each bucket contains double linked list to free chunks

Bucket sizes increase in
increments of 4 bytes - 16, 20, 24, 28, 32 ... 808, 812
increments of 64 bytes - 876, 940, 1004 ... 3948, 4012
then 4108, 8204, 16396, 32780, 65548

Reduces fragmentation
  1. RESERVED FREE LISTS:
  2. Reserved bucket 0 size=32
  3. Reserved bucket 1 size=4400
  4. Reserved bucket 2 size=8216
  5. Reserved bucket 3 size=8696
  6. Reserved bucket 4 size=8704
  7. Reserved bucket 5 size=8712
  8. Reserved bucket 6 size=8720
  9. Reserved bucket 7 size=9368
  10. Reserved bucket 8 size=9376
  11. Reserved bucket 9 size=12352
  12. Reserved bucket 10 size=12360
  13. Reserved bucket 11 size=16408
  14. Reserved bucket 12 size=32792
  15. Reserved bucket 13 size=65560
  16.   Chunk        080000088 sz=   212808  R-free      "               "
  17.   Chunk        080400088 sz=   212808  R-free      "               "
  18.   Chunk        080800088 sz=   212808  R-free      "               "
  19.   Chunk        080c00088 sz=   212808  R-free      "               "
  20.   Chunk        081000088 sz=   212808  R-free      "               "
  21.   Chunk        081400088 sz=   212808  R-free      "               "
  22.   Chunk        081800088 sz=   212808  R-free      "               "
  23.   Chunk        081c00088 sz=   212808  R-free      "               "
  24. Total reserved free space   =  4256160
复制代码
RESERVED FREE LISTS一般有14个Bucket
  1. UNPINNED RECREATABLE CHUNKS (lru first):
  2.   Chunk        083ffffc8 sz=       56    recreate  "fixed allocatio"  latch=0x600156a0
  3.   Chunk        082bffd10 sz=       64    recreate  "fixed allocatio"  latch=0x82f4bfd0
  4.   Chunk        0823ce0a8 sz=       56    recreate  "fixed allocatio"  latch=0x82f4bfd0
  5.   Chunk        0823cce68 sz=       56    recreate  "fixed allocatio"  latch=0x82f4bfd0
  6.   Chunk        0823caaa8 sz=       56    recreate  "fixed allocatio"  latch=0x82f4c110
  7.   Chunk        0823ca6a0 sz=       56    recreate  "fixed allocatio"  latch=0x82f4c110
  8.   Chunk        0823c98b8 sz=       56    recreate  "fixed allocatio"  latch=0x82f4c110
  9.   Chunk        0823c74f8 sz=       56    recreate  "fixed allocatio"  latch=0x82f4c070
  10.   Chunk        0823c72b0 sz=       56    recreate  "fixed allocatio"  latch=0x82f4c070
  11.   Chunk        0823c6920 sz=       56    recreate  "fixed allocatio"  latch=0x82f4c110
  12.   Chunk        0823c0410 sz=       56    recreate  "fixed allocatio"  latch=0x82f4c110
  13.   Chunk        0823ba420 sz=     1112    recreate  "KGLS heap      "  latch=0x82f4c110
  14.   Chunk        0823bfd00 sz=     1112    recreate  "Heap0: KGL     "  latch=0x82f4c110

  15. Unpinned space     =  2957616  rcr=974 trn=1465
复制代码
1.recreate   memory 是那些 已分配的内存,但是仍可以被age out到heap的Free List上
2.KGH heap manager 使用LRU算法来实现aging
3.chunk flag KGHACRECR用来标示 那些其内容 已经为recreatable的chunk
4. 当chunk不在被使用, chunk的用户可以显示地将它 unpin解锁掉,从而KGM Memory Manager会看到这个chunk成为潜在的Free Chunk
5. KGH 会调用已注册的回调程序(callback)来请求chunk的所有者将该chunk 释放Free掉
6. chunk的拥有者可以自行决定是否释放Free chunk
7. 被 "pinned"住的recreatable chunk无法aged out到Free List上
8. 所有未被锁住的Unpinned Recrateable chunk都被 暂存在堆heap的LRU LIST上

Recreatable chunk header - kghrc -> kernel generic heap memory manager recreatable chunk header

Chunk        0823ba420 sz=     1112    recreate  "KGLS heap      "  latch=0x82f4c110

Oracle同样利用latch来限制 client 的callback对recreatable chunk的串行操作。

回复 显示全部楼层 道具 举报

您需要登录后才可以回帖 登录 | 注册

QQ|手机版|Archiver|Oracle数据库数据恢复、性能优化

GMT+8, 2024-5-4 11:36 , Processed in 0.049794 second(s), 22 queries .

Powered by Discuz! X2.5

© 2001-2012 Comsenz Inc.

回顶部
TEL/電話+86 13764045638
Email service@parnassusdata.com
QQ 47079569