DBAsupport.com Forums - Powered by vBulletin
Results 1 to 8 of 8

Thread: How to capture activities for a specific session

  1. #1
    Join Date
    Nov 2000
    Posts
    51
    Hi all,

    I want to capture the activities for a particular session, not only the current activitiy but also the history. Please help. Thanks

  2. #2
    Join Date
    Nov 2000
    Posts
    51
    The database is Oracle7.3.4 on Solaris2.6 box.

  3. #3
    Join Date
    Feb 2000
    Location
    Washington DC
    Posts
    1,843

  4. #4
    Join Date
    Nov 2000
    Posts
    51
    Thanks sreddy. Is there any other way except using TKPROF? Is there any v$ views I can use to capture all the sql statements for that session?

  5. #5
    Join Date
    Jul 2002
    Posts
    6

    TKPROF is best

    While there are a number of views (e.g. V$SESSION, V$SESSTAT, etc.) that hold stats for a SID, sreddy is right; the best is TKPROF. Not that hard once you've done it a few dozen times. Also, you need to know ahead of time that you will want to trace a particular session.

    Also, the new OEM 9i has some great GUI tools to let you track just about everything a particular sesssion is doing, including stuff it's waiting for, its I/O, the SQL history, explain plan for any SQL, etc.

    Pretty powerfull stuff. I have it running routinely on my production DBs.
    vaidis
    Senior Oracle DBA

  6. #6
    Join Date
    Feb 2001
    Posts
    290
    You can find SQL_ADDRESS and SQL_HASH_VALUE in v$session and map these column values for a perticular session to the columns ADDRESS, HASH_VALUE in v$SQLAREA / v$SQL_TEXT_WITH_NEWLINES..

    This will get you the query run by a perticular session...

    Madhu Reddy
    xdollor@yahoo.com

  7. #7
    Join Date
    Feb 2000
    Location
    Washington DC
    Posts
    1,843
    Originally posted by lwangf
    Hi all,

    I want to capture the activities for a particular session, not only the current activitiy but also the history. Please help. Thanks
    USE TKPROF/V$ views (V$SQL, V$SQL_TEXT, V$OPEN_CURSORS,V$SQL_AREA to get the SQL satements for current activity and Use logminer for history. I think its staight forward and pretty easier to use TKPROF than building your own customized queries/reports from these views specific to a session.
    Reddy,Sam

  8. #8
    Join Date
    Nov 2000
    Posts
    51
    Thanks for all your help. I will use tkprof to gether the info.

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