操作方法
使用常用的PL/SQL Developer 连接并操作oracle数据库。
比如常用的select for update语句就会锁表。 select * from table_name for update;
锁表后,有什么影响呢?另外的人再操作此表,对表进行修改就不允许了。与名字一样,把表锁起来,不让其他人操作。 如图操作,对其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)
再查询,就没有锁表的记录了。