Skip to Main Content

Oracle Database Discussions

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Difference between V$SQLAREA and V$SQL

MaxSep 29 2017 — edited Sep 29 2017

DB version: 11.2.0.4

OS : RHEL 6.7

I would like to know the difference between V$SQLAREA and V$SQL. Below is what 11.2 doc says

V$SQLAREA lists statistics on shared SQL area and contains one row per SQL string

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

For a particular SQL_ID , I have run the following 3 queries in a 3-node RAC DB. Both gv$sqlarea and gv$sql returned 3 rows.

So, I would like to know the difference between V$SQLAREA and V$SQL.

select * from gv$sqlarea where sql_id = 'awhmxunsm7xbx'

--returns 3 rows ( For instance 1,2 and 3)

select * from gv$sql where sql_id = 'awhmxunsm7xbx'

--returns 3 rows ( For instance 1,2 and 3)

--- Below query returned 35 rows. Output snipped for readability

select inst_id, sid, serial# from gv$session where sql_id = 'awhmxunsm7xbx'

order by inst_id;

   INST_ID        SID    SERIAL#

---------- ---------- ----------

         1       6855      26937

         1       4483      13493

         1       4477       7165

         1       4189      21071

         1       4005      32821

         .

         .

         .

         3       6285       6893

         3       6664      10779

         3       2676       2983

35 rows selected.

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 27 2017
Added on Sep 29 2017
2 comments
5,588 views