Is there any query from which i can find out the queries fired by particulars user and the time taken for those queries.
Thanks
Printable View
Is there any query from which i can find out the queries fired by particulars user and the time taken for those queries.
Thanks
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
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