Is there a backend table like plan_table?

50 Views Asked by At

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.

1

There are 1 best solutions below

1
On

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.