各種TOP SQL
轉自ITPUB
Top 10 by Buffer Gets:
set linesize 100
set pagesize 100
SELECT * FROM
(SELECT substr(sql_text,1,40) sql,
buffer_gets, executions, buffer_gets/executions "Gets/Exec",
hash_value,address
FROM V$SQLAREA
WHERE buffer_gets > 10000
ORDER BY buffer_gets DESC)
WHERE rownum <= 10
;
Top 10 by Physical Reads:
set linesize 100
set pagesize 100
SELECT * FROM
(SELECT substr(sql_text,1,40) sql,
disk_reads, executions, disk_reads/executions "Reads/Exec",
hash_value,address
FROM V$SQLAREA
WHERE disk_reads > 1000
ORDER BY disk_reads DESC)
WHERE rownum <= 10
;
Top 10 by Executions:
set linesize 100
set pagesize 100
SELECT * FROM
(SELECT substr(sql_text,1,40) sql,
executions, rows_processed, rows_processed/executions "Rows/Exec",
hash_value,address
FROM V$SQLAREA
WHERE executions > 100
ORDER BY executions DESC)
WHERE rownum <= 10
;
Top 10 by Parse Calls:
set linesize 100
set pagesize 100
SELECT * FROM
(SELECT substr(sql_text,1,40) sql,
parse_calls, executions, hash_value,address
FROM V$SQLAREA
WHERE parse_calls > 1000
ORDER BY parse_calls DESC)
WHERE rownum <= 10
;
Top 10 by Sharable Memory:
set linesize 100
set pagesize 100
SELECT * FROM
(SELECT substr(sql_text,1,40) sql,
sharable_mem, executions, hash_value,address
FROM V$SQLAREA
WHERE sharable_mem > 1048576
ORDER BY sharable_mem DESC)
WHERE rownum <= 10
;
Top 10 by Version Count:
set linesize 100
set pagesize 100
SELECT * FROM
(SELECT substr(sql_text,1,40) sql,
version_count, executions, hash_value,address
FROM V$SQLAREA
WHERE version_count > 20
ORDER BY version_count DESC)
WHERE rownum <= 10
;
其實可以看出TOP SQL 全部來自V$sqlarea。
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/7728585/viewspace-545398/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- 圖解 SQL 裡的各種 JOIN圖解SQL
- SQL Server各種日期計算方法SQLServer
- 一張圖看懂 SQL 的各種 join 用法SQL
- 關於SQL Server tempdb 的各種操作SQLServer
- SQL優化--用各種hints優化一條SQLSQL優化
- [資料庫][SQL]圖解各種連線join資料庫SQL圖解
- sql優化講課中引出的各種問題!SQL優化
- ORACLE TOP SQLOracleSQL
- Top 20 SqlSQL
- SQL語句中不同的連線JOIN及SQL中join的各種用法SQL
- 各種加速
- sql統計各種奇葩的資料庫表資料SQL資料庫
- [Oracle Script] Top sqlOracleSQL
- trace top sql sessionSQLSession
- SQL TOP 例項SQL
- 程式猿的年終總結,各種版本各種殘
- 各種協議協議
- stream流各種
- postgresql定位top cpu sqlSQL
- AWR TOP SQL實現SQL
- Oracle檢視TOP SQLOracleSQL
- Oracle TOP SQL&&HITOracleSQL
- Oracle AWR Top SQL sectionOracleSQL
- TOP N 查詢 SQLSQL
- top sql capture script.SQLAPT
- awr的top sql分析SQL
- 【SQL】18 SQL NULL 函式、SQL 通用資料型別、SQL 用於各種資料庫的資料型別SQLNull函式資料型別資料庫
- SQL稽核 | 如何快速使用 SQLE 稽核各種型別的資料庫SQL型別資料庫
- 各種線上jquery引用jQuery
- Linux查各種Linux
- iOS各種支付大全iOS
- Linux各種版本Linux
- JAVA的各種OJava
- Linux各種命令Linux
- Nginx的各種配置Nginx
- MySQL的各種joinMySql
- 各種排序的原理排序
- Oracle 的各種表Oracle