Fixed Views definition and difference

There are several fixed views to retrieve SQL-related information from different perspectives. As always, multiple tools brings benefits as well as confusions. Here is an excerpt from Oracle doc regarding general explanation of them.

V$SQL lists statistics on shared SQL areas without the GROUP BY clause and contains one row for each child of the original SQL text entered. Statistics displayed in V$SQL are normally updated at the end of query execution. However, for long running queries, they are updated every 5 seconds. This makes it easy to see the impact of long running SQL statements while they are still in progress.

Base Table: x$kglcursor_child

V$SQLAREA displays statistics on shared SQL areas and contains one row per SQL string. It provides statistics on SQL statements that are in memory, parsed, and ready for execution.

Base Table: x$kglcursor_child_sqlid

V$SQL_SHARED_CURSOR explains why a particular child cursor is not shared with existing child cursors. Each column identifies a specific reason why the cursor cannot be shared.

V$SQLSTATS displays basic performance statistics for SQL cursors and contains one row per SQL statement (that is, one row per unique value of SQL_ID). The column definitions for columns in V$SQLSTATS are identical to those in the V$SQL and V$SQLAREA views. However, the V$SQLSTATS view differs from V$SQL and V$SQLAREA in that it is faster, more scalable, and has a greater data retention (the statistics may still appear in this view, even after the cursor has been aged out of the shared pool). Note that V$SQLSTATS contains a subset of columns that appear in V$SQL and V$SQLAREA.

Base Table: x$kkssqlstat

V$SQLTEXT displays the text of SQL statements belonging to shared SQL cursors in the SGA.

Base Table: x$kglna

Reference:

Oracle Doc 11g

http://www.adp-gmbh.ch/ora/misc/x.html
Oracle’s x$ Tables

DBMS_SHARED_POOL.PURGE Does not Purge Details From v$sqltext (Doc ID 1939451.1)

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s