Trace SQL
DBAsupport.com Forums - Powered by vBulletin
Results 1 to 2 of 2

Thread: Trace SQL

  1. #1
    Join Date
    Sep 2003
    Location
    China
    Posts
    72

    Trace SQL

    How can a DBA trace what SQL is running by using PID from Solaris? Means from the PID I want to know what SQL is being executing. Thanks.

  2. #2
    Join Date
    Nov 2000
    Location
    Birmingham, UK
    Posts
    360
    Find the parent process number of the oracle conenction e.g.
    oracle 203 25640 0 09:15:09 pts/4 0:00 grep 25640
    oracle 26764 25640 0 09:14:08 ? 0:01 oraclecasht32 (DESCRIPTION=(LOCA)
    oracle 25640 13542 0 09:13:54 pts/4 0:00 sqlplus

    In this case it'll be 25640 (the sqlplus program)

    select sid, serial# from v$session where process=25640;

    exec dbms_system.set_sql_trace_in_session(sid,serial#,true) to trace that session.

    Trace files are written to user_dump_dest (make sure max)dump_file_size is set appropriatley)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Click Here to Expand Forum to Full Width