Oracle解锁表笔记】的更多相关文章

1.查询被锁的对象: select object_name,machine,s.sid,s.serial# from v$locked_object l,dba_objects o ,v$session s where l.object_id = o.object_id and l.session_id=s.sid; 2.下面的语句用来杀死一个进程,其中a,b分别是上面查询出的sid,serial: alter system kill session 'a,b'; 3.如果利用上面的命令杀死一个…
最近开发的时候遇到一个小问题,执行一段sql之后发现 表被锁了 显示错误为:ora-00054:resource busy and acquire with nowait specified 百度之后发现是session进程卡住了,可以说是表的某些资源被锁定了 可以采用如下方法解锁: select t2.username,t2.sid,t2.serial#,t2.logon_timefrom v$locked_object t1,v$session t2where t1.session_id=t…
//查询锁表id select session_id from v$locked_object; //查询该ID的serial# SELECT sid, serial#, username, osuser FROM v$session where sid = 152; //杀死该进程 alter system kill session '12,748'…
select b.owner,b.object_name,a.session_id,a.locked_mode,c.serial#,c.sid||','||c.serial# from v$locked_object a,dba_objects b ,v$session c where b.object_id = a.object_id And a.session_id = c.sid   alter system kill session '1161,4464' immediate;…
Oracle的表锁死以及解锁 oracle 查看锁死的表,锁死的进程. select sess.sid, sess.serial#, lo.oracle_username, lo.os_user_name, ao.object_name, lo.locked_mode from v$locked_object lo, dba_objects ao, v$session sess where ao.object_id = lo.object_id and lo.session_id = sess.…
数据库操作语句的分类 DDL:数据库模式定义语言,关键字:create DML:数据操纵语言,关键字:Insert.delete.update DCL:数据库控制语言 ,关键字:grant.remove DQL:数据库查询语言,关键字:select oracle表在什么情况下会被锁住 DML锁又可以分为,行锁.表锁.死锁 行锁:当事务执行数据库插入.更新.删除操作时,该事务自动获得操作表中操作行的排它锁. 表级锁:当事务获得行锁后,此事务也将自动获得该行的表锁(共享锁),以防止其它事务进行DDL…
在oracle 上面查看别锁定的表,以及解锁表的sql: select t3.object_name,t3.owner,t2.machine,t2.sid,t2.serial# from v$locked_object t1,v$session t2,dba_objects t3 where t1.session_id = t2.sid and t1.object_id = t3.object_id; alter system kill session'101,1507'; # sid , se…
--查询数据库锁表记录 select sess.sid, sess.serial#, lo.oracle_username, lo.os_user_name, ao.object_name, lo.locked_mode from v$locked_object lo, dba_objects ao, v$session sess, v$process p where ao.object_id = lo.object_id and lo.session_id = sess.sid -- and…
--查看锁表情况 select distinct a.sid, to_char(a.logon_time, 'YYYY-MM-DD HH24:mi:ss') loginTime, a.serial#, a.USERNAME, a.OSUSER, a.MACHINE, a.STATUS, d.sql_text, 'ALTER SYSTEM KILL SESSION ''' || a.sid || ',' || a.SERIAL# || ',@' || a.inst_id || ''';' from…
锁表查询和解锁 --查询SELECT object_name, machine, s.sid, s.serial# FROM gv$locked_object l, dba_objects o, gv$session s WHERE l.object_id = o.object_id AND l.session_id = s.sid; --将上面查询出来的sid ,serial 替换下面解锁SID,SERIAL --解锁alter system kill session 'SID, SERIAL…