Oracle database internals by Riyaj

Discussions about Oracle performance tuning, RAC, Oracle internal & E-business suite.

Scripts to create AWR reports quickly.

Posted by Riyaj Shamsudeen on November 12, 2013

It is easier to create one or two AWR reports quickly using OEM. But, what if you have to create AWR reports for many snapshots? For example, your Oracle support analyst wants you to supply 10 1-hour AWR reports from 10AM to 8PM in a 8 node cluster? That’s about 80 AWR reports to create! Okay, okay, I may(!) be overselling it, but you get the point. It is useful to have a script to create AWR report for all instances for a given range of snapshot IDs. Following scripts are handy:

1. To create one AWR report per instance, for the last snap duration : awrrpt_all_gen.sql
2. Same as (1) but in html format : awrrpt_all_genhtml.sql
3. To create one AWR report per instance, for a range of snap IDs : awrrpt_all_range_gen.sql
4. To create one AWR report, per instance, per snap ID : awrrpt_all_multi_gen.sql

Zip file: awrrpt_scripts

These scripts do not modify anything in the database, just retrieves the data using dbms_workload_repository package. Test the scripts to understand further. Of course, you need access to dbms_workload_repository and access to gv$instance.

11 Responses to “Scripts to create AWR reports quickly.”

  1. Gopal Seethepalli said

    As always Riyaj explanation about different wait events and his scripts are just amazing and very handy.

  2. basha said

    thanks a saved me a lot of time.

  3. Essy said

    The scripts are cool.Thanks

  4. linhtt7509 said

    thank you so much! it is so useful to me!!!

  5. kanhaiya said

    great job

  6. Srikanth said

    Hello Riyaj,

    It seems ,awr generated in text fromat, do we have any script to generate them in html format, i have tried replacing .txt with .html in script file, .html files were generated but they are not in readable format.

  7. trexmaster said

    Your scripts just saved me 2 hours of work (6 hourly reports on 10 dbs in a 2-nodes cluster …), tank you so much !

  8. FARA said

    It’s possible to take it on crontab every hour

  9. Shobhit Jain said

    Thanks Riyaj Shamsudeen

  10. Shekhar said

    will this work for Oracle 12c container database with PDBs ? Please let me know.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: