Whats the difference between the v$sql* views
What is the diff between:
v$sql
v$sqlarea
v$sqltext
v$sqltext_with_newlines
when I query v$sql joining with v$session and filter by a SID I get more than
one SQL (expected) but if I join v$sqltext with v$session with same conditions I
get one sql statement only (last SQL issued) why is this?
Thanks
Alan
v$sql the details -- if you have multiple copies of the query:[@more@]
"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.
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/18921899/viewspace-1017125/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- What is the difference between <%, <%=, <%# and -%> in ERB in Rails?AI
- Some difference between mysql & oracleMySqlOracle
- Difference between business area and profit center
- What is the difference between gross sales and revenue?ROS
- The difference between literal and label.
- What is the difference between a Homemaker and a Housewife?
- Difference between prop and attr in different version of jqueryjQuery
- What is the difference between restoring and recoveringREST
- What is the difference between application server and web server?APPServerWeb
- Difference between sap_all and sap_new
- The main difference between Java & C++(轉載)AIJavaC++
- 【Oracle】-Difference between Instance recovery and Crash RecoveryOracle
- SAP Difference between Credit memo and subsequent debits/credits
- Difference Between Arraylist And Vector : Core Java Interview Collection QuestionJavaView
- 8.1.1 V$ ViewsView
- Difference between Microsoft Dynamics 365 WEB API, Organization Service and Organization Data ServicROSWebAPI
- Python中print用法及The difference between Python 2 and 3Python
- Difference between 2>&-, 2>/dev/null, |&, &>/dev/null, >/dev/null, 2>&1devNull
- Find and Fix the Mismatch Between DBA_SEGMENTS and DBA_EXTENTS ViewsView
- Oracle's V$ Views(轉)OracleView
- Oracle 10G V$ViewsOracle 10gView
- sql語句 between-andSQL
- The SQL vs NoSQL Difference: MySQL vs MongoDBMySqlMongoDB
- For v$ views you need to grant privilege to each v_$ directlyView
- What is the difference between Mysql InnoDB B+ tree index and hash index? Why does MongoDB use B-tree?MySqlIndexMongoDB
- 【SQL】17 SQL 檢視(Views)、SQL Date 函式、SQL NULL 值、SQLView函式Null
- Compilation of Views and PL/SQL Program Units (242)ViewSQL
- 【Oracle SQL】months_between與trunc函式OracleSQL函式
- note of Beginning Oracle SQL-Oracle Data Dictionary ViewsOracleSQLView
- V$SQL、V$SQLSTATS、V$SQLAREASQL
- V$sql_text v$sqlarea v$sql 的區別SQL
- DML ViewsView
- v$sql v$sqlarea v$sql_shared_cursor及遊標SQL
- sql執行計劃_v$sqlarea_v$sql_v$sql_shared_cursorSQL
- v$sql,v$sqlarea,v$sqltext區別SQL
- 8.1.2 GV$ ViewsView
- Parallel query & viewsParallelView
- External Views (33)View