Home » SQL & PL/SQL » SQL & PL/SQL » to find out sql statement executed on server
to find out sql statement executed on server [message #242085] Thu, 31 May 2007 09:56 Go to next message
amit_nanote
Messages: 56
Registered: July 2005
Location: Indore
Member

Hi,
I would like to know that how can I find the list of the sql statement executed on server instance by a particular user.
Till from the start of the instance over a period of time.
I would like to trace a update command issued by some user session, if possible.

Database using Oracle 10g.

regards
Amit Nanote
Re: to find out sql statement executed on server [message #242087 is a reply to message #242085] Thu, 31 May 2007 10:00 Go to previous messageGo to next message
Michel Cadot
Messages: 68733
Registered: March 2007
Location: Saint-Maur, France, https...
Senior Member
Account Moderator
The only way is to use Log Miner.

Regards
Michel
Re: to find out sql statement executed on server [message #242089 is a reply to message #242087] Thu, 31 May 2007 10:08 Go to previous messageGo to next message
ThomasG
Messages: 3212
Registered: April 2005
Location: Heilbronn, Germany
Senior Member
If you know that you want to trace the SQL statements of a session before they are actually executed, you can switch on sql trace for that session and analyze the resulting trace file with tkprof

http://www.oracleutilities.com/OSUtil/tkprof.html
Re: to find out sql statement executed on server [message #242181 is a reply to message #242089] Thu, 31 May 2007 23:36 Go to previous messageGo to next message
adil_akbar
Messages: 8
Registered: May 2007
Location: Pakistan
Junior Member
yes you can see what a user currently executing SQL statement by joining two tables:
1. V$Session
2. V$SQL

combine them on hashvalue.

Adil
Re: to find out sql statement executed on server [message #242186 is a reply to message #242181] Thu, 31 May 2007 23:53 Go to previous message
Michel Cadot
Messages: 68733
Registered: March 2007
Location: Saint-Maur, France, https...
Senior Member
Account Moderator
Maybe but this is the question.

Regards
Michel
Previous Topic: select privilege problems
Next Topic: Using sql type with cursor in plsql block
Goto Forum:
  


Current Time: Thu Feb 06 14:37:40 CST 2025