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

Thread: Tuning

  1. #1
    Join Date
    Oct 2001
    Posts
    127
    Is there any query from which i can find out the queries fired by particulars user and the time taken for those queries.
    Thanks

  2. #2
    Join Date
    Oct 2001
    Location
    Madrid, Spain
    Posts
    763
    With this query you can show the sql's in execution:

    SELECT A.SID,A.USERNAME,S.SQL_TEXT
    FROM V$SESSION A,V$SQLTEXT S
    WHERE A.SQL_ADDRESS = S.ADDRESS
    AND A.SQL_HASH_VALUE = S.HASH_VALUE
    ORDER BY A.USERNAME,A.SID,S.PIECE;

    But the time ...

    Hope that helps

    Angel

  3. #3
    Join Date
    Jun 2000
    Location
    Madrid, Spain
    Posts
    7,447
    you could roughly find the time in v$session_longops if the query takes more than 6 seconds, I say roughly because if your query has several operations then you would have to sum them up in v$session_longops

    other option is sql*plus set timing on and run the query

    other option is sql_trace the session if you want to do it remotely

    other option is use dbms_utility.GET_TIME, execute it before your query and store the result in a variable, then execute again at end of your query and substract the variable you would get the execution time (probably differs by some milliseconds)

    may be there are more options but right now I can think of these 4 only

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