explanations of v$sql,v$sqlarea,v$sqltext,v$sqltext_with_newlines

jlandzpa 2002-12-26 03:12:29
due to Tom.

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.
...全文
139 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
llm06 2002-12-26
  • 打赏
  • 举报
回复
thanks
esunny 2002-12-26
  • 打赏
  • 举报
回复
use out join.
biti_rainy 2002-12-26
  • 打赏
  • 举报
回复
:)

17,078

社区成员

发帖
与我相关
我的任务
社区描述
Oracle开发相关技术讨论
社区管理员
  • 开发
  • Lucifer三思而后行
  • 卖水果的net
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