Oracle-awrddrpt.sql比较两个AWR差异报告
生活随笔
收集整理的這篇文章主要介紹了
Oracle-awrddrpt.sql比较两个AWR差异报告
小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.
- 概述
- 示例
- 以oracle用戶登錄到數(shù)據(jù)庫主機(jī)執(zhí)行腳本
- 查看報(bào)告
概述
awrddrpt.sql腳本位于$ORACLE_HOME/rdbms/admin目錄中。
awrddrpt.sql腳本比較兩個(gè)時(shí)間段的AWR報(bào)告。
這個(gè)腳本的交互部分最重要的就是需要輸入要進(jìn)行對(duì)比的兩個(gè)awr報(bào)告的begin snap_id與end snap_id
一旦收集到四個(gè)快照號(hào)碼,awrddrpt.sql腳本將創(chuàng)建兩個(gè)AWR報(bào)告,然后比較這兩個(gè)報(bào)告。awrddrpt.sql腳本對(duì)于比較兩個(gè)經(jīng)過時(shí)間段內(nèi)的性能非常有用。
示例
我們打算比對(duì)3月30號(hào)00:00~01:00 和 3月31號(hào)00:00~01:00這兩個(gè)時(shí)間段的AWR
以oracle用戶登錄到數(shù)據(jù)庫主機(jī)執(zhí)行腳本
..... Connection established. To escape to local shell, press 'Ctrl+Alt+]'.Last login: Sat Mar 31 09:48:24 2018 from 172.25.21.204 Oracle Corporation SunOS 5.10 Generic Patch January 2005 You have new mail. ##處于安全的考慮,以nolog的方式登錄 ocsdb01:[/oracle$]sqlplus /nolog SQL*Plus: Release 11.2.0.4.0 Production on Sat Mar 31 11:23:08 2018Copyright (c) 1982, 2013, Oracle. All rights reserved.## 登錄特定的用戶,輸入密碼 SQL> connect cc@PR_CC Enter password: Connected. ## 執(zhí)行awrddrpt腳本 SQL> @?/rdbms/admin/awrddrptCurrent Instance ~~~~~~~~~~~~~~~~DB Id DB Id DB Name Inst Num Inst Num Instance ----------- ----------- ------------ -------- -------- ------------2143881171 2143881171 CC 1 1 ccSpecify 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' ## 默認(rèn)html Enter value for report_type: Type Specified: htmlInstances in this Workload Repository schema ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~DB Id Inst Num DB Name Instance Host ------------ -------- ------------ ------------ ------------ * 2143881171 1 CC cc ocsdb01Database Id and Instance Number for the First Pair of Snapshots ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Using 2143881171 for Database Id for the first pair of snapshots Using 1 for Instance Number for the first pair of snapshotsSpecify 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.#因?yàn)榻裉焓?1號(hào),我們只需要輸入2天時(shí)間范圍就可以獲取到3月30號(hào)00:00~01:00的快照 Enter value for num_days: 2Listing the last 2 days of Completed SnapshotsSnap Instance DB Name Snap Id Snap Started Level ------------ ------------ --------- ------------------ ----- cc CC 10080 30 Mar 2018 00:00 110081 30 Mar 2018 01:00 110082 30 Mar 2018 02:00 110083 30 Mar 2018 03:00 110084 30 Mar 2018 04:00 110085 30 Mar 2018 05:00 110086 30 Mar 2018 06:00 110087 30 Mar 2018 07:00 110088 30 Mar 2018 08:00 110089 30 Mar 2018 09:00 110090 30 Mar 2018 10:00 110091 30 Mar 2018 11:00 110092 30 Mar 2018 12:00 110093 30 Mar 2018 13:00 110094 30 Mar 2018 14:00 110095 30 Mar 2018 15:00 110096 30 Mar 2018 16:00 110097 30 Mar 2018 17:00 110098 30 Mar 2018 18:00 110099 30 Mar 2018 19:00 110100 30 Mar 2018 20:00 110101 30 Mar 2018 21:00 110102 30 Mar 2018 22:00 110103 30 Mar 2018 23:00 110104 31 Mar 2018 00:00 110105 31 Mar 2018 01:00 110106 31 Mar 2018 02:00 110107 31 Mar 2018 03:00 110108 31 Mar 2018 04:00 110109 31 Mar 2018 05:00 110110 31 Mar 2018 06:00 110111 31 Mar 2018 07:00 110112 31 Mar 2018 08:00 110113 31 Mar 2018 09:00 110114 31 Mar 2018 10:00 110115 31 Mar 2018 11:00 1Specify the First Pair of Begin and End Snapshot Ids ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ## 選擇開始的快照 Enter value for begin_snap: 10080 First Begin Snapshot Id specified: 10080 ## 選擇結(jié)束的快照 Enter value for end_snap: 10081 First End Snapshot Id specified: 10081Instances in this Workload Repository schema ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~DB Id Inst Num DB Name Instance Host ------------ -------- ------------ ------------ ------------ * 2143881171 1 CC cc ocsdb01Database Id and Instance Number for the Second Pair of Snapshots ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~Using 2143881171 for Database Id for the second pair of snapshots Using 1 for Instance Number for the second pair of snapshotsSpecify 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.#因?yàn)榻裉焓?1號(hào),我們只需要輸入1天時(shí)間范圍就可以獲取到3月31號(hào)00:00~01:00 Enter value for num_days2: 1Listing the last day's Completed SnapshotsSnap Instance DB Name Snap Id Snap Started Level ------------ ------------ --------- ------------------ ----- cc CC 10104 31 Mar 2018 00:00 110105 31 Mar 2018 01:00 110106 31 Mar 2018 02:00 110107 31 Mar 2018 03:00 110108 31 Mar 2018 04:00 110109 31 Mar 2018 05:00 110110 31 Mar 2018 06:00 110111 31 Mar 2018 07:00 110112 31 Mar 2018 08:00 110113 31 Mar 2018 09:00 110114 31 Mar 2018 10:00 110115 31 Mar 2018 11:00 1Specify the Second Pair of Begin and End Snapshot Ids ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ## 選擇開始的快照 Enter value for begin_snap2: 10104 Second Begin Snapshot Id specified: 10104 ## 選擇結(jié)束的快照 Enter value for end_snap2: 10105 Second End Snapshot Id specified: 10105Specify the Report Name ~~~~~~~~~~~~~~~~~~~~~~~ The default report file name is awrdiff_1_10080_1_10104.html To use this name, press <return> to continue, otherwise enter an alternative. ## 輸入awr報(bào)告名稱 Enter value for report_name: artisan_awr_diff_rptUsing the report name artisan_awr_diff_rpt......省略輸出過程 ...... ...... </body></html> Report written to artisan_awr_diff_rpt ## 退出 SQL> exit Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production With the Partitioning, OLAP, Data Mining and Real Application Testing options ocsdb01:[/oracle$]## 當(dāng)前目錄下查找輸出的報(bào)告 ocsdb01:[/oracle$]ls artisan_awr_diff_rpt* artisan_awr_diff_rpt.lst ocsdb01:[/oracle$]查看報(bào)告
總結(jié)
以上是生活随笔為你收集整理的Oracle-awrddrpt.sql比较两个AWR差异报告的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: Spring Boot-Spring T
- 下一篇: Oracle-AWR管理包DBMS_WO