如何根据sql里的关键字,找到对应的会话号和操作系统进程号
set linesize 150
column USERNAME format a20
column SQL_TEXT format a60
select a.sid,a.SERIAL#, PADDR,SADDR,a.username,s.sql_text from v$session a,v$sqltext s where a.sql_address=s.address and a.sql_hash_value=s.hash_value and sql_text like '% select count(*) fr%' ;
--根据sql内容查会话的SID, SERIAL#, PADDR
SID SERIAL# PADDR SADDR USERNAME SQL_TEXT
---------- ---------- -------- -------- -------------------- ----------------------------------------
142 32 2DA53ADC 2DB30044 LUO select count(*) from luo.tb4
select spid from v$process where addr='2DA53ADC';
SPID
------------
3344
合并上面两个查询,直接查操作系统SPID
select spid from v$process where addr=(select PADDR from v$session a,v$sqltext s where a.sql_address=s.address and a.sql_hash_value=s.hash_value and sql_text like '%select count(*) from luo.tb4%');
可以用kill -9 加spid杀掉操作系统进程
如何根据sql里的关键字,找到对应的会话号和操作系统进程号
本文2024-09-22 20:22:35发表“eas cloud知识”栏目。
本文链接:https://wenku.my7c.com/article/kingdee-eas-113228.html