Home > Database > Mysql Tutorial > Oracle锁表的原因及解锁方法

Oracle锁表的原因及解锁方法

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-07 16:59:35
Original
1508 people have browsed it

产生的原因最大的可能就是更改数据没有提交事务,数据库就将表锁住!所以在更新时不要用select * from a for update这样的语句很

产生的原因最大的可能就是更改数据没有提交事务,数据库就将表锁住!所以在更新时不要用select * from a for update这样的语句很容易锁表,可能用select *,t.rowid from t 这样的语句代替,,这个也是数据库推荐使用的语句。

解锁的方法:

1、查看锁表进程:

SQL:select * from v$session t1, v$locked_object t2 where t1.sid = t2.SESSION_ID;

2、将锁住的进程杀掉

SQL:alter system kill session SID,serial#;

linux

Related labels:
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template