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

Home -> Community -> Usenet -> c.d.o.misc -> Re: capture SQL

Re: capture SQL

From: Sybrand Bakker <postmaster_at_sybrandb.demon.nl>
Date: Fri, 16 Jul 1999 07:19:08 +0200
Message-ID: <932102319.2899.0.pluto.d4ee154e@news.demon.nl>


Hi Marina,

From a previous post by Tim Lange

If the session already exists, go to v$session and get the sid and the serial# of the session you are interested in. .
Then, using sqlplus, as "sys" unless you granted additional authority,

       execute dbms_system.set_sql_trace_in_session(sid, ser, TRUE);

when finished

       execute dbms_system.set_sql_trace_in_session(sid, ser, FALSE);

Then run tkprof on the resulting ".trc" file.

Tim

Of course if there are multiple sessions, you could also consider to enable trace for the complete database:
change sql_trace to true in init<sid>.ora, bounce the database and that's it.
Personally I would run utlbstat and utlestat first (in $ORACLE_HOME/rdbms/admin for Unix ports, %RDBMS<xx>%\admin for NT, where xx is the version number)

Hth,
Sybrand Bakker, Oracle DBA

<marina.daniels_at_cs.tas.gov.au> wrote in message news:7mmcos$4rf$1_at_nnrp1.deja.com...
> I have a 3rd party pc application and it communicates with Oracle 8.0.5
> on my unix box via the Oracle drivers. (The drivers on my pc are
> installed from version 7.3.3 oracle as the 3rd party application
> requires this :-(
>
> Does anybody know how I can capture the sql commands that are being sent
> from my pc to the unix box?
>
> The application is running slow and I want to run the sql command
> directly on the unix box to see if it runs faster there to see if the
> slowness is due to the way I have oracle configured, or whether there is
> some problem with the pc side of things.
>
> If anybody takes pity on me, could you please reply to:
> marina.daniels_at_cs.tas.gov.au
>
> Thanks
> Marina
>
>
> Sent via Deja.com http://www.deja.com/
> Share what you know. Learn what you don't.
Received on Fri Jul 16 1999 - 00:19:08 CDT

Original text of this message

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