在对数据库执行操作时,感觉数据库慢的时候,可以考虑检查下数据库中所要操作的表是否有锁,如果有的话,可以用以下方法杀掉:
--查锁,并且杀掉
select * from v$session t1, v$locked_object t2 where t1.sid = t2.SESSION_ID;
--alter system kill session '&sid,&ser ';
以下是例子:
alter system kill session '113,5699';
alter system kill session '133,10518';
alter system kill session '134,7981';
alter system kill session '147,29476';
--查锁,并且杀掉
select * from v$session t1, v$locked_object t2 where t1.sid = t2.SESSION_ID;
--alter system kill session '&sid,&ser ';
以下是例子:
alter system kill session '113,5699';
alter system kill session '133,10518';
alter system kill session '134,7981';
alter system kill session '147,29476';