几个相关的表
SELECT * FROM v$lock; SELECT * FROM v$sqlarea; SELECT * FROM v$session; SELECT * FROM v$process ; SELECT * FROM v$locked_object; SELECT * FROM all_objects; SELECT * FROM v$session_wait;
找到被锁定的表
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;
释放
--alter system kill session 'sid, serial#'; ALTER system kill session '23, 1647';
重启数据库
(1) 切换到oracle用户:su – oracle
(2) 进入Sqlplus控制台:sqlplus /nolog
(3) 以系统管理员登录:connect / as sysdba
(4) 启动数据库:startup
(5) 如果是关闭数据库:shutdown immediate
(6) 退出sqlplus控制台:exit
(7) 进入监听器控制台:lsnrctl
(8) 启动监听器:start
(9) 退出监听器控制台:exit