I have a delete query which was run on a table in Oracle 11g Enterprise Edition about 2 months back. I need to find the exact time of when the query was executed.
I found the query in the DBA_HIST_SQLTEXT
view. But I do not see any date/time field in the table to find the exact time of execution. Is there any way that this can be found out?
I also tried to extract the same from AWR report. But snapshots are available only till 1.5 months back.
Best Answer
The typical retention period for an AWR report is 45 days. So unless, this period has been modified to 60 days (2 months) or more in your DB, the
DBA_HIST*
views will not have the information you are looking for. You can verify the retention period by querying theDBA_HIST_WR_CONTROL
view. In case the retention period has not been modified you can query theDBA_HIST_ACTIVE_SESS_HISTORY
view and get SQL_EXEC_START time for the SQL_ID for a given period.