设为首页 收藏本站
查看: 1582|回复: 0

[经验分享] 【oracle awr详解分析报告-03】

[复制链接]
YunVN网友  发表于 2018-9-25 07:21:32 |阅读模式
5.     删除基线
  如果要删除一个基准线:
  SQL> exec dbms_workload_repository.drop_baseline(baseline_name=>'apply_interest_1',cascade=>false);
  PL/SQL 过程已成功完成。
  SQL> select *from wrh$_active_session_history where snap_id in (95,96,97,98);
  SNAP_ID       DBID INSTANCE_NUMBER  SAMPLE_ID SAMPLE_TIME
  ---------- ---------- --------------- ---------- -------------------------------
  95 1160732652               1     235360 06-10月-07 10.56.29.872 上午
  95 1160732652               1     235230 06-10月-07 10.54.19.857 上午
  95 1160732652               1     233130 06-10月-07 10.19.19.478 上午
  95 1160732652               1     232830 06-10月-07 10.14.18.859 上午
  95 1160732652               1     232250 06-10月-07 10.04.38.481 上午
  97 1160732652               1     238600 06-10月-07 12.33.08.420 下午
  97 1160732652               1     238600 06-10月-07 12.33.08.420 下午
  97 1160732652               1     238600 06-10月-07 12.33.08.420 下午
  97 1160732652               1     238600 06-10月-07 12.33.08.420 下午
  97 1160732652               1     238600 06-10月-07 12.33.08.420 下午
  97 1160732652               1     238600 06-10月-07 12.33.08.420 下午
  SNAP_ID       DBID INSTANCE_NUMBER  SAMPLE_ID SAMPLE_TIME
  ---------- ---------- --------------- ---------- -------------------------------
  97 1160732652               1     238420 06-10月-07 11.50.55.686 上午
  97 1160732652               1     238230 06-10月-07 11.47.45.687 上午
  98 1160732652               1     239140 06-10月-07 01.42.00.976 下午
  98 1160732652               1     239140 06-10月-07 01.42.00.976 下午
  98 1160732652               1     239140 06-10月-07 01.42.00.976 下午
  98 1160732652               1     239140 06-10月-07 01.42.00.976 下午
  98 1160732652               1     239140 06-10月-07 01.42.00.976 下午
  98 1160732652               1     239130 06-10月-07 01.27.04.161 下午
  98 1160732652               1     239130 06-10月-07 01.27.04.161 下午
  98 1160732652               1     239130 06-10月-07 01.27.04.161 下午
  已选择21行。
  SQL> exec dbms_workload_repository.drop_baseline(baseline_name=>'apply_interest_2', cascade=>true);
  PL/SQL 过程已成功完成。
  SQL> select *from wrh$_active_session_history where snap_id in (92,93,94);
  未选定行
  SQL>
6.     生成报表
  awr有个报表生成机制,可以对存储在workload资料库的统计产生汇总报表。这个分析对一段时间的统计做的。这个报表生成机制很像statspack。
可以使用脚本awrrpt.sql或awrrpti.sql来查看AWR报告(非常类似statspack中的spreport.sql),这两个脚本都在目录$ORACLE_HOME/rdbms/admin中。Awrrpt.sql脚本可以显示指定快照id范围的诊断信息,报告可以保存为文本文件或HTML文件;awrrpti.sql脚本与awrrpt.sql类似,唯一的不同就是在awrrpti.sql脚本中,你可以指定数据库ID和实例ID(作为参数)。报告包括如下诊断信息:

[1] Report summary

  [1] Wait events statistics
  [1] SQL statistics
  [1] Instance activity statistics
  [1] I/O statistics
  [1] Buffer pool statistics
  [1] Advisory statistics
  [1] Wait statistics
  [1] Undo statistics
  [1] Latch statistics
  Segment statistics
  [1] Dictionary cache statistics
  [1] Library cache statistics
  [1] SGA statistics
  [1] Resource limit statistics
  [1] init.ora parameters
  通过运行$ORACLE_HOME/rdbms/admin目录中的awrrpt.sql脚本,AWR的功能可以立即通过它从采集的统计数据和量度中生成的报表得到最好的说明。这个脚本显示所有的现有AWR快照并请求两个特定的快照作为时间间隔边界。它产生两种类型的输出:文本格式(类似于Statspack报表的文本格式但来自于AWR信息库)和默认的HTML格式(拥有到部分和子部分的所有超链接),从而提供了非常用户友好的报表。
  运行这个脚本必须要select any dictionary权限.这个脚本提示你输入选项如怎么和在哪里生成这个报表:
  *首先,你需要指明你要生成html还是text格式的
  *要选择快照的天数:输入天数,和你最近的快照,可选的,你可以使用dba_hist_snapshot表来看你要用哪个snap_id.
  *开始snap_id和终止snap_id,这个快照对定义你的报表产生的时间间隔.
  *文件名称,报告写的用户指定的文件.
  现在运行该脚本以查看报表,从而对AWR的报表功能有一个直观的了解。
  SQL> @D:/oracle/product/10.2.0/db_1/RDBMS/ADMIN/awrrpt.sql
  Current Instance
  ~~~~~~~~~~~~~~~~

  DB>  ----------- ------------ -------- ------------
  1160732652 ORCL                1 orcl
  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'
  输入 report_type 的值:
  Type Specified:                  html
  Instances in this Workload Repository schema
  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

  DB>  ------------ -------- ------------ ------------ ------------
  * 1160732652        1 ORCL         orcl         YUECHAOTIAN

  Using 1160732652 for database>  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.
  输入 num_days 的值:  4
  Listing the last 4 days of Completed Snapshots
  Snap

  Instance     DB Name        Snap>  ------------ ------------ --------- ------------------ -----
  orcl         ORCL                81 04 10月 2007 07:24     1
  83 05 10月 2007 13:34     1
  84 05 10月 2007 16:19     1
  85 05 10月 2007 17:00     1
  86 05 10月 2007 18:00     1
  87 05 10月 2007 19:10     1
  88 05 10月 2007 20:00     1
  89 05 10月 2007 21:00     1
  90 05 10月 2007 22:00     1
  91 05 10月 2007 23:00     1
  95 06 10月 2007 11:00     1
  97 06 10月 2007 13:27     1
  98 06 10月 2007 13:44     1
  99 06 10月 2007 14:00     1
  100 06 10月 2007 14:30     1
  101 06 10月 2007 15:00     1
  102 06 10月 2007 15:30     1

  Specify the Begin and End Snapshot>  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  输入 begin_snap 的值:  100

  Begin Snapshot>  输入 end_snap 的值:  102

  End   Snapshot>  Specify the Report Name
  ~~~~~~~~~~~~~~~~~~~~~~~
  The default report file name is awrrpt_1_100_102.html.  To use this name,

  press  to continue, otherwise enter an>  输入 report_name 的值:
  Using the report name awrrpt_1_100_102.html
  AWR Report
  ……(省略结果)
  End of Report
  
  Report written to awrrpt_1_100_102.html
  SQL>


运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.iyunv.com/thread-600857-1-1.html 上篇帖子: 使用CallableStatement处理Oracle数据库的存储过程 下篇帖子: linux下创建oracle用户表空间
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

快速回复 返回顶部 返回列表