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

Home -> Community -> Mailing Lists -> Oracle-L -> Re: How to find out the last executed sql statement....

Re: How to find out the last executed sql statement....

From: Syed Jaffar Hussain <sjaffarhussain_at_gmail.com>
Date: Tue, 12 Jun 2007 16:52:18 +0300
Message-ID: <97b7fd2f0706120652u7b729610y68cd9864b50e3168@mail.gmail.com>


Hey,

You didn't tell the Oracle version which you are using. However, in 10gR2, I guess the following can help you:

select sql_fulltext,last_active_time from v$sqlstats where last_active_time =
(select max(last_active_time) from v$sqlstats)

On 6/12/07, Krishnadas.Chathamath_at_iflexsolutions.com < Krishnadas.Chathamath_at_iflexsolutions.com> wrote:
>
> Hi,
>
>
>
> I am a new member of oracle-l and I am finding it very helpful.
>
>
>
> We are trying to make our Application debug easier.
>
> Currently we write debug messages to a file using utl_file package during
> the application's execution.
>
> So we can find out till the position where the application runs
> successfully and where it fails and why it fails (error messages) by looking
> into the debug file.
>
>
>
> Now we are thinking to modify the application debug as follows,
>
>
>
> Once the functionality fails we will insert the Session id, Package name
> and last executed sql (Failed SQL statement or Last successful statement) in
> a table and from there the developers can get the details. So we need not
> looking into the debug file at the initial stage.
>
>
>
> But how to get the last executed sql statement?
>
>
>
> Please help us with your valuable suggestions.
>
>
>
> Thanks & Regards
>
> Krishnadas C.K
>
>
>
>
>

-- 
Best Regards,
Syed Jaffar Hussain
Oracle ACE
8i,9i & 10g OCP DBA

http://jaffardba.blogspot.com/
http://www.oracle.com/technology/community/oracle_ace/ace1.html#hussain
----------------------------------------------------------------------------------
"Winners don't do different things. They do things differently."

--
http://www.freelists.org/webpage/oracle-l
Received on Tue Jun 12 2007 - 08:52:18 CDT

Original text of this message

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