v$sql*几个试图的区别

摘自asktom~[@more@]

v$sql the details -- if you have multiple copies of the query:

"select * from T" in your shared pool, v$sql will have a row per query.

This can happen if user U1 and user U2 both have a table T and both issue "select * from T".

Those are entirely different queries with different plans and so on.

v$sql will have 2 rows.

v$sqlarea is a aggregate of v$sql. It selects out DISTINCT sql. "select * from T" will appear there.

It is not clear to me how you are joing v$session to v$sql to get more then one row.

If you wish to see the queries a session has open (maybe open, we cache
cursors so you might see some queries that are closed) use v$open_cursor by sid.

v$sqltext is simply a way to see the entire query. the v$sql and v$sqlarea
views only show the first 1000 bytes. newlines and other control characters are replace with whitespace.

v$sqltext_with_newlines is v$sqltext without the whitespace replacment.

V$SQL

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

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$SQLTEXT

This view contains the text of SQL statements belonging to shared SQL cursors in the SGA.

V$SQL_PLAN

V$SQL_PLAN contains the execution plan information for each child cursor loaded in the library cache.

V$SQLTEXT_WITH_NEWLINES

This view is identical to the V$SQLTEXT view except that, to improve legibility, V$SQLTEXT_WITH_NEWLINES does not replace newlines and tabs in the SQL statement with spaces.

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/7794469/viewspace-886382/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/7794469/viewspace-886382/

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值