Monitor Current SQL Running(10g)
如下是Oracle10g Monitor Current SQL Running Script:
select vs.LAST_CALL_ET elapsed_time,vs.SID,vs.SERIAL#,vp.SPID,vs.USERNAME,vs.OSUSER,vs.MACHINE,
vs.EVENT,vs.PROGRAM,vs.MODULE,vs.SQL_ID,vsql.SQL_TEXT,vsql.SQL_FULLTEXT,vs.SCHEMANAME,vs.STATUS,vsql.EXECUTIONS,
(select value from v$sesstat where sid=vs.SID and statistic#=10 and rownum=1) "logical reads", --session logical reads
(select value from v$sesstat where sid=vs.SID and statistic#=59 and rownum=1) "physical reads", --physical reads
(select value from v$sesstat where sid=vs.SID and statistic#=64 and rownum=1) "block changes", --db block changes
(select value from v$sesstat where sid=vs.SID and statistic#=3 and rownum=1) "opened cursors current", --opened cursors current
(select value from v$sesstat where sid=vs.SID and statistic#=26 and rownum=1) "session pga memory", --session pga memory
vsql.COMMAND_TYPE,vsql.PLAN_HASH_VALUE,vs.ACTION,vs.LOGON_TIME,vs.TYPE,vs.SQL_HASH_VALUE,
vs.SADDR,vs.P1,vs.P2,vs.P3
from v$session vs,v$sqlarea vsql,v$process vp
where vs.SQL_ID=vsql.SQL_ID and vs.PADDR=vp.ADDR and vs.status='ACTIVE' order by 1 desc
select vs.LAST_CALL_ET elapsed_time,vs.SID,vs.SERIAL#,vp.SPID,vs.USERNAME,vs.OSUSER,vs.MACHINE,
vs.EVENT,vs.PROGRAM,vs.MODULE,vs.SQL_ID,vsql.SQL_TEXT,vsql.SQL_FULLTEXT,vs.SCHEMANAME,vs.STATUS,vsql.EXECUTIONS,
(select value from v$sesstat where sid=vs.SID and statistic#=10 and rownum=1) "logical reads", --session logical reads
(select value from v$sesstat where sid=vs.SID and statistic#=59 and rownum=1) "physical reads", --physical reads
(select value from v$sesstat where sid=vs.SID and statistic#=64 and rownum=1) "block changes", --db block changes
(select value from v$sesstat where sid=vs.SID and statistic#=3 and rownum=1) "opened cursors current", --opened cursors current
(select value from v$sesstat where sid=vs.SID and statistic#=26 and rownum=1) "session pga memory", --session pga memory
vsql.COMMAND_TYPE,vsql.PLAN_HASH_VALUE,vs.ACTION,vs.LOGON_TIME,vs.TYPE,vs.SQL_HASH_VALUE,
vs.SADDR,vs.P1,vs.P2,vs.P3
from v$session vs,v$sqlarea vsql,v$process vp
where vs.SQL_ID=vsql.SQL_ID and vs.PADDR=vp.ADDR and vs.status='ACTIVE' order by 1 desc
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/24237320/viewspace-1982598/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- 1.Monitor Current SQL Running(10g)SQL
- 【SQL】Oracle SQL monitorSQLOracle
- Monitor RDBMS Session UGA and PGA Current And Maximum Usage Over TimeSession
- Procedure PqStat to monitor Current PX Queries (Doc ID 240762.1)
- [pl sql] where current ofSQL
- Oracle Real Time SQL MonitorOracleSQL
- sql monitor的使用(一)SQL
- 11g新動態效能檢視V$SQL_MONITOR,V$SQL_PLAN_MONITORSQL
- DBMS_MONITOR使用 (In 10g, 11g and Above)
- SQL Monitor Report 使用詳解SQL
- Oracle SQL調優系列之SQL Monitor ReportOracleSQL
- 使用sql monitor獲取更加詳細的執行計劃 - dbms_sqltune.report_sql_monitorSQL
- plsql developer工具生成sql monitor reportSQLDeveloper
- 生成sql monitor active report指令碼SQL指令碼
- Monitor All SQL Queries in MySQL (alias mysql profiler)MySql
- mysql的三個sql的monitor選項MySql
- SQL Monitor,你值得掌握的一個特性SQL
- Oracle11g使用sql_monitor實時監控sqlOracleSQL
- Slave_SQL_Running:Nomysql同步故障解決方法MySql
- Statement Tracer For Oracle 與 SQL Monitor 的比較OracleSQL
- 掌握SQL Monitor這些特性,SQL最佳化將如有神助!SQL
- Running Workload Repository Reports Using SQL ScriptsSQL
- Tracing Enhancements Using DBMS_MONITOR (In 10g, 11g and Above)_293661.1
- pl/sql原始碼掃描sql(10g)SQL原始碼
- 【MySql】複製出現Slave_SQL_Running: No 錯誤解決MySql
- Table Monitor
- sql monitor中timestamp變數轉換可識別格式SQL變數
- 日常監測分析資料庫的DBA_Monitor.sql程式資料庫SQL
- makes the current sessionSession
- 【Mysql】Slave_SQL_Running: No:Last_Error: Error :1032/1062MySqlASTError
- Oracle 10g glogin.sqlOracle 10gSQL
- [PL/SQL]10g PL/SQL學習筆記(一)SQL筆記
- [PL/SQL]10g PL/SQL學習筆記(二)SQL筆記
- [PL/SQL]10g PL/SQL學習筆記(三)SQL筆記
- gc current block pin time gc current block flush time 疑惑GCBloC
- mysql CURRENT_TIMESTAMP 和ON UPDATE CURRENT_TIMESTAMPMySql
- oracle之 v$sql_monitor 監視正在執行的SQL語句的統計資訊OracleSQL
- MySQL案例01:Last_SQL_Errno: 1755 Cannot execute the current event group in the parallel modeMySqlASTParallel