달력

42024  이전 다음

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30

사용하다보면은 쿼리를 날렸을때 데이터가 많아서 세션을 계속 물고있는경우가 있다 이럴경우에

 


select
    oracle_username || ' (' || s.osuser || ')' username
  , s.sid || ',' || s.serial# sid_serial
  , owner || '.' || object_name object
  , object_type
  , decode( l.block
          ,0, 'Not Blocking'
          ,1, 'Blocking'
          ,2, 'Global') status
          ,decode(v.locked_mode
            ,0, 'None'
            ,1, 'Null'
            ,2, 'Row-S (SS)'
            ,3, 'Row-X (SX)'
            ,4, 'Share'
            ,5, 'S/Row-X (SSX)'
            ,6, 'Exclusive', TO_CHAR(lmode)) mode_held
from v$locked_object v
    ,dba_objects d
    ,v$lock l
    ,v$session s
where v.object_id = d.object_id
and   v.object_id = l.id1
and   v.session_id = s.sid
order by oracle_username,session_id



위 주문으로 sid 랑 serial 을 가지고 아래 구문으로 실행하면은 세션이 죽는다.

 

alter system kill session 'sid,serial';


'Database > ORACLE' 카테고리의 다른 글

oracle LISTAGG 사용하기  (0) 2016.04.28
oracle 초성검색 function(mssql function 수정)  (0) 2016.04.19
패키지 생성 암호화 CRYPTO  (0) 2015.02.24
oracle 외부접속  (0) 2015.02.24
where절에 if문처럼 and조건 사용하기  (1) 2015.02.24
Posted by 타카스 류지
|