Home >Database >Mysql Tutorial >Oracle中事务锁(锁住的表、锁住的会话)

Oracle中事务锁(锁住的表、锁住的会话)

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOriginal
2016-06-07 17:27:111168browse

今天又学会一招,查看Oracle数据库中由于会话非正常退出而导致的事务锁: 1.查看锁住的表 SELECT b.owner,b.object_name,a.sessi

今天又学会一招,查看Oracle数据库中由于会话非正常退出而导致的事务锁:

1.查看锁住的表

SELECT b.owner,b.object_name,a.session_id,a.locked_mode 
    FROM v$locked_object a ,dba_objects b 
    WHERE b.object_id = a.object_id;

2.查看被锁住的会话

SELECT b.username,b.sid,b.serial#,logon_time 
    FROM v$locked_object a,v$session b 
    WHERE a.session_id = b.sid order by b.logon_time; 

3.如果要断开某个会话,执行

Alter system kill session ‘sid,serial#’

linux

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn