Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Sort SQL by CPU resource consumption in oracle

2025-04-03 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

Set lines 180set pagesize 500col INSTANCE_NUMBER for 99col module format a10col execs for 999999999col etime for 999999999.9col avg_etime for 999999.999col avg_cpu_time for 999999.999col avg_lio for 999999999.9col avg_pio for 9999999.9col begin_interval_time for a30col node for 99999break on plan_hash_value on startup_time skip 1select * from (select INSTANCE_NUMBER,sql_id, plan_hash_value, sum (execs) execs, sum (etime) etime, sum (etime) / sum (execs) avg_etime Sum (cpu_time) / sum (execs) avg_cpu_time,sum (lio) / sum (execs) avg_lio, sum (pio) / sum (execs) avg_pio,modulefrom (select ss.snap_id, ss.instance_number node, begin_interval_time, s.INSTANCEUMBERM., sql_id, plan_hash_value,nvl (executions_delta,0) execs,elapsed_time_delta/1000000 etime, (elapsed_time_delta/decode (nvl (executions_delta,0), 0Co1) Executions_delta)) / 1000000 avg_etime,buffer_gets_delta lio,disk_reads_delta pio,cpu_time_delta/1000000 cpu_time, (buffer_gets_delta/decode (nvl (buffer_gets_delta,0), 0meme 1 Enforcement delta)) avg_lio, (cpu_time_delta/decode (nvl (executions_delta,0), 0meme 1 Enforcement delta)) avg_cpu_timefrom DBA_HIST_SQLSTAT S DBA_HIST_SNAPSHOT SSwhere ss.snap_id = S.snap_idand ss.instance_number = S.instance_number and executions_delta > 0and ss.begin_interval_time > = sysdate-3 and s.PLAN_HASH_VALUE > 0) group by INSTANCE_NUMBER,sql_id, plan_hash_value,moduleorder by 8 desc) where rownum

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 221

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report