Rediscover Oracle's too-beautiful awr-related script for a brief introduction

Source: Internet
Author: User

Rediscover Oracle's too-beautiful awr-related script for a brief introduction


As you know, under $oracle_home/rdbms/admin, there is a script (my environment is 11.2.0.4.2):
[Email protected] ~]$ CD $ORACLE _home/rdbms/admin
[Email protected] admin]$ ls-ltr awr*
-rw-r--r--1 Oracle Oinstall 1999 OCT 2003 Awrrpt.sql
-rw-r--r--1 Oracle Oinstall 49166 SEP 1 2004 Awrinfo.sql
-rw-r--r--1 Oracle Oinstall 1469 Jan 5 2005 Awrsqrpt.sql
-rw-r--r--1 Oracle Oinstall 2462 Jan 5 2005 Awrinpnm.sql
-rw-r--r--1 Oracle Oinstall 20892 May 2005 Awrddinp.sql
-rw-r--r--1 Oracle Oinstall 2005 2005 Awrddrpt.sql
-rw-r--r--1 Oracle Oinstall 8603 Mar 3 2006 Awrinput.sql
-rw-r--r--1 Oracle Oinstall 1148 DEC 1 2006 Awrblmig.sql
-rw-r--r--1 Oracle oinstall 7440 Mar awrginp.sql
-rw-r--r--1 Oracle oinstall 16457 Mar awrgdinp.sql
-rw-r--r--1 Oracle oinstall 11082 Mar awrextr.sql
-rw-r--r--1 Oracle oinstall 1523 APR Awrgrpt.sql
-rw-r--r--1 Oracle Oinstall 1897 APR Awrgdrpt.sql
-rw-r--r--1 Oracle Oinstall 10368 awrload.sql
-rw-r--r--1 Oracle oinstall 6803 Jul awrsqrpi.sql
-rw-r--r--1 Oracle oinstall 7704 Jul awrrpti.sql
-rw-r--r--1 Oracle oinstall 6444 Jul awrgrpti.sql
-rw-r--r--1 Oracle oinstall 7393 Jul awrgdrpi.sql
-rw-r--r--1 Oracle oinstall 7450 Jul awrddrpi.sql


We hit introduce the following:
1.awrrpt.sql
This script is not strange to everyone, we almost to analyze the performance of the system when we have to execute the next script. Let's see what's funny in there.
[email protected] admin]$ cat Awrrpt.sql


Rem $Header: Awrrpt.sql 24-oct-2003.12:04:53 pbelknap EXP $
Rem
Rem Awrrpt.sql
Rem
Rem Copyright (c) 1999, 2003, Oracle Corporation. All rights reserved.
Rem
Rem NAME
Rem Awrrpt.sql
Rem
Rem DESCRIPTION
Rem This script defaults the dbid and instance
Rem Current instance connected-to, then calls Awrrpti.sql to produce
Rem the Workload Repository report.
Rem
Rem NOTES
Rem Run as Select_catalog privileges.
Rem This is based on the Statspack report.
Rem
Rem If you want to use this script in an non-interactive fashion,
Rem See the ' Customer-customizable Report Settings ' sections in
Rem Awrrpti.sql
Rem
Rem MODIFIED (MM/DD/YY)
Rem Pbelknap 10/24/03-swrfrpt to Awrrpt
Rem Pbelknap 10/14/03-moving params to Rpti
Rem pbelknap 10/02/03-adding non-interactive mode cmnts
Rem Mlfeng 09/10/03-heading on
Rem Aime 04/25/03-aime_going_to_main
Rem Mlfeng 01/27/03-mlfeng_swrf_reporting
Rem Mlfeng 01/13/03-update Comments
Rem Mlfeng 07/08/02-SWRF Flushing
Rem Mlfeng 06/12/02-created
Rem


--
--Get The current database/instance information-this'll be used
--later in the along with bid, Eid to lookup snapshots


Set echo off heading on underline on;
Column inst_num heading "Inst num" new_value inst_num format 99999;
Column Inst_name heading "Instance" new_value inst_name format A12;
Column db_name heading "DB name" New_value db_name format A12;
Column dbid heading "DB Id" new_value dbid format 9999999999 just C;


Prompt
Prompt current Instance
Prompt ~~~~~~~~~~~~~~~~


Select D.dbid dbid
, D.name db_name
, I.instance_number Inst_num
, I.instance_name Inst_name
From V$database D,
V$instance i;


@ @awrrpti


Undefine num_days;
Undefine Report_type;
Undefine Report_name;
Undefine Begin_snap;
Undefine End_snap;
--
--End of file






------>>> See the instructions? This script can only crawl the performance information of this example, in fact this script is called Awrrpti.sql,awr Development is based on the previous 9i Statspack report.
From the beginning of the 10G has awr, before 9I are statspack, used to listen to the old DBA said Statspack, indicating the unknown awareness of the calendar. At the same time to run this script at least have Select_catalog permissions.
Since this is deliverable, if you don't want to use interactivity, you can only use Awrrpti.sql.


2.awrrpti.sql
This is the original generated AWR script, which said to run this script to select two corresponding points of time, run the need to SYSDBA users, using this script can take another instance of this instance
AWR report. If you want to use non-interactive mode, you can refer to the following examples:
Rem If you want to use this script in an non-interactive fashion,
Rem without executing the script through AWRRPT, then
Rem do something similar to the following:
Rem
Rem define inst_num = 1;
Rem define num_days = 3;
Rem define inst_name = ' Instance ';
Rem define db_name = ' Database ';
Rem define dbid = 4;
Rem define BEGIN_SNAP = 10;
Rem define END_SNAP = 11;
Rem define Report_type = ' text ';
Rem Define Report_name =/tmp/swrf_report_10_11.txt
Rem @@?/rdbms/admin/awrrpti


3.awrinfo.sql
This script output some AWR information, report the system platform, the space occupied by AWR and so on, the default is the TXT format, you can see.


4.awrsqrpt.sql
This script is the output SQL report script, the background call of the Awrsqrpti.sql


5.awrsqrpi.sql
This script is the script that takes the SQL Information report, also can be customized, can adopt the non-delivery mode


6.awrinpnm.sql
This script ran an article, did not see the specific role


7.awrddinp.sql
I don't know what it's for.


8.awrgrpt.sql/awrgrpti.sql
This is more useful ah, take the global AWR report. But more than 11G. See RAC Network card traffic What's better, but I don't know.


9.awrddrpt.sql/awrddrpi.sql
Compare the AWR report scripts, which are commonly used when analyzing performance


10.awrgdrpt.sql/awrgdrpi.sql
The Global AWR report


11.awrinput.sql
I don't see anything of value.


12.awrblmig.sql
AWR baseline migration scripts, which may be used when upgrading


13.awrginp.sql
AWR Global Input Script


14.awrgdinp.sql
Awrgdinp.sql-awr glopal Compare Period report Input variables


15.awrextr.sql
AWR the script that exports the database information, which may be used when migrating


16.awrload.sql
AWR to import the information of the script, and the above with the use of


-----------is too rotten, there is no dry food, after no dry things resolutely do not write!



Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.