Tanel Poder mon_topsql2.sql
-- Copyright 2018 Tanel Poder. All rights reserved. More info at http://tanelpoder.com -- Licensed under the Apache License, Version 2.0. See LICENSE.txt for terms & conditions. -- mon_topsql.sql ver2 -- added plan_hash_value support and ordered by descending date -- script by Tanel Poder ( http://blog.tanelpoder.com ) SET LINES 999 PAGES 5000 TRIMSPOOL ON TRIMOUT ON TAB OFF COL pct FOR A10 JUST RIGHT COL cpu_pct FOR 999.9 COL io_pct FOR 999.9 BREAK ON day SKIP 1 DEF days=7 DEF weekdays="mon,tue,wed,thu,fri, sat,sun" DEF separator="," WITH ash AS ( SELECT day , weekday , owner , object_name , procedure_name , sql_id , sql_plan_hash_value , distinct_days , total_seconds , io_seconds , cpu_seconds ...