Saturday, July 12, 2008

To know which query is executed on a particular session

To know which query is executed on a particular session or to see what SQL queries, users are running on the system, you can execute following on sqlplus

select a.sid, a.serial#, b.sql_text from v$session a, v$sqlarea b where a.sql_address=b.address and a.username='AHSAN_REPORT';

SID SERIAL# SQL_TEXT
---------- ---------- ----------------------------------------------
122 61521 select count(*) from gen_person where gen_person_id=95000

Change your user name here with 'AHSAN_REPORT'

Sphere: Related Content

0 comments: