V$SQLAREA contains resource-usage information for all sql statements in the shared pool;
V$SQLAREA lists statistics on shared SQL area and contains one row per SQL string. It provides statistics on SQL statements that are in memory, parsed, and ready for execution.
V$SQL lists statistics on shared SQL area 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.
验证:
同义词
select * from dba_synonyms t where t.synonym_name in('V$SQL','V$SQLAREA')
1 PUBLIC V$SQLAREA SYS V_$SQLAREA
2 PUBLIC V$SQL SYS V_$SQL
。。。。。。。。。。。。。。与同义词无关。。
查看动态性能视图的定义
SELECT view_definition
FROM v$fixed_view_definition
WHERE view_name in('V$SQL','V$SQLAREA');
结果是数据分别源于GV$SQL GV$SQLAREA[全局动态性能视图。。在rac中有应用。]
挖下去。。。。。。。。。
SELECT view_definition
FROM v$fixed_view_definition
WHERE view_name in('GV$SQL','GV$SQLAREA');
gv$sqlarea -->from x$kglcursor_child_sqlid where kglobt02 != 0 v$sqlarea 源于 x$kglcursor_child_sqlid
gv$sql --> from x$kglcursor_child v$sql 源于 x$kglcursor_child
查看执行计划也可以验证它们的来源。。
现在看来它们没有多大的差异 你V$SQLAREA 存在相同语句不同version的问题。。而version是怎么定义的呢??
V$SQLAREA 和V$SQL定义又是怎么理解。