Created
March 11, 2013 10:56
-
-
Save georgeOsdDev/5133440 to your computer and use it in GitHub Desktop.
Collect AWR and Statspack automatically.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| spool awr_all.sql | |
| set pages 0 | |
| select | |
| 'define report_type=html' || chr(10) || | |
| 'define num_days = 1' || chr(10) || | |
| 'define begin_snap=' || SNAP_ID || chr(10) || | |
| 'define end_snap=' || (SNAP_ID + 1)|| chr(10) || | |
| 'define report_name=' || SNAP_ID || '_' || (SNAP_ID + 1) || '.html' || | |
| chr(10) || | |
| '@?/rdbms/admin/awrrpt.sql' || chr(10) | |
| from DBA_HIST_SNAPSHOT | |
| --where | |
| --to_char(END_INTERVAL_TIME,'yyyy/mm/dd') = to_char(sysdate,'yyyy/mm/dd') | |
| --SNAP_ID >= 3123 | |
| --and SNAP_ID <= 3145 | |
| order by snap_id | |
| ; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| set pages 0 | |
| select | |
| 'define begin_snap=' || SNAP_ID || chr(10) || | |
| 'define end_snap=' || (SNAP_ID + 1)|| chr(10) || | |
| 'define report_name=' || SNAP_ID || '_' || (SNAP_ID + 1) || '.txt' || | |
| chr(10) || | |
| '@?/rdbms/admin/spreport.sql' || chr(10) | |
| from stats$snapshot | |
| -- where snap_id >= 1077 | |
| -- and snap_id <= 1098 | |
| order by snap_id | |
| ; | |
| spool off |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment