AWR報(bào)告生成詳解_第1頁
AWR報(bào)告生成詳解_第2頁
AWR報(bào)告生成詳解_第3頁
AWR報(bào)告生成詳解_第4頁
AWR報(bào)告生成詳解_第5頁
已閱讀5頁,還剩3頁未讀, 繼續(xù)免費(fèi)閱讀

下載本文檔

版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進(jìn)行舉報(bào)或認(rèn)領(lǐng)

文檔簡介

1、Windows和Linux平臺生成awr報(bào)告Windows平臺生成awr報(bào)告1、 登錄部署Oracle10g數(shù)據(jù)的Windows服務(wù)器,運(yùn)行cmd.exe2、 首先進(jìn)入C:oracleproduct10.2.0db_1RDBMSADMIN目錄3、 用SYSDBA身份登錄sqlplus4、在sqlplus中輸入awrrpt5、開始安裝提示操作,首先是選擇要生成awr報(bào)告的類型,可以選擇text類型和html類型,這里以html類型為例,輸入html6、選擇要生報(bào)告的日期是多少天以前記錄,輸入1,則表示要生成今天0點(diǎn)開始到現(xiàn)在之內(nèi)的某個(gè)時(shí)間段的報(bào)告,輸入2,則表示要生成昨天0點(diǎn)開始到現(xiàn)在的某個(gè)時(shí)間

2、段的報(bào)告,以此類推。缺省記錄最近7天。這里輸入1作為示例7、輸入天數(shù)后,界面會顯示出一個(gè)時(shí)間段的表格,每個(gè)時(shí)間點(diǎn)都對應(yīng)一個(gè)Snap Id,間隔時(shí)間oracle默認(rèn)是1個(gè)小時(shí),接下來,輸入要生成報(bào)告的時(shí)間開始點(diǎn)對應(yīng)的Snap Id,這里以2012-6-18 01:00為例,表中看到其對應(yīng)的Snap Id是633。在輸入6338、下一步,要輸入生成報(bào)告的時(shí)間的結(jié)束點(diǎn)對應(yīng)的Snap Id,這里選2012-6-18 12:00為例,表中看到其對應(yīng)的Snap Id是644.在輸入6449、接著要求輸入生成報(bào)告的名字,系統(tǒng)會自動生成一個(gè)默認(rèn)的名字,并會在提示信息中顯示出來,如果使用默認(rèn)名,則不用輸入任何內(nèi)

3、容,直接回車即可。這里默認(rèn)是,一般都是awrrpt_1_開始點(diǎn)對應(yīng)的Snap Id_結(jié)束點(diǎn)對應(yīng)的Snap Id.html命名,這里可以按照默認(rèn)的名字就可以,生成報(bào)告內(nèi)容中包含報(bào)告記錄的時(shí)間段?;剀嚭?,會生成報(bào)告。10、退出plsql11、在Windows服務(wù)器C:oracleproduct10.2.0db_1RDBMSADMIN路徑下查找awr報(bào)告。Linux平臺生成awr報(bào)告1、 登錄數(shù)據(jù)庫所在的應(yīng)用服務(wù)器2、 進(jìn)入$ORACLE_HOME/rdbms/admin目錄eg: cd /opt/oracle/product/11.2.0/db_1/rdbms/admin3、用SYSDBA身份登錄

4、sqlplus sqlplus /as sysdba 有時(shí)候,執(zhí)行這句話會報(bào)錯(cuò): 解決方法:(1)查看.bash_profile文件是否配置path=$oracle_home/bin,有如下命令 rootxlserver10 # cat /.bash_profile /用戶為root,沒有path信息查看路徑: echo $PATH(2)直接到/opt/oracle/product/11.2.0/db_1/bin目錄下執(zhí)行sqlplus 如果(1)、(2)均不能執(zhí)行,那么用下面的方法吧: 切換用戶: rootxlserver10 # su oracle /注意-后面有空格,oracle為用戶名

5、 oraclexlserver10 $ cat .bash_profile /用戶為oracle,有如下語句:export PATH=$ORACLE_HOME/bin oraclexlserver10 pwd oraclexlserver10 cd /opt/oracle/product/11.2.0/db_1/rdbms/admin oraclexlserver10 admin$ ls awr*執(zhí)行過語句 su oracle,就可以執(zhí)行sqlplus命令了oraclexlserver10 admin$ sqlplus /nolog /此時(shí)我們在oracle_home/./adminSQL&g

