檢視正在執行的SQL

壹頁書發表於2014-06-11
MySQL show processlist命令感覺非常的直觀。

Oracle的show processlist
  1. set linesize 400;
  2. set pagesize 400;
  3. col sql_text format a100;
  4. col machine format a25;
  5. col username format a15;
  6. SELECT a.username,a.machine, b.sql_id, b.SQL_TEXT
  7. FROM v$session a, v$sqlarea b
  8. WHERE a.sql_address = b.address
  9.     AND a.SQL_HASH_VALUE = b.HASH_VALUE;
Oracle show full processlist
  1. set linesize 400;
  2. set pagesize 400;
  3. set long 4000;
  4. col SQL_FULLTEXT format a100;
  5. col machine format a25;
  6. col username format a15;
  7. SELECT a.username,a.machine, b.sql_id, b.SQL_FULLTEXT
  8. FROM v$session a, v$sqlarea b
  9. WHERE a.sql_address = b.address
  10.     AND a.SQL_HASH_VALUE = b.HASH_VALUE;


來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/29254281/viewspace-1180441/,如需轉載,請註明出處,否則將追究法律責任。

相關文章