Home » RDBMS Server » Server Administration » v$sql and v$sqlarea
v$sql and v$sqlarea [message #59956] Mon, 05 January 2004 23:23 Go to next message
Sam
Messages: 255
Registered: April 2000
Senior Member
why there is a diff when i select count(*) from v$sql and v$sqlarea and also pls let me know where can we use these views for tuning purposes.
thanx in advance
Re: v$sql and v$sqlarea [message #59960 is a reply to message #59956] Tue, 06 January 2004 01:31 Go to previous messageGo to next message
Frank Naude
Messages: 4580
Registered: April 1998
Senior Member
Hi,

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.

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.

SELECT COUNT( DISTINCT sql_id ) FROM v$sql;


... should return the same number of rows as

SELECT COUNT(*) FROM v$sqlarea;


Best regards.

Frank
Re: v$sql and v$sqlarea [message #59966 is a reply to message #59956] Tue, 06 January 2004 04:53 Go to previous message
Thiru
Messages: 1089
Registered: May 2002
Senior Member
In addition to what Frank said, queries on v$sql is usually faster than v$sqlarea becos v$sqlarea is constructed from a summary(lots of sum and group by) of all the statistics. Both of them are based on x$kglcursor.

-Thiru
Previous Topic: Why is there no Oracle9i Database 64-bit StandardEdition software for Solaris
Next Topic: Installing 8.0.5 on machine already having 9.0.2
Goto Forum:
  


Current Time: Fri Sep 20 10:33:36 CDT 2024