Solved

oracle awr & addm reports - automate

Posted on 2014-11-12
6
401 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
  • 3
  • 3
6 Comments
 
LVL 73

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 73

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
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
LVL 1

Author Comment

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

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

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

Suggested Solutions

Cursors in Oracle: A cursor is used to process individual rows returned by database system for a query. In oracle every SQL statement executed by the oracle server has a private area. This area contains information about the SQL statement and the…
Background In several of the companies I have worked for, I noticed that corporate reporting is off loaded from the production database and done mainly on a clone database which needs to be kept up to date daily by various means, be it a logical…
This video explains at a high level about the four available data types in Oracle and how dates can be manipulated by the user to get data into and out of the database.
This video shows how to Export data from an Oracle database using the Datapump Export Utility.  The corresponding Datapump Import utility is also discussed and demonstrated.

743 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now