-- 1.根据sql片段获取sql_id
-- select * from v$sql where last_active_time > sysdate and sql_text like '%ZL0204_03r%';
select sql_id, module from v$sql where last_active_time > sysdate and sql_text like '%ZL0204_03%';
-- 2.根据sql_id查询sid
-- select * from gv$session where sql_id = 'gmy972g24vc4j';
select sid, sql_id,username, client_info from v$session where sql_id = '931fv2qh3rsct';
-- 3.根据sid查询客户端的机器名
-- select sid, sql_id,username, client_info from v$session where sql_id = 'a6xj4zyvgt3ug';
select a.*, b.MACHINE from v$session_connect_info a inner join v$session b on a.sid = b.sid where a.sid = 1926;
标签:--,sql,查询,sid,Oracle,where,id,select
From: https://www.cnblogs.com/JaxYoun/p/17769682.html