SQL調整
--下面是查找Oracle那句SQL語法執行比較慢
SELECT * FROM
(
SELECT PARSING_USER_ID
EXECUTIONS,
SORTS,
COMMAND_TYPE,
DISK_READS,
sql_text
FROM v$sqlarea
ORDER BY disk_reads DESC
)
WHERE ROWNUM<10 ;
--下面是查找那句SQL語法執行時佔CPU比較高
SELECT a.username, a.machine, a.program, a.sid, b.spid, a.serial#, a.status,
c.piece, c.sql_text
FROM v$session a, v$process b, v$sqltext c
WHERE b.addr = a.paddr
AND a.sql_address = c.address(+)
AND b.spid ='27999' -- TOP PID
ORDER BY c.piece;
人生有三宝:终身运动,终身学习,终身反醒.吸收新知,提高效率,懂得相处,成就自己,也成就他人,创造最高价值。