1

Is there a backend table like plan_table where we can see the output of autotrace, similar to explain plan output? Like if I am running a long query with autotrace and by chance, the session gets logged off while reading the autotrace output and I want to see again the autotrace output without running the long query.

general46
  • 800
  • 6
  • 16

1 Answers1

1

No, what we do is we check the before and after session stats coming out of v$sesstat.

Options:

  1. Check V$SQLSTATS which contains some metrics for sql execution. This also gives the SQL_ID for this query, which leads to

  2. You might be able to glean some information from v$active_session_history if you are licensed for it using the SQL_ID

  3. You can run a SQL Monitoring report (see DBMS_SQLTUNE) with the SQL_ID you got from (1). This information lingers for a while in memory.

Connor McDonald
  • 10,418
  • 1
  • 11
  • 16
  • when using the AutoTrace in SQL Developer (if you observe the Statements log panel), you can see us querying v$ stats views for data before and after running your query... – thatjeffsmith Dec 18 '20 at 15:00