Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1134359
  • 博文数量: 276
  • 博客积分: 10077
  • 博客等级: 上将
  • 技术积分: 2513
  • 用 户 组: 普通用户
  • 注册时间: 2007-08-24 20:31
文章分类

全部博文(276)

文章存档

2020年(1)

2015年(5)

2012年(2)

2011年(6)

2010年(7)

2009年(224)

2008年(31)

我的朋友

分类: Oracle

2009-07-07 10:21:39

关于v$resource_limit中的gcs_resources资源
我们知道,当ges_ress和ges_locks超出初始分配的数量时,就会从shared_pool_size里面强行申请内存片。超出的越多,当然就占用更多的内存区域。而这时候,数据库的压力又非常的大,从而不断的产生4031错误。


这时候我们能做的就是将这两个指标的数量控制在一定范围之内。或者将他的初始分配值扩大,以及限制它的最高值。
可以使用两个隐含参数来控制:_lm_locks和_lm_ress。如_lm_locks=(200000,200000) 。这么设定的意思是:初始值、最大值。
也就是说初始分配200000,最大也只能使用200000, 但是设置这个需要注意一点的是,会增加oracle使用内存的数量。
假如您使用了10G的sga.那么设定1000000的话大概就是多出1G.加上SGA的话。就是11G的内存了。因此在遇到这种情
况时一定要注意主机的内存情况,因为修改完该参数后,重启实例时就会预分配内存。这个可以通过ipcs看出来。

 

看上去是rac的,于是查了下,结果发现确实有gcs_resources(单instance都为0)

SQL> select * from v$resource_limit;

RESOURCE_NAME                  CURRENT_UTILIZATION MAX_UTILIZATION INITIAL_ALLOCATION             LIMIT_VALUE
------------------------------ ------------------- --------------- ------------------------------ ------------------------------
processes                                      179             199        500                            500
sessions                                       179             210        555                            555
enqueue_locks                                   21             360       6932                           6932
enqueue_resources                               46             144       2660                      UNLIMITED
ges_procs                                      178             197        501                            501
ges_ress                                         0               0      11316                      UNLIMITED
ges_locks                                        0               0      17220                      UNLIMITED
ges_cache_ress                               32641          145828          0                      UNLIMITED
ges_reg_msgs                                   194            1293       1750                      UNLIMITED
ges_big_msgs                                    37             404       1750                      UNLIMITED
ges_rsv_msgs                                     0               0       1000                           1000

RESOURCE_NAME                  CURRENT_UTILIZATION MAX_UTILIZATION INITIAL_ALLOCATION             LIMIT_VALUE
------------------------------ ------------------- --------------- ------------------------------ ------------------------------
gcs_resources                               162251          432717     559940                         559940
gcs_shadows                                 108880          299468     559940                         559940
dml_locks                                       17             614       2440                      UNLIMITED
temporary_table_locks                            0               7 UNLIMITED                      UNLIMITED
transactions                                   513             533        610                      UNLIMITED
branches                                         2               6        610                      UNLIMITED
cmtcallbk                                        0               3        610                      UNLIMITED
sort_segment_locks                              31              39 UNLIMITED                      UNLIMITED
max_rollback_segments                           20              22        610                          65535
max_shared_servers                               1               1 UNLIMITED                      UNLIMITED
parallel_max_servers                            10              30         80                           3600

查了下metalink:

Subject: What Is GCS_RESOURCES And How Do We Control Them?

Applies to:

Oracle Server - Enterprise Edition - Version: 9.2.0.1 to 10.2.0.1
Information in this document applies to any platform.

Goal

Question 1: What is gcs_resources ?

Question 2: What happens if it exceeds its limit?

Question 3: How do we adjust the limit?

Solution

Answer 1: gcs_resources is global cache resources which are essentially structures we use to protect cache structures (buffers). Each instance "masters" cache resources and the implementation of this mastership is done via a gc resource structure

Answer 2 :Nothing - this is simply stating how high the value has reached for a particular resource. If we need more gcs_resources for some reason, they are obtained from the shared pool.

Answer 3 : RAC specific memory is allocated at the time of SGA creation, mostly in the shared pool. However, the memory does not count in the SHARED_POOL_SIZE as defined in the init.ora parameter file.Therefore, when migrating Oracle from single instance to RAC, you do not need to adjust the SHARED_POOL_SIZE parameter to accommodate the additional memory that RAC uses; Oracle does that automatically. Note that the memory for the KCL global cache lock elements will be allocated in the buffer cache, and not in the shared pool.

You can monitor the exact RAC memory resource usage of the shared pool by querying V$SGASTAT for GCS, GES and KCL related entries. Also, the current and maximum number of GCS resources / shadows (resource names gcs_resources and gcs_shadows) and GES resources / enqueues (resource names ges_ress and ges_locks) can be obtained from V$RESOURCE_LIMIT. In case we are running out of reserved memory for GCS / GES related components, Oracle will dynamically allocate memory from the free memory pool in the shared pool. However, it is recommended to carefully calculate the resources and enqueues as needed since dynamic memory allocation from the shared pool is an expensive operation.

We recommend you monitor for more time to see if this limit is reach and it is a constant situation, then you could considered to increase the value of gcs_resources by instance.

SQL> alter system set "_gcs_resources"= scope=spfile sid='';
阅读(2637) | 评论(0) | 转发(0) |
0

上一篇:Latch wait events

下一篇:Latch Free等待事件

给主人留下些什么吧!~~