注册 登录  
 加关注
查看详情
   显示下一条  |  关闭
温馨提示!由于新浪微博认证机制调整,您的新浪微博帐号绑定已过期,请重新绑定!立即重新绑定新浪微博》  |  关闭

lazydba

hello

 
 
 

日志

 
 

oracle library cache pin  

2008-03-19 16:40:10|  分类: all about databa |  标签: |举报 |字号 订阅

  下载LOFTER 我的照片书  |
Sometimes we need to compile pl/sql codes, but we can't because some bad guy block us.
So how to find them, the holders (and waiters) of 'library cache pin' and 'bibrary cache lock'?
?
This is just one try:
select a.sid, a.event, b.kgllkmod, b.kgllkreq, b.kgllktype
from v$session a, dba_kgllock b, v$session_wait c
where a.saddr = b.kgllkuse
and b.kgllkhdl = c.p1raw
and c.event like 'library cache%';
?
If we?know who they are,?we may kill them.
alter system kill session 'sid,serial#' immediate;
or get spid(OS process id)?from v$process[v$process.addr = v$session.paddr]?
#kill -9 spid
[
But sometimes our ability is limited, what if we only have?restricted(or limited)?access to the system?
Every system has it's vulnerability, because system is made by people and every people have weakness.
]
?
Reference:

DBA_KGLLOCK

de<DBA_KGLLOCKde< lists all the locks and pins held on KGL objects (objects in the Kernel Generic Library cache).

Column Datatype NULL Description
de<kgllkusede< de<RAW(4)de<
Address of the user session that holds the lock or pin
de<kgllkhdlde< de<RAW(4)de<
Address of the handle for the KGL object
de<kgllkmodde< de<NUMBERde<
Current mode of the lock or pin
de<kgllkreqde< de<NUMBERde<
Mode in which the lock or pin was requested
de<kgllktypede< de<VARCHAR2(4)de<
Whether this is a lock or a pin
?
It's handy to use DBA_KGLLOCK if we can not access x$kgllk, x$kglpn
Defintion of DBA_KGLLOCK.?
from $ORACLE_HOME/rdbms/admin/catblock.sql
/* this is an auxiliary view containing the KGL locks and pins */
create or replace view DBA_KGLLOCK as
? select kgllkuse, kgllkhdl, kgllkmod, kgllkreq, 'Lock' kgllktype from x$kgllk
?union all
? select kglpnuse, kglpnhdl, kglpnmod, kglpnreq, 'Pin'? kgllktype from x$kglpn;
create or replace public synonym DBA_KGLLOCK for DBA_KGLLOCK;
grant select on DBA_KGLLOCK to select_catalog_role;

library cache lock

This event controls the concurrency between clients of the library cache. It acquires a lock on the object handle so that either:

  • One client can prevent other clients from accessing the same object

  • The client can maintain a dependency for a long time (for example, no other client can change the object)

This lock is also obtained to locate an object in the library cache.

Wait Time: 3 seconds (1 second for PMON)

Parameter Description
handle address Address of the object being loaded
lock address Address of the load lock being used. This is not the same thing as a latch or an enqueue, it is a State Object.
mode Indicates the data pieces of the object which need to be loaded
namespace See "namespace"

library cache pin

This event manages library cache concurrency. Pinning an object causes the heaps to be loaded into memory. If a client wants to modify or examine the object, the client must acquire a pin after the lock.

Wait Time: 3 seconds (1 second for PMON)

Parameter Description
handle address Address of the object being loaded
pin address Address of the load lock being used. This is not the same thing as a latch or an enqueue, it is basically a State Object.
mode Indicates which data pieces of the object that needs to be loaded
namespace See "namespace"
?
?

  评论这张
 
阅读(94)| 评论(0)
推荐 转载

历史上的今天

评论

<#--最新日志,群博日志--> <#--推荐日志--> <#--引用记录--> <#--博主推荐--> <#--随机阅读--> <#--首页推荐--> <#--历史上的今天--> <#--被推荐日志--> <#--上一篇,下一篇--> <#-- 热度 --> <#-- 网易新闻广告 --> <#--右边模块结构--> <#--评论模块结构--> <#--引用模块结构--> <#--博主发起的投票-->
 
 
 
 
 
 
 
 
 
 
 
 
 
 

页脚

网易公司版权所有 ©1997-2018