Oracle AWR报告生成与查看(二)

2014-11-24 18:03:15 · 作者: · 浏览: 2
om 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


其中一段的结果为
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;


DBID DB_NAME INST_NUM INST_NAME
---------- --------- ---------- ----------------
620748923 PENG 1 peng



然后调用了awrrpti.sql,其内容较多,以后找机会在专门分析。


这里我们直接执行awrrpt.sql。


SYS@PENG SQL> @/oracle/product/10g/rdbms/admin/awrrpt.sql


Current Instance
~~~~~~~~~~~~~~~~


DB Id DB Name Inst Num Instance
----------- ------------ -------- ------------
620748923 PENG 1 peng



Specify the Report Type
~~~~~~~~~~~~~~~~~~~~~~~
Would you like an HTML report, or a plain text report
Enter 'html' for an HTML report, or 'text' for plain text
Defaults to 'html'
Enter value for report_type: text


Type Specified: text



Instances in this Workload Repository schema
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


DB Id Inst Num DB Name Instance Host
------------ -------- ------------ ------------ ------------
* 620748923 1 PENG peng localhost


Using 620748923 for database Id
Using 1 for instance number



Specify the number of days of snapshots to choose from
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Entering the number of days (n) will result in the most recent
(n) days of snapshots being listed. Pressing without
specifying a number lists all completed snapshots.



Enter value for num_days: 2


Listing the last 2 days of Completed Snapshots


Snap
Instance DB Name Snap Id Snap Started Level
------------ ------------ --------- ------------------ -----
peng PENG 58 12 Dec 2010 01:11 1
59 12 Dec 2010 02:01 1
60 12 Dec 2010 03:01 1
61 12 Dec 2010 04:02 1
62 12 Dec 2010 05:02 1


63 13 Dec 2010 01:00 1


64 13 Dec 2010 02:00 1
65 13 Dec 2010 03:02 1
66 13 Dec 2010 04:01 1
67 13 Dec 2010 04:54 1
68 13 Dec 2010 04:59 1
69 13 Dec 2010 05:00 1
70 13 Dec 2010 05:30 1



Specify the Begin and End Snapshot Ids
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Enter value for begin_snap: 64
Begin Snapshot Id specified: 64


Enter value for end_snap: 70
End Snapshot Id specified: 70



Specify the Report Name
~~~~~~~~~~~~~~~~~~~~~~~
The default report file name is awrrpt_1_64_70.txt. To use this name,
press to continue, otherwise enter an alternative.


Enter value for report_name: /tmp/awrrpt_1_64_70.txt


生成文件存放在指定的/tmp下。


文件包含一下内容: