Solved

oracle awr & addm reports - automate

Posted on 2014-11-12
6
429 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
Industry Leaders: 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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

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ā€¦
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 shows setup options and the basic steps and syntax for duplicating (cloning) a database from one instance to another. Examples are given for duplicating to the same machine and to different machines
This video shows how to recover a database from a user managed backup

761 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