解决锁表
1.以sys 用户登入查询哪些session 被锁
sql>select t2.username,t2.sid,t2.serial#,t2.logon_time
from v$locked_object t1,v$session t2
where t1.session_id=t2.sid order by t2.logon_time;
2.根据sid查询该会话的具体sql语句
sql>select sql_text
from v$session a ,v$sqltext_with_newlines b
where
DECODE (a.sql_hash_value,0 ,prev_hash_value,sql_hash_value)= b.hash_value
and a.sid=&sid order by piece;
3.可以记录 《2》中查询的sql语句,然后kill 该会话。
sql>alter system kill session '512,2186';
sql>select t2.username,t2.sid,t2.serial#,t2.logon_time
2.根据sid查询该会话的具体sql语句
sql>select sql_text
3.可以记录 《2》中查询的sql语句,然后kill 该会话。