select s.sid,s.serial#,s.LOGON_TIME,s.STATUS,s.username,s.LAST_CALL_ET,s.event,s.SECONDS_IN_WAIT,s.lockwait,s.osuser,s.machine,x.sql_fulltext,px.sql_text prev_sql_txt from v$session s, v$sqlarea x,v$sqlarea px where s.status='ACTIVE' and s.TYPE!='BACKGROUND' and s.sql_address= x.address(+) and s.PREV_SQL_ADDR= px.address(+)