Solved

oracle awr & addm reports - automate

Posted on 2014-11-12
6
437 Views
Last Modified: 2014-11-12
is there a way to automate the awr and addm reports - I want to run them every day for a period of one day - how do you find the right start/end numbers?  I need this to fit into a script I can put in cron.

oracle 11g aix 6

thanks
0
Comment
Question by:bkreynolds48
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
6 Comments
 
LVL 74

Expert Comment

by:sdstuber
ID: 40437953
To find the min/max ids for yesterday try this:

SELECT MIN(snap_id) minid, MAX(snap_id) maxid
  FROM dba_hist_snapshot
 WHERE begin_interval_time >= TRUNC(SYSDATE) - 1 AND end_interval_time < TRUNC(SYSDATE)
0
 
LVL 1

Author Comment

by:bkreynolds48
ID: 40438111
ok - but how do I script this to run the awr and addm report - how do you get those values into
@awr
and
@addm
0
 
LVL 74

Accepted Solution

by:
sdstuber earned 500 total points
ID: 40438219
you can just call the report functions yourself once you have the inputs.

try something like this...

SELECT output
  FROM (SELECT MIN(snap_id) minid, MAX(snap_id) maxid
          FROM dba_hist_snapshot
         WHERE begin_interval_time >= TRUNC(SYSDATE) - 1 AND end_interval_time < TRUNC(SYSDATE)),
       TABLE(
           DBMS_WORKLOAD_REPOSITORY.awr_report_text(
               (SELECT dbid
                  FROM v$database),
               (SELECT instance_number
                  FROM v$instance),
               minid,
               maxid
           )
       );
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 1

Author Comment

by:bkreynolds48
ID: 40438480
is there a way to make this html?
0
 
LVL 74

Expert Comment

by:sdstuber
ID: 40438489
change

awr_report_text

to

awr_report_html
0
 
LVL 1

Author Closing Comment

by:bkreynolds48
ID: 40438501
great ! :)
thanks much
0

Featured Post

Salesforce Has Never Been Easier

Improve and reinforce salesforce training & adoption using WalkMe's digital adoption platform. Start saving on costly employee training by creating fast intuitive Walk-Thrus for Salesforce. Claim your Free Account Now

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
ORA-06502: PL/SQL: numeric or value error: character to number conversion error 4 122
oracle forms question 22 60
Oracle cluster . 1 22
Automate an Oracle update in Excel 7 63
I remember the day when someone asked me to create a user for an application developement. The user should be able to create views and materialized views and, so, I used the following syntax: (CODE) This way, I guessed, I would ensure that use…
When it comes to protecting Oracle Database servers and systems, there are a ton of myths out there. Here are the most common.
This video shows syntax for various backup options while discussing how the different basic backup types work.  It explains how to take full backups, incremental level 0 backups, incremental level 1 backups in both differential and cumulative mode a…
This video shows how to Export data from an Oracle database using the Original Export Utility.  The corresponding Import utility, which works the same way is referenced, but not demonstrated.
Suggested Courses

738 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question