v$db_object_cache常用的欄位:
TYPE:類型(如,sequence、procedure、function、package、package body、trigger)
KEPT:(yes/no),可以知道物件是否以DBMS_SHARED_POOL.KEEP永久固定在記憶體中
SHARABLE_MEM:佔用的記憶體空間
PINS:目前執行該物件的session數量
LOCKS:目前鎖定該物件的session數量
LOADS:物件在最初被載入記憶體後被執行的總次數
查看ORACLE中正被執行的PROCEDURE,例如Procedure的名稱為test_proc
select owner ,name from v$db_object_cache where type ='TEST_PROC' and locks > 0 and pins >0;
找出執行Procedure的SID、SERIAL#後再kill掉就可以了
select vs.sid,vs.serial#, va.object
from v$session vs,v$access va
where va.object = 'TEST_PORC' ;
把幾個Table串在一起的語法:
select vs.sid,vs.serial#,vp.spid,vd.name,vs.status,vs.osuser,vs.machine,vs.terminal
,vs.program,vs.sql_address,vs.module,vs.action
from v$db_object_cache vd,
v$access va,
v$session vs,
v$process vp
where vs.sid=va.sid
and vp.addr=vs.paddr
and vd.name=va.object
and vd.type='PROCEDURE'
and vd.locks>0
and vd.pins>0
and va.type='PROCEDURE';
把幾個Table串在一起的語法:
select vs.sid,vs.serial#,vp.spid,vd.name,vs.status,vs.osuser,vs.machine,vs.terminal
,vs.program,vs.sql_address,vs.module,vs.action
from v$db_object_cache vd,
v$access va,
v$session vs,
v$process vp
where vs.sid=va.sid
and vp.addr=vs.paddr
and vd.name=va.object
and vd.type='PROCEDURE'
and vd.locks>0
and vd.pins>0
and va.type='PROCEDURE';