设为首页 加入收藏

TOP

buffercache和sharedpool详解(之三,sharedpool原理)(五)
2014-11-24 00:12:25 来源: 作者: 【 】 浏览:69
Tags:buffercache sharedpool 详解 之三 原理
er result cache settings and memory usage statistics.

V$RESULT_CACHE_MEMORY

Lists all the memory blocks in the server result cache and their corresponding statistics.

V$RESULT_CACHE_OBJECTS

Lists all the objects whose results are in the server result cache along with their attributes.

V$RESULT_CACHE_DEPENDENCY

Lists the dependency details between the results in the server cache and dependencies among these results.

CLIENT_RESULT_CACHE_STATS$

Stores cache settings and memory usage statistics for the client result caches obtained from the OCI client processes. This statistics table has entries for each client process that is using result caching. After the client processes terminate, the database removes their entries from this table. The client table lists information similar to V$RESULT_CACHE_STATISTICS.

See Also: Oracle Database Reference for details about CLIENT_RESULT_CACHE_STATS$

DBA_TABLES, USER_TABLES, ALL_TABLES

Includes a RESULT_CACHE column that shows the result cache mode annotation for the table. If the table has not been annotated, then this column shows DEFAULT. This column applies to both server and client result caching.

一个新的系统包被引入,DBMS_RESULT_CACHE可以用于执行关于Result Cache的管理:

10:21:19scott@felix SQL>set serveroutput on

10:25:30 scott@felix SQL>execdbms_result_cache.memory_report

R e s u l t C a c h e M e m o r y R e p o r t

[Parameters]

Block Size = 1K bytes

Maximum Cache Size = 1M bytes (1K blocks)

Maximum Result Size = 51K bytes (51 blocks)

[Memory]

Total Memory = 165032 bytes [0.096% of the SharedPool]

... Fixed Memory = 5352 bytes [0.003% of theShared Pool]

... Dynamic Memory = 159680 bytes [0.093% of theShared Pool]

....... Overhead = 126912 bytes

....... Cache Memory = 32K bytes (32 blocks)

........... Unused Memory = 30 blocks

........... Used Memory = 2 blocks

............... Dependencies = 1 blocks (1 count)

............... Results = 1 blocks

................... SQL = 1blocks (1 count)

PL/SQL procedure successfully completed.

10:25:49 scott@felix SQL>

1.2.2 Shared Pool 的设置说明

Shared Pool的大小可以通过初始化参数shared_pool_size设置。在Oracle 10g之前在共享池的设置上存在很多不同声音,一方面很多人建议可以把Shared Pool设置得稍大,以充分Cache代码和避免ORA-04031错误的出现;另一方面又有很多人建议不能把Shared Pool设置得过大,因为过大可能会带来管理上的额外负担,从而会影响数据库的性能。

在下面的测试中用到了Shared Pool的转储,所以首先需要了解一下相关的命令。可以通过如下命令转储Shared Pool共享内存的内容:

注意alter session setevents 'immediate trace name heapdump level 2'是一条内部命令,指定Oracle把Shared Pool的内存结构在Level 2级转储出来

Get_trc_scripts.sql

SELECT a.VALUE || b.symbol || c.instance_name ||'_ora_' || d.spid ||

'.trc' trace_file_name

FROM(SELECT VALUE FROM v$parameter WHERE NAME = 'user_dump_dest') a,

(SELECT SUBSTR(VALUE, -6, 1) symbol

FROM v$parameter

WHERE NAME = 'user_dump_dest') b,

(SELECT instance_name FROM v$instance) c,

(SELECT spid

FROM v$session s, v$process p, v$mystat m

WHERE s.paddr = p.addr

AND s.SID = m.SID

AND m.statistic# = 0) d;

TRACE_FILE_NAME

---------------------------------------------------------------------

/u01/app/oracle/diag/rdbms/felix/felix/trace/felix_ora_2751.trc

10:36:03 scott@felix SQL>

Shared Pool通过Free Lists管理free内存块(Chunk),Free的内存块(Chunk)按 不 同size被划分到不同的部分(Bucket)进行管理;

可以通过下图对Shared Pool的Free List管理进行说明\

不同bucket管理的内存块的size范围如下所示(size显示的是下边界):

[oracle@felix~]$ cat /u01/app/oracle/diag/rdbms/felix/felix/trace/felix_ora_2751.trc | grepbucket

Reservedbucket 0 size=32

Reservedbucket 1 size=4400

首页 上一页 2 3 4 5 6 7 下一页 尾页 5/7/7
】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
分享到: 
上一篇DBCP数据库配置含义 下一篇MongoDB集群插入数据测试

评论

帐  号: 密码: (新用户注册)
验 证 码:
表  情:
内  容: