Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> Capturing Failed Sql

Capturing Failed Sql

From: Mercadante, Thomas F <thomas.mercadante_at_labor.state.ny.us>
Date: Fri, 18 Feb 2005 11:04:01 -0500
Message-ID: <C9995D8C5E0DDA4A8FF9D68EE666CE0702A9738A@exchsen0a1ma>


All,

Occasionally, I have a Cognos report that gets run and runs out of TEMP space (ORA-1652). I don't have the opportunity to talk to the person running the report, so I don't exactly know what query they are running.

I can put a trigger in the database to capture a "server error". But can I capture the offending sql? I tried looking into v$sql with:

    SELECT UPPER(program) program, username,

           osuser, terminal,v$sql.SQL_TEXT
      FROM v$SQL,V$SESSION
      WHERE AUDSID = USERENV('SESSIONID')
	    and v$SQL.ADDRESS = V$SESSION.SQL_ADDRESS;

But that only captures the above sql. How can I capture the exact sql that is failing? I do know the Oracle user that they are logging in under, so I could enable a 10053 trace for every session that they log on with. But that seems like the "shotgun" approach.

Thanks in advance.

Thomas Mercadante
Oracle Certified Professional

--
http://www.freelists.org/webpage/oracle-l
Received on Fri Feb 18 2005 - 11:25:49 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US