Solved

oracle awr & addm reports - automate

Posted on 2014-11-12
6
446 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
PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

 
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

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

Configuring and using Oracle Database Gateway for ODBC Introduction First, a brief summary of what a Database Gateway is.  A Gateway is a set of driver agents and configurations that allow an Oracle database to communicate with other platforms…
Checking the Alert Log in AWS RDS Oracle can be a pain through their user interface.  I made a script to download the Alert Log, look for errors, and email me the trace files.  In this article I'll describe what I did and share my script.
This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.
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

688 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