To find the current SQL statement being executed by particular session in Oracle, Query V$SQLAREA and V$SESSION views.
Here is the query to report the current SQL statement being executed by a session:
select substr(v2.sid,1,5) "SID" ,substr(v2.username,1,8) "Username" ,substr(program,1,10) "Program" ,sql_text from sys.v_$sqlarea v1, sys.v_$session v2 where v1.address= v2.sql_address and v1.hash_value = v2.sql_hash_value;
The above query will return the following for example:
SID Username Program SQL_TEXT --- -------- ------- ----------------------------------- 12 SCOTT sqlplus insert into ken values(1000)