query to find out the sessions trying to create table.
591183Nov 30 2007 — edited Nov 30 2007Hi Folks,
I wanted to know the sessions that are trying to create tables. I'm trying to use the query... but not getting the correct results...
These are the three versions of queries i wrote..
SELECT A.SID,A.USERNAME,A.SQL_ID,B.SQL_TEXT FROM V$SESSION A,V$SQLTEXT B
WHERE A.STATUS='ACTIVE'
AND A.SQL_ID=B.SQL_ID
AND B.SQL_TEXT LIKE '%INSERT%' OR B.SQL_TEXT LIKE '%insert%'
SELECT A.SID,A.USERNAME,A.SQL_ID,B.SQL_TEXT FROM V$SESSION A,V$SQLTEXT B
WHERE A.SID IN (SELECT SID FROM V$SESSION WHERE STATUS='ACTIVE')
AND A.SQL_ID=B.SQL_ID
AND B.SQL_TEXT LIKE '%INSERT%' OR B.SQL_TEXT LIKE '%insert%'
select sid, serial#, status, username, osuser,machine,sql_id from v$session
where sql_id in (select sql_id from v$sqltext where SQL_TEXT like '%INSERT%'
union
select sql_id from v$sqltext where SQL_TEXT like '%insert%')
But its not giving me the correct results. Can any one help me with a query to determine a way to catch the sessions trying to create tables.
Thanks
Karthik