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/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- Oracle SQL調優系列之SQL Monitor ReportOracleSQL
- Oracle 效能調優工具:SQL MonitorOracleSQL
- plsql developer工具生成sql monitor reportSQLDeveloper
- 使用sql monitor獲取更加詳細的執行計劃 - dbms_sqltune.report_sql_monitorSQL
- mysql的三個sql的monitor選項MySql
- 【10g SQL新特性】q-quote使用SQL
- [20200326]dbms_monitor跟蹤與SQL語句分析.txtSQL
- [20181029]避免表示式在sql語句中(10g).txtSQL
- 1002 Running Median
- MySQL案例01:Last_SQL_Errno: 1755 Cannot execute the current event group in the parallel modeMySqlASTParallel
- [20181030]避免表示式在sql語句中(10g)(補充).txtSQL
- 2788647047_monitor
- 9i and 10g 透過SQL_ADDRESS 或sql_id查詢執行計劃SQL
- 7.71 CURRENT_TIMESTAMP
- 7.70 CURRENT_DATE
- Postman的Monitor功能Postman
- Verilog 監控 Monitor
- Azure Monitor(二)Log Analytics
- running-a-command-prompt-as-nt-authoritysystem
- Running Man-奔跑吧,勇士
- Laravel: Up and Running (1):介紹Laravel
- Avoided redundant navigation to current location: "/users"IDENavigation
- MySQL中的CURRENT_TIMESTAMPMySql
- ON UPDATE CURRENT_TIMESTAMP請慎用
- synchronized的monitor監視器synchronized
- 10g RAC on AIXAI
- skipped: maximum number of running instances reached (1)
- Error running ‘Application’Command line is too longErrorAPP
- 榮耀手環4 Running版評測 榮耀手環4 Running版值得買嗎?
- AUTHID CURRENT_USER的注意點
- Vue, Avoided redundant navigation to current location: "/login".VueIDENavigation
- gc current/cr block busy等待事件GCBloC事件
- 解決gc current request等待事件GC事件
- 10G DG SWITCH OVER
- oracle 10g flashback databaseOracle 10gDatabase
- 【Mongo】使用killOp幹掉Long Running OperationGo
- ERROR 1290 (HY000): The MySQL server is running withErrorMySqlServer
- zabbix-server is not running 報錯解決Server
- Git之提示There is no tracking information for the current branch.GitORM