oracle根据sql_text查找会话及sql_id

#根据sql内容查找sql_id和sql的发起方式
select sql_id,module from v$sql where last_active_time > sysdate and sql_text like '%dba_free_space%';
#生成杀进程的sql
select 'ALTER SYSTEM KILL SESSION'''||sid||','||serIal#||''''||';' from v$session where sql_id='12sd234erdf23';
select * from gv$session where sql_id='12sd234erdf23'; #获取会话信息
alter system kill session '1231,23423' immediate; #立即杀掉会话
select * from gv$sql where sql_id='12sd234erdf23'  #根据sql_id查找sql   

  

posted @ 2023-08-08 09:32  苍茫宇宙  阅读(686)  评论(0编辑  收藏  举报