oracle 常用解锁脚本
程序员文章站
2022-06-02 12:34:19
...
1、查看锁表进程
select b.owner,b.object_name,a.session_id,a.locked_mode from v$locked_object a,dba_objects b where b.object_id = a.object_id;
2、解锁脚本
select 'alter system kill session ''' || side || ',' || seriale || ''';' AA
from (select b.username, b.sid side, b.serial# seriale, logon_time
from v$locked_object a, v$session b
where a.session_id = b.sid
order by b.logon_time)
3、锁表
--手工锁表:
lock table tablename in row share mode nowait;
--锁定整个表
LOCK TABLE tablename IN EXCLUSIVE MODE;
4、查看某个时间点之前表数据
select * from tablename as of timestamp to_timestamp('删除时间点','yyyy-mm-dd hh24:mi:ss')
下一篇: iOS中代理属性为什么要用Weak修饰?