6、t;sqlplus下刪除輸入的非法字符用delete鍵,不要用backspace退格SQL> conn /as sysdba /這一句必須執(zhí)行 2 Connected. 3 SQL> awrrpt.sql 4 5 Current Instance 6 7 8 DB Id DB Name Inst Num Instance 9 - - - -10 3918594034 ORCL 1 orcl11 12 13 Specify the Report Type14 15 Would you like an HTML report, or a plain text report?16 Ent

7、er 'html' for an HTML report, or 'text' for plain text17 Defaults to 'html'18 Enter value for report_type: html19 20 Type Specified: html21 22 23 Instances in this Workload Repository schema24 25 26 DB Id Inst Num DB Name Instance Host27 - - - - -28 * 3918594034 1 ORCL orcl D

8、CMSBDM29 30 Using 3918594034 for database Id31 Using 1 for instance number32 33 34 Specify the number of days of snapshots to choose from35 36 Entering the number of days (n) will result in the most recent37 (n) days of snapshots being listed. Pressing <return> without38 specifying a number li

9、sts all completed snapshots.39 40 41 Enter value for num_days: 2 42 43 Listing the last 2 days of Completed Snapshots44 45 Snap46 Instance DB Name Snap Id Snap Started Level47 - - - - -48 kobra KOBRA 1227 20 Aug 2012 00:00 149 1228 20 Aug 2012 01:00 150 1229 20 Aug 2012 02:00 151 1230 20 Aug 2012 03

10、:00 152 1231 20 Aug 2012 04:00 153 .54 1263 21 Aug 2012 12:00 155 1264 21 Aug 2012 13:00 156 1265 21 Aug 2012 14:00 157 1266 21 Aug 2012 15:00 158 59 60 Specify the Begin and End Snapshot Ids61 62 Enter value for begin_snap: 122763 Begin Snapshot Id specified: 122764 65 Enter value for end_snap: 126

11、566 End Snapshot Id specified: 126567 68 69 Specify the Report Name70 71 The default report is awrrpt_1_1227_1265.html. To use this name, press <return> to continue, otherwise enter an alternative.73 74 Enter value for report_name:75 76 Using the report name awrrpt_1_1227_1265.html77 78 <ht

12、ml><head><title>AWR Report for DB: KOBRA, Inst: kobra, Snaps: 1227-1265</title>79 80 .81 82 End of Report83 </body></html>84 Report written to awrrpt_1_1227_1265.html85 86 SQL> exit11、用SSH登錄系統(tǒng),并把生成的報(bào)告下載到本地。/opt/oracle/product/11.2.0/db_1/rdbms/admin在客戶端生成AWR報(bào)告

13、0; 眾所周知,我們可以使用awrrpt.sql腳本在服務(wù)器端生成AWR report. 這里我們說說如何使用DBMS_WORKLOAD_REPOSITORY.AWR_REPORT_HTML生成AWR報(bào)告,可以在服務(wù)器和客戶端使用。先看看這個(gè)packagedbms_workload_repository.awr_report_html(dbid     IN NUMBER, -數(shù)據(jù)庫idinst_num IN NUMBER, - 數(shù)據(jù)庫實(shí)例idbid      IN NUMBER, -

14、開始的快照ID,在dba_hist_snapshot第一列eid      IN NUMBER,   -結(jié)束的快照ID,在dba_hist_snapshot第一列options IN NUMBER DEFAULT 0)RETURN awrrpt_text_type_table PIPELINED; -返回結(jié)果使用下面的語句-pipelined function can be queried by :select * from table(<function name>);awrrpt_text_type_table is VARCHAR2(150) -is pre-defined by Oracle舉例:-1.數(shù)據(jù)庫id查看SELECT * FROM v$database;-2.數(shù)據(jù)庫實(shí)例id查看SELECT * FROM v$instance;-3.快照id查詢SELECT * FROM DBA_HIST_SNAPSHOT ORDER BY SNAP_ID DESC; -你可以按照時(shí)間

溫馨提示

  • 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
  • 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負(fù)責(zé)。
  • 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。

評論

0/150

提交評論