Link to home
Start Free TrialLog in
Avatar of superfly18
superfly18

asked on

Profiling an Oracle 9i DB

I was wondering how I can profile an Oracle 9i database so that I can see all SQL executed (output to a text file is fine) on the database by a user session (similar to the database profiler in SQL Server).    
ASKER CERTIFIED SOLUTION
Avatar of MikeOM_DBA
MikeOM_DBA
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of superfly18
superfly18

ASKER

How should it be used in these case?
Avatar of Naveen Kumar
you can also enable TRACE for that user or session to see what all is happening. The trace file generated will be a raw trace and you need to convert it to readable format by using tkprof utility.

For more details on the above, please refer to 12 chapter Using Oracle Trace in the below link

http://download-west.oracle.com/docs/cd/B10501_01/server.920/a96533/toc.htm

Thanks
Is this something that be run from SQLplus, and output to a dump file?  If so what would the syntax be?
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ALTER SESSION SET SQL_TRACE = TRUE;
 
-- you can do that with just a single statement but this has some performance overhead because a lot of data is written to the trace file on what all sql statements are being issued in the session.
And if I want to trace the session of another user?
if you want to know what is happening in a particular session or what are all the operatins done by a user without his knowledge, then either we have to enable sql trace at the init.ora level meaning a lot of trace files will be generated for each session/user and a lot of file system space is also required if you db is being used by many users/programs.

why don't you look at the below link to get an understadning of the log miner facility :

http://download-west.oracle.com/docs/cd/B10501_01/server.920/a96521/toc.htm 

search for "Using LogMiner to Analyze Redo ogs"