AWR报告生成详解

上传人:公**** 文档编号:509293254 上传时间:2023-09-30 格式:DOC 页数:8 大小:114.52KB
返回 下载 相关 举报
AWR报告生成详解_第1页
第1页 / 共8页
AWR报告生成详解_第2页
第2页 / 共8页
AWR报告生成详解_第3页
第3页 / 共8页
AWR报告生成详解_第4页
第4页 / 共8页
AWR报告生成详解_第5页
第5页 / 共8页
点击查看更多>>
资源描述

《AWR报告生成详解》由会员分享,可在线阅读,更多相关《AWR报告生成详解(8页珍藏版)》请在金锄头文库上搜索。

1、Windows和Linux平台生成awr报告Windows平台生成awr报告1、 登录部署Oracle10g数据的Windows服务器,运行cmd.exe2、 首先进入C:oracleproduct10.2.0db_1RDBMSADMIN目录3、 用SYSDBA身份登录sqlplus4、在sqlplus中输入awrrpt5、开始安装提示操作,首先是选择要生成awr报告的类型,可以选择text类型和html类型,这里以html类型为例,输入html6、选择要生报告的日期是多少天以前记录,输入1,则表示要生成今天0点开始到现在之内的某个时间段的报告,输入2,则表示要生成昨天0点开始到现在的某个时间

2、段的报告,以此类推。缺省记录最近7天。这里输入1作为示例7、输入天数后,界面会显示出一个时间段的表格,每个时间点都对应一个Snap Id,间隔时间oracle默认是1个小时,接下来,输入要生成报告的时间开始点对应的Snap Id,这里以2012-6-18 01:00为例,表中看到其对应的Snap Id是633。在输入6338、下一步,要输入生成报告的时间的结束点对应的Snap Id,这里选2012-6-18 12:00为例,表中看到其对应的Snap Id是644.在输入6449、接着要求输入生成报告的名字,系统会自动生成一个默认的名字,并会在提示信息中显示出来,如果使用默认名,则不用输入任何内

3、容,直接回车即可。这里默认是,一般都是awrrpt_1_开始点对应的Snap Id_结束点对应的Snap Id.html命名,这里可以按照默认的名字就可以,生成报告内容中包含报告记录的时间段。回车后,会生成报告。10、退出plsql11、在Windows服务器C:oracleproduct10.2.0db_1RDBMSADMIN路径下查找awr报告。Linux平台生成awr报告1、 登录数据库所在的应用服务器2、 进入$ORACLE_HOME/rdbms/admin目录eg: cd /opt/oracle/product/11.2.0/db_1/rdbms/admin3、用SYSDBA身份登录

4、sqlplus sqlplus /as sysdba 有时候,执行这句话会报错: 解决方法:(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目录下执行sqlplus 如果(1)、(2)均不能执行,那么用下面的方法吧: 切换用户: 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*执行过语句 su oracle,就可以执行sqlplus命令了oraclexlserver10 admin$ sqlplus /nolog /此时我们在oracle_home/./adminSQLsq

6、lplus下删除输入的非法字符用delete键,不要用backspace退格SQL conn /as sysdba /这一句必须执行 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 Enter html for

7、an HTML report, or text for plain text17 Defaults to html18 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 DCMSBDM29 30 Using 3918594034 for database

8、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 without38 specifying a number lists all completed snapshots.39 40 41 Enter value for num_

9、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:00 152 1231 20 Aug 2012 04:00 153 .54 1263 21 Aug 2012 1

10、2: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: 126566 End Snapshot Id specified: 126567 68 69 Specify the R

11、eport Name70 71 The default report file name is awrrpt_1_1227_1265.html. To use this name, press 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 AWR Report for DB: KOBRA, Inst: kobra, Snaps: 1227-126579 80 .81 82

12、End of Report83 84 Report written to awrrpt_1_1227_1265.html85 86 SQL exit11、用SSH登录系统,并把生成的报告下载到本地。/opt/oracle/product/11.2.0/db_1/rdbms/admin在客户端生成AWR报告众所周知,我们可以使用awrrpt.sql脚本在服务器端生成AWR report. 这里我们说说如何使用DBMS_WORKLOAD_REPOSITORY.AWR_REPORT_HTML生成AWR报告,可以在服务器和客户端使用。先看看这个packagedbms_workload_reposito

13、ry.awr_report_html(dbid IN NUMBER, -数据库idinst_num IN NUMBER, -数据库实例idbid IN NUMBER, -开始的快照ID,在dba_hist_snapshot第一列eid IN NUMBER, -结束的快照ID,在dba_hist_snapshot第一列options IN NUMBER DEFAULT 0)RETURN awrrpt_text_type_table PIPELINED;-返回结果使用下面的语句-pipelined function can be queried by :select * from table();awrrpt_text_type_table is VARCHAR2(150) -is pre-defined by O

展开阅读全文
相关资源
相关搜索

当前位置:首页 > 办公文档 > PPT模板库 > 总结/计划/报告

电脑版 |金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号