ArcSDE性能优化-Oracle将数据库对象Pin到共享池中来提高数据库性能

32 篇文章 0 订阅
8 篇文章 0 订阅
在Oracle数据库中可以将数据库对象Pin到共享池中来提高数据库性能

PS:Pin直译为钉住、压住,个人理解为将对象放入到共享池中,因为不知道翻译什么合适,都已Pin直接描述。

建议Esri所有的存储过程和序列都被Pin,一旦对象驻留在Oracle的共享池中,他们不需要对其进行分析,从而节省大量资源。

在共享池中Pin对象所使用的可用内存可能会被其他进程占用,所以为共享池分配额外的内存是非常必要的,一般情况下,做不Pin对象很少使用 ;这可能会对数据库性能的不利影响。

执行步骤
1:在执行Pin数据库对象之前,需要将SYS用户的共享池(DBMS_SHARED_POOL)权限赋予SDE用户
  1. GRANT execute ON dbms_shared_pool TO sde;   
2:在共享池Pin对象
  1. EXECUTE dbms_shared_pool.keep ('STANDARD''P');   

  1. 可以对SYS用户下的以下包进行Pin   
  2. STANDARD   
  3.   
  4.    DBMS_STANDARD   
  5.   
  6.    DBMS_UTILITY   
  7.   
  8.    DBMS_DESCRIBE   
  9.   
  10.    DBMS_OUTPUT   

3:作为SDE用户,可以将频繁使用的对象进行Pin

  1. EXECUTE dbms_shared_pool.keep ('VERSION_UTIL''P');   
  2.   
  3.   
  4.  EXECUTE dbms_shared_pool.keep ('LOCK_UTIL''P');   

4:数据库对象并不限于存储过程。数据库序列、 触发器和游标可以全部PIN在共享池中。ESRI 建议PIN经常使用的序列。

  1. EXECUTE dbms_shared_pool.keep ('SDE.CONNECTION_ID_GENERATOR''Q');   


关于DBMS_SHARED_POOL.KEEP的解释

  1. --  Keep an object in the shared pool.  Once an object has been keeped in  
  2.   --    the shared pool, it is not subject to aging out of the pool.  This  
  3.   --    may be useful for certain semi-frequently used large objects since  
  4.   --    when large objects are brought into the shared pool, a larger  
  5.   --    number of other objects (much more than the size of the object  
  6.   --    being brought in, may need to be aged out in order to create a  
  7.   --    contiguous area large enough.  
  8.   --    WARNING:  This procedure may not be supported in the future when  
  9.   --    and if automatic mechanisms are implemented to make this  
  10.   --    unnecessary.  
  11.   --  Input arguments:  
  12.   --    name  
  13.   --      The name of the object to keep.  There are two kinds of objects:  
  14.   --      PL/SQL objects, triggers, sequences, types and Java objects,  
  15.   --      which are specified by name, and  
  16.   --      SQL cursor objects which are specified by a two-part number  
  17.   --      (indicating a location in the shared pool).  For example:  
  18.   --        dbms_shared_pool.keep('scott.hispackage')  
  19.   --      will keep package HISPACKAGE, owned by SCOTT.  The names for  
  20.   --      PL/SQL objects follows SQL rules for naming objects (i.e.,  
  21.   --      delimited identifiers, multi-byte names, etc. are allowed).  
  22.   --      A cursor can be keeped by  
  23.   --        dbms_shared_pool.keep('0034CDFF, 20348871', 'C')  
  24.   --      The complete hexadecimal address must be in the first 8 characters.  
  25.   --      The value for this identifier is the concatenation of the  
  26.   --      'address' and 'hash_value' columns from the v$sqlarea view.  This  
  27.   --      is displayed by the 'sizes' call above.  
  28.   --      Currently 'TABLE' and 'VIEW' objects may not be keeped.  
  29.   --    flag  
  30.   --      This is an optional parameter.  If the parameter is not specified,  
  31.   --        the package assumes that the first parameter is the name of a  
  32.   --        package/procedure/function and will resolve the name.  Otherwise,  
  33.   --        the parameter is a character string indicating what kind of object  
  34.   --        to keep the name identifies.  The string is case insensitive.  
  35.   --        The possible values and the kinds of objects they indicate are  
  36.   --        given in the following table:  
  37.   --        Value        Kind of Object to keep  
  38.   --        -----        ----------------------  
  39.   --          P          package/procedure/function  
  40.   --          Q          sequence  
  41.   --          R          trigger  
  42.   --          T          type  
  43.   --          JS         java source  
  44.   --          JC         java class  
  45.   --          JR         java resource  
  46.   --          JD         java shared data  
  47.   --          C          cursor  
  48.   --      If and only if the first argument is a cursor address and hash-value,  
  49.   --        the flag parameter should be set to 'C' (or 'c').  
  50.   --  Exceptions:  
  51.   --    An exception will raised if the named object cannot be found.  

http://blog.csdn.net/linghe301/article/details/6853165

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值