Advertisement
Advertisement


Find out the history of SQL queries


Question

An update SQL query was executed on the server, which caused many problems later.

How can I get the list of update queries executed in last 2 months, so that I can trace the exact problematic SQL query?

2018/10/18
1
54
10/18/2018 4:43:19 PM


For recent SQL:

select * from v$sql

For history:

select * from dba_hist_sqltext
2014/10/13

You can use this sql statement to get the history for any date:

SELECT * FROM V$SQL V where  to_date(v.FIRST_LOAD_TIME,'YYYY-MM-DD hh24:mi:ss') > sysdate - 60
2018/10/18