1
  1. How to find out when a query was executed? I ran a query couple of days ago, I'm not sure about the exact time. I want to know at what date and time the query was executed. Is it possible to get that information?

  2. How to check the server status when a query is running? What information should be checked?

version -oracle 11g

2
  • if you know the sql_id of sql AND server is not bounced, then you can check in v$sqlstats (last_active_time might be useful). for server status, if you have OEM, use it, else you can resort to scripts. What to monitor depends on what do you want to monitor.
    – Raj
    Sep 11, 2014 at 18:36
  • 1
    Are you licensed to use the AWR? Is it reasonable to expect that the query that was executed was one of the top resource consumers in the window during which it was executed? How long (roughly) did the query take to run? Feb 17, 2015 at 3:05

1 Answer 1

1
select LAST_LOAD_TIME, LAST_ACTIVE_TIME 
from v$sql
where sql_id = Your SQL ID

Hope this will give you the expected result

1
  • 1
    If a query was last executed a couple of days ago, it's pretty unlikely that it is going to still be present in v$sql. Not impossible, but I certainly wouldn't bet on it. Feb 17, 2015 at 3:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.