Re: Reverse engineer SQL_TEXT from SQL_ID?

From: John Hurley <>
Date: Tue, 23 Feb 2010 08:32:18 -0800 (PST)
Message-ID: <>

On Feb 23, 9:25 am, Steve Howard <> wrote:


> 64 bit Standard on SLES 10 two node RAC
> Hi All,
> Does anyone know if it is possible to reverse engineer the SQL_TEXT
> for a given SQL_ID?  We had large waits yesterday afternoon on 'enq:
> HW contention'.  I found the SQL_ID in DBA_HIST_ACTIVE_SESS_HISTORY
> that was being executed when the event was posted.  I also found the
> current_obj# for the sessions in the same view, but I don't know why
> it would be waiting on this event.  However, there is no SQL recorded
> in DBA_HIST_SQLTEXT, which makes me wonder if it was DDL.  However,
> there is nothing in DBA_OBJECTS with a DDL time in the last 24 hours.
> I would really like to look at the SQL if possible.  Is there any way
> to do this?

Just query against v$sqlarea for the sql_id? Received on Tue Feb 23 2010 - 10:32:18 CST

Original text of this message