您好,登錄后才能下訂單哦!
這里做個筆記,純屬是加深印象:
V$SQL lists statistics on shared SQL areas without the GROUP BY clause and contains one row for each child of the original SQL text entered. Statistics displayed in V$SQL are normally updated at the end of query execution. However, for long running queries, they are updated every 5 seconds. This makes it easy to see the impact of long running SQL statements while they are still in progress.
明顯v$sql的信息來源于共享內存區shared SQL areas,也就是說相關SQL信息在數據庫重啟,數據庫緩存被刷,或相關SQL信息被踢出緩存區,此SQL的信息就不能在V$SQL里查詢。而V$SQL記錄每一個SQL的每一個子游標的信息。
V$SQLAREA displays statistics on shared SQL areas and contains one row per SQL string. It provides statistics on SQL statements that are in memory, parsed, and ready for execution.
同樣v$sqlarea也存儲于library cache,然而這個視圖卻做了一個統計分析,統計的方式是以sql string分組,也就是以sql_text文本做了group by,在此前提下對其他信息統計sum()。通過version_count可以得出SQL子游標的總數。所以簡單的說:v$sqlarea存放的是相同SQL語句不同version一個匯總。
version_count:Number of child cursors that are present in the cache under this parent
excutions : Total number of executions, totalled over all the child cursors
V$SQLTEXT displays the text of SQL statements belonging to shared SQL cursors in the SGA.
v$sql及v$sqlarea存放的更多的是性能數據,但其sql_text是不完整的的,如果想獲得完整的sql就要用v$sqltext。
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。