oracle锁表查询和解锁方法是什么
时间:2021-01-15 14:50
oracle锁表查询和解锁方法:首先使用【PL/SQL Developer】连接并操作oracle数据库;然后使用语句select for update来锁表;最后用语句【alter system kill session 'sid】解锁。 本文操作环境:Windows7系统,PL/SQL Developer 13.0.1.1893版本,Dell G3电脑。 推荐(免费):oracle教程 oracle锁表查询和解锁方法: 1、使用常用的PL/SQL Developer 连接并操作oracle数据库。 2、比如常用的select for update语句就会锁表。 3、锁表后,有什么影响呢?另外的人再操作此表,对表进行修改就不允许了。与名字一样,把表锁起来,不让其他人操作。 如图操作,对其update时,提交不了。 4、如何查询哪些表被锁住了呢? 5、如何进行解锁呢? 6、再查询,就没有锁表的记录了。 以上就是oracle锁表查询和解锁方法是什么的详细内容,更多请关注gxlsystem.com其它相关文章!select * from table_name for update;
select p.spid,a.serial#, c.object_name,b.session_id,b.oracle_username,b.os_user_name
from v$process p,v$session a, v$locked_object b,all_objects c
where p.addr=a.paddr and a.process=b.process and c.object_id=b.object_id ;
alter system kill session 'sid,serial#';(其中sid=l.session_id)