Linux下Oracle導出awr報告

原文鏈接:https://blog.csdn.net/jokey111/article/details/85334460

原文鏈接:https://blog.csdn.net/jokey111/article/details/85334460
1,登錄oracle服務端

2,切換至oracle用戶

su - oracle

3,多實例需要切換至對應實例

       3.1.查看實例方法如下

         oracle@db02[/app/oracle]$ps -ef|grep smon
         oracle    54102      1  2 Dec24 ?        02:32:00 ora_smon_aaaa
         grid     144900      1  0 Dec13 ?        00:00:18 asm_smon_+ASM
         oracle   145532      1  0 Dec13 ?        00:01:23 ora_smon_bb
         oracle   179758 179473  0 10:08 pts/1    00:00:00 grep --color=auto smon

       3.2.比如此次導出的awr報告爲bb,則切換實例至bb

           export  ORACLE_SID=bb

4.以管理員用戶登入數據庫

         sqlplus / as sysdba

5,執行如下命令@?/rdbms/admin/awrrpt.sql

SQL> @?/rdbms/admin/awrrpt.sql

Specify the Report Type
~~~~~~~~~~~~~~~~~~~~~~~
AWR reports can be generated in the following formats.  Please enter the
name of the format at the prompt.  Default value is 'html'.

'html'          HTML format (default)
'text'          Text format
'active-html'   Includes Performance Hub active report

Enter value for report_type: html #輸入awr報告輸出的類型,按上述三種類型填寫
old   1: select 'Type Specified: ',lower(nvl('&&report_type','html')) report_type from dual
new   1: select 'Type Specified: ',lower(nvl('html','html')) report_type from dual

Type Specified:  html

old   1: select '&&report_type' report_type_def from dual
new   1: select 'html' report_type_def from dual

old   1: select '&&view_loc' view_loc_def from dual
new   1: select 'AWR_PDB' view_loc_def from dual

Current Instance
~~~~~~~~~~~~~~~~
DB Id          DB Name        Inst Num       Instance       Container Name
-------------- -------------- -------------- -------------- --------------
 2198676206     BB                         1 BB            bb


Instances in this Workload Repository schema
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  DB Id      Inst Num   DB Name      Instance     Host
------------ ---------- ---------    ----------   ------
* 2198676206     1      BB          BB          db02

Using 2198676206 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 <return> without
specifying a number lists all completed snapshots.


Enter value for num_days: 1 #獲取awr數據的天數

Listing the last day's Completed Snapshots
Instance     DB Name      Snap Id       Snap Started    Snap Level
------------ ------------ ---------- ------------------ ----------

BB          BB               2437  29 Dec 2018 00:00    1
                               2438  29 Dec 2018 01:00    1
                               2439  29 Dec 2018 02:00    1
                               2440  29 Dec 2018 03:00    1
                               2441  29 Dec 2018 04:00    1
                               2442  29 Dec 2018 05:00    1
                               2443  29 Dec 2018 06:00    1
                               2444  29 Dec 2018 07:00    1
                               2445  29 Dec 2018 08:00    1
                               2446  29 Dec 2018 09:00    1
                               2447  29 Dec 2018 10:00    1


Specify the Begin and End Snapshot Ids
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Enter value for begin_snap: 2437 #通過上述產尋到的ID,確定需要導出開始時間點的id
Begin Snapshot Id specified: 2437

Enter value for end_snap: 2447 #通過上述產尋到的ID,確定需要導出結束時間點的id
End   Snapshot Id specified: 2447

Specify the Report Name
~~~~~~~~~~~~~~~~~~~~~~~
The default report file name is awrrpt_1_2437_2447.html.  To use this name,
press <return> to continue, otherwise enter an alternative.

Enter value for report_name:#配置導出awr報告的名字,如果未配置則使用上述說明的默認名字awrrpt_1_2437_2447.html

出現如下說明,則導出awr完成

End of Report
Report written to awrrpt_1_2437_2447.html
————————————————
版權聲明:本文爲CSDN博主「Chance.W」的原創文章,遵循 CC 4.0 BY-SA 版權協議,轉載請附上原文出處鏈接及本聲明。
原文鏈接:https://blog.csdn.net/jokey111/article/details/85334460

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章