查询资源占用的两种办法
方法1
- select object_id from dba_objects where object_name = ‘被锁住的表名’;
- select ‘alter system kill session ‘’’ || SID || ‘,’ || SERIAL# || ‘’’;’ from V s e s s i o n w h e r e S I D i n ( s e l e c t s i d f r o m ∗ ∗ v session where SID in (select sid from **v sessionwhereSIDin(selectsidfrom∗∗venqueue_lock t**
where t.type = ‘TO’
and id1 = ‘第一步查出来的ID’)**
方法2
select a.OBJECT_ID,b.object_name,a.SESSION_ID from v$locked_object a,dba_objects b where a.OBJECT_ID=b.object_id