?
Solved

oracle awr & addm reports - automate

Posted on 2014-11-12
6
Medium Priority
?
459 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 2000 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

[Webinar] How Hackers Steal Your Credentials

Do You Know How Hackers Steal Your Credentials? Join us and Skyport Systems to learn how hackers steal your credentials and why Active Directory must be secure to stop them.

Question has a verified solution.

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

When it comes to protecting Oracle Database servers and systems, there are a ton of myths out there. Here are the most common.
Shell script to create broker configuration file using current broker Configuration, solely for purpose of backup on Linux. Script may need to be modified depending on OS-installation. Please deploy and verify the script in a test environment.
This video explains at a high level with the mandatory Oracle Memory processes are as well as touching on some of the more common optional ones.
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…
Suggested Courses

764 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