태그 보관물: lock table

Oracle Lock Table 처리방법

Lock Table 찾기

SELECT T1.OBJECT_NAME, 
	   DECODE(T2.LOCKED_MODE,2,'ROW SHARE',3,'ROW EXCLUSIVE',4,'SHARE',5,'SHARE ROW EXCLUSIVE','OTHERS') AS LOCK_MODE
FROM DBA_OBJECTS T1, V$LOCKED_OBJECT T2
WHERE T1.OBJECT_ID = T2.OBJECT_ID;

Lock Table을 발생시킨 세션 ID 찾기

SELECT A.SESSION_ID AS SESSION_ID, 
	   B.SERIAL# AS SERIAL_NO,
       A.OS_USER_NAME AS OS_USER_NAME,
       A.ORACLE_USERNAME AS ORACEL_USERNAME,
       B.STATUS AS STATUS
FROM V$LOCKED_OBJECT A, V$SESSION B
WHERE A.SESSION_ID = B.SID;

해당되는 세션 죽이기

ALTER SYSTEM KILL SESSION 'SESSION_ID,SERIAL_NO';