트 랜 잭 션 과 잠 금-세 션 종료 로 잠 금 해제

15253 단어 사무.
--    
/*
     ,  
ALTER SYSTEM KILL SESSION 'SID,SERIAL#';
*/
set linesize 200;
SELECT T2.USERNAME,
	   T2.SID,
	   T2.SERIAL#,   
	   T2.LOGON_TIME,
	   T3.SQL_TEXT
FROM V$LOCKED_OBJECT T1,V$SESSION T2,V$SQLTEXT T3
WHERE T1.SESSION_ID=T2.SID AND T2.SQL_ADDRESS=T3.ADDRESS
ORDER BY T2.LOGON_TIME;

ALTER SYSTEM KILL SESSION 'SID,SERIAL#';

--           :

SQL> set linesize 200;
SQL> SELECT T2.USERNAME,
  2      T2.SID,
  3      T2.SERIAL#,   
  4      T2.LOGON_TIME,
  5      T3.SQL_TEXT
  6  FROM V$LOCKED_OBJECT T1,V$SESSION T2,V$SQLTEXT T3
  7  WHERE T1.SESSION_ID=T2.SID AND T2.SQL_ADDRESS=T3.ADDRESS
  8  ORDER BY T2.LOGON_TIME;

USERNAME                              SID    SERIAL# LOGON_TIME     SQL_TEXT
------------------------------ ---------- ---------- -------------- --------------------------------
XAXNB                                 137        481 17-4  -11     update emp set empname='chenzzaz' where empid=2

SQL> alter system kill session '137,481';

     

--         

SQL> update emp set empname='chenzzaz' where empid=2;
update emp set empname='chenzzaz' where empid=2
       *
  1      :
ORA-00028:         


/*20110418           */
SELECT T2.SID,
	   T2.SERIAL#
FROM V$LOCKED_OBJECT T1,V$SESSION T2,V$SQLTEXT T3
WHERE T1.SESSION_ID=T2.SID AND T2.SQL_ADDRESS=T3.ADDRESS
GROUP BY T2.SID,T2.SERIAL#;

ALTER SYSTEM KILL SESSION '493,4';
ALTER SYSTEM KILL SESSION '470,4';
ALTER SYSTEM KILL SESSION '510,4';
ALTER SYSTEM KILL SESSION '471,3';

좋은 웹페이지 즐겨찾기