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?
Using a modern editor with "find in files" features will let you search your SQL history. You could even get fancy and scrape your files into a SQLite3 database to query your queries. Show activity on this post.
Toad saves all the work that was done in any of the editor windows. ALT+Up Arrow and Alt+Down Arrow walk through this storage area. Choose View → SQL Recall or press F8 (see Figure 3.26) to open the interface shown in Figure 3.27. Notice that the SQL Recall panel shows up as an autohide panel on the left side of Toad.
The query history shows SQL queries performed using SQL warehouses. You can use the information available through this screen to help you debug issues with queries. This section describes how to work with query history using the UI. To work with query history using the API, see Query History API 2.0.
select v.SQL_TEXT, v.PARSING_SCHEMA_NAME, v.FIRST_LOAD_TIME, v.DISK_READS, v.ROWS_PROCESSED, v.ELAPSED_TIME, v.service from v$sql v where to_date(v.FIRST_LOAD_TIME,'YYYY-MM-DD hh24:mi:ss')>ADD_MONTHS(trunc(sysdate,'MM'),-2)
where
clause is optional. You can sort the results according to FIRST_LOAD_TIME and find the records up to 2 months ago.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With