The V$SESSION view has the SQL_ID of the current session being run for each session.http://docs.oracle.com/cd/B28359_01/ser ... s_3016.htm
There are a load of different ways to find the top SQL statement of an instance.
- "Top Activity" screen of Cloud Control, assuming you have a Diagnostics and Tuning Pack license.
- ASH Viewer (standard connection does not use ASH, so doesn't need Diagnostics and Tuning Pack license: http://sourceforge.net/projects/ashv/
- Top Sessions script: http://www.oracle-base.com/dba/script.p ... ssions.sql
- TOAD and SQL Developer have Top-SQL type screens.
- The ADDM and AWR reports display Top SQL information, assuming you have a Diagnostics and Tuning Pack license.
- MOATS: http://blog.tanelpoder.com/2011/03/29/m ... g-scripts/
So find the session, then check the SQL_ID of that session.