Script to get AWR previous day, week, month

I’ve uploaded a sql script that gets an AWR report for yesterday, a week from yesterday, and four weeks from yesterday for the same time period – 10 am to 4  pm.

I’ve been manually reviewing the previous day’s AWR report on a database against the previous week and month.  So, I scripted up a sqlplus script that will automatically figure out the snap_ids I need for the three reports and call awrrpt.sql with the necessary variables set.  This might be helpful for someone else who is doing daily monitoring as I am.  I mainly just check the”Top 5 Timed Events” and “SQL ordered by Elapsed Time” to see if they have changed from the previous week and month.

Just download the zip, unzip it, and run awrdayweekmonth.sql on your unix database server and it will generate three AWR reports in your current directory.

– Bobby

P.S.  One detail I forgot in my original post.  I’m only interested in Monday-Friday so if you run this script on a Monday it will show you the AWR for Friday, a week ago Friday, and four weeks ago Friday.

About Bobby

I live in Chandler, Arizona with my wife and three daughters. I work for US Foods, the second largest food distribution company in the United States. I've been working as an Oracle database administrator and PeopleSoft administrator since 1994. I'm very interested in Oracle performance tuning.
This entry was posted in Uncategorized. Bookmark the permalink.

Leave a Reply