oracle查询会话锁并解锁
2008-07-04 17:17
309 查看
session 1:
C:/>sqlplus scott/tiger
SQL> select * from t;
A B C
---------- -------------------- --------------------
111 aa bb
222 hello world
SQL> update t set b='hi' where a=222;
已更新 1 行。
session 2:
C:/>sqlplus hxg/hxg
SQL> select * from scott.t;
A B C
---------- -------------------- --------------------
111 aa bb
222 hello world
SQL> update scott.t set b='good' where a=222;
挂起等待。。。。
another session 2(session 22):
C:/>sqlplus hxg/hxg
SQL> select s.sid,s.SERIAL#,s.machine,o.object_name,l.oracle_username,l.locked_mode
2 from v$locked_object l,v$session s,all_objects o
3 where l.session_id=s.sid and l.object_id=o.object_id ;
SID SERIAL#
---------- ----------
MACHINE
----------------------------------------------------------------
OBJECT_NAME ORACLE_USERNAME LOCKED_MODE
------------------------------ ------------------------------ -----------
148 2
MSHOME/TECH037
T HXG 3
150 2
MSHOME/TECH037
T SCOTT 3
SQL> alter system kill session '150,2';
系统已更改。
此时:session 2:
SQL> update scott.t set b='good' where a=222;
已更新 1 行。
SQL>
C:/>sqlplus scott/tiger
SQL> select * from t;
A B C
---------- -------------------- --------------------
111 aa bb
222 hello world
SQL> update t set b='hi' where a=222;
已更新 1 行。
session 2:
C:/>sqlplus hxg/hxg
SQL> select * from scott.t;
A B C
---------- -------------------- --------------------
111 aa bb
222 hello world
SQL> update scott.t set b='good' where a=222;
挂起等待。。。。
another session 2(session 22):
C:/>sqlplus hxg/hxg
SQL> select s.sid,s.SERIAL#,s.machine,o.object_name,l.oracle_username,l.locked_mode
2 from v$locked_object l,v$session s,all_objects o
3 where l.session_id=s.sid and l.object_id=o.object_id ;
SID SERIAL#
---------- ----------
MACHINE
----------------------------------------------------------------
OBJECT_NAME ORACLE_USERNAME LOCKED_MODE
------------------------------ ------------------------------ -----------
148 2
MSHOME/TECH037
T HXG 3
150 2
MSHOME/TECH037
T SCOTT 3
SQL> alter system kill session '150,2';
系统已更改。
此时:session 2:
SQL> update scott.t set b='good' where a=222;
已更新 1 行。
SQL>
相关文章推荐
- oracle 锁表查询与解锁
- ORACLE 如何查询被锁定表及如何解锁释放session
- Oracle会话查询等
- ORACLE 如何查询被锁定表及如何解锁释放session
- oracle 数据库管理-查询锁表及解锁
- 查询oracle被锁对象并解锁
- Oracle的查询锁记录和解锁
- oracle锁表查询及解锁kill进程
- Oracle 查询数据库碎片和和历史会话
- oracle查询锁表及解锁
- oracle查询锁表与解锁情况提供解决方案
- ORACLE 查询被锁住的对象,并结束其会话的方法
- oracle查询锁表与解锁情况提供解决方案
- 查询oracle会话间的阻塞情况
- ORACLE 如何查询被锁定表及如何解锁释放session
- ORACLE 如何查询被锁定表及如何解锁释放session
- oracle查询当前会话数量
- oracle查询锁表信息及解锁
- Oracle查询锁表以及杀会话或系统进程来解除锁表操作
- 查询oracle当前用户会话的信息