Oracle – Find Session with Specific Command

oraclesession

I have an Oracle instance with some active sessions from different users. How can I find the SID/SERIAL of a specific session given that this session is surely running a specific SELECT I know?

Best Answer

select sid, serial# from v$session where sql_id = (select sql_id from v$sql where sql_text = 'your SQL text');