david database lab

 
 

常用链接

  • 我的随笔
  • 我的评论
  • 我的参与
  • 最新评论

留言簿(3)

  • 给我留言
  • 查看公开留言
  • 查看私人留言

随笔分类

  • 书画 (rss)
  • 围棋 (rss)
  • 地理 (rss)
  • 天文 (rss)
  • 摄影 (rss)
  • 文学 (rss)
  • 旅游 (rss)
  • 电影 (rss)
  • 诗集(3) (rss)
  • 象棋 (rss)
  • 运动 (rss)
  • 音乐 (rss)

随笔档案

  • 2008年9月 (1)
  • 2008年7月 (3)

文章分类

  • AJAX (rss)
  • ARITHEMETIC (rss)
  • C++ (rss)
  • CONFIGURATION (rss)
  • CSS(2) (rss)
  • DB2 (rss)
  • EJB (rss)
  • HQL (rss)
  • HTML(4) (rss)
  • JAVA(9) (rss)
  • JAVASCRIPT(27) (rss)
  • JSP(2) (rss)
  • LINUX(7) (rss)
  • MANUAL (rss)
  • MYSQL (rss)
  • ORACLE(88) (rss)
  • PL/SQL(3) (rss)
  • PL/SQL DEVELOPER (rss)
  • REGEX(1) (rss)
  • RSS(2) (rss)
  • SQL (rss)
  • SQL PLUS (rss)
  • SQL SERVER (rss)
  • SSH (rss)
  • STRUTS(6) (rss)
  • TOAD (rss)
  • XML(1) (rss)
  • 单元测试 (rss)
  • 数据库基础(7) (rss)
  • 数据建模 (rss)
  • 环境部署(5) (rss)
  • 项目设计(1) (rss)

文章档案

  • 2009年11月 (47)
  • 2009年8月 (2)
  • 2009年7月 (2)
  • 2009年6月 (11)
  • 2009年5月 (14)
  • 2009年4月 (2)
  • 2009年2月 (4)
  • 2009年1月 (2)
  • 2008年12月 (5)
  • 2008年11月 (6)
  • 2008年10月 (13)
  • 2008年9月 (3)
  • 2008年8月 (6)
  • 2008年7月 (16)
  • 2008年6月 (31)
  • 2008年5月 (4)

相册

  • goole相册
  • RELAX

收藏夹

  • oracle-DataGuard (rss)
  • oracle-RMAN (rss)
  • oracle体系 (rss)
  • oracle备份恢复 (rss)
  • oracle闪回 (rss)

JavaScript Web

  • gegereka-linux
  • linux 资源文件
  • java2s (rss)
  • java2s
  • onlyaa
  • ORACLE官方论坛
  • rpm.pbone.net
  • rpm资源
  • struts-guide
  • w3school
  • 鸟哥

搜索

  •  

最新评论

  • 1. re: hand in hand
  • I cannot thank you enough for the blog . Really thank you! Really Cool.
  • --zakbut
  • 2. re: oracle之isqlplus登录问题
  • 启动isqlplus
    isqlplus star
  • --广州大道
  • 3. re: 日期日间控件4
  • 显示时间,用户原来选择的时间
  • --LVWallet
  • 4. re: linux -- cpio命令
  • gunzip 10201_database_linux_x86_64.cpio.gz
  • --Goyard
  • 5. re: js 组合框
  • <option value="csdn">csdn</option>
  • --saletopbags

阅读排行榜

  • 1. hand in hand(380)
  • 2. 桃花记(255)
  • 3. 月夜随想(236)
  • 4. 冬至随想(228)

评论排行榜

  • 1. hand in hand(2)
  • 2. 桃花记(0)
  • 3. 月夜随想(0)
  • 4. 冬至随想(0)

Powered by: 博客园
模板提供:沪江博客
BlogJava | 首页 | 发新随笔 | 发新文章 | 联系 | 聚合 | 管理

学用ORACLE AWR和ASH特性 (8)生成ASH报表 转自三思http://www.5ienet.com/note/html/ash_awr/oracle-generate-ash-report.shtml

(8)生成ASH报表
[君三思] 2009-11-7

五、生成ASH报表

  V$ACTIVE_SESSION_HISTORY 视图浏览起来确实方便,不过对于新手朋友其易用性就打了折扣,而且直观性方面也不太好,幸好ORACLE也提供了相应的报表脚本,可以生成指定的时间段内ASH相关的报表。

  ORACLE 提供了两个报表脚本,即可以用来生成数据库级的统计信息,也可以针对RAC架构中某个实例在某个时间段的状态生成统计,下面分别介绍。

1、生成指定时间段时的统计报表

  生成数据库级ASH统计报表使用ashrpt.sql脚本,该文件保存在$ORACLE_HOME/rdbms/admin目录下,基本上操作与AWR脚本非常类似,例如:

    SQL>  @$ORACLE_HOME/rdbms/admin/ashrpt.sql

    Current Instance

    ~~~~~~~~~~~~~~~~

       DB Id    DB Name      Inst Num Instance

    ----------- ------------ -------- ------------

     3812548755 TEST08              1 test08

    Specify the Report Type

    ~~~~~~~~~~~~~~~~~~~~~~~

    Enter ¨html¨ for an HTML report, or ¨text¨ for plain text

    Defaults to ¨html¨

    Enter value for report_type:  html

  这里让选择生成的报表类型,同样是有html和text两种,默认情况下为html类型。

  选完类型后,接下来会显示数据库的一些基本信息,包括ASH收集到的信息的区间

    Type Specified:  html

    Instances in this Workload Repository schema

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

       DB Id     Inst Num DB Name      Instance     Host

    ------------ -------- ------------ ------------ ------------

    * 3812548755        1 TEST08       test08       yans1

    Defaults to current database

    Using database id: 3812548755

    Defaults to current instance

    Using instance number: 1

    ASH Samples in this Workload Repository schema

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    Oldest ASH sample available:  09-10 月-09 10:11:02  [  38853 mins in the past]

    Latest ASH sample available:  05-11 月-09 09:43:09  [      0 mins in the past]

    Specify the timeframe to generate the ASH report

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    Enter begin time for report:

    --    Valid input formats:

    --      To specify absolute begin time:

    --        [MM/DD[/YY]] HH24:MI[:SS]

    --        Examples: 02/23/03 14:30:15

    --                  02/23 14:30:15

    --                  14:30:15

    --                  14:30

    --      To specify relative begin time: (start with ¨-¨ sign)

    --        -[HH24:]MI

    --        Examples: -1:15  (SYSDATE - 1 Hr 15 Mins)

    --                  -25    (SYSDATE - 25 Mins)

    Defaults to -15 mins

    Enter value for begin_time:  -10

  输入报表分析的开始时间,这里即可以输入一个时间类型的字串,比如09/23/2009 14:30:15,也可以直接输入时间,甚至更简单的,输入一个负整数例如-10,表示当前时间前10分钟做为开始时间。

    Report begin time specified: -10

    Enter duration in minutes starting from begin time:

    Defaults to SYSDATE - begin_time

    Press Enter to analyze till current time

    Enter value for duration:  8

  然后要输入统计的时间段,注意哟,不是让输入结束时间,而是说在前面输入的开始时间的基础上,希望收集多长时间内的信息做统计,默认情况下为sysdate-begin_time,即从开始时间到当前时间,这里为了显的与众不同,我就随便敲了个8。

    Report duration specified:   8

    Using 05-11 月-09 09:33:44 as report begin time

    Using 05-11 月-09 09:41:44 as report end time

    ........................

    ........................

    Specify the Report Name

    ~~~~~~~~~~~~~~~~~~~~~~~

    The default report file name is ashrpt_1_1105_0941.html.  To use this name,

    press  to continue, otherwise enter an alternative.

    Enter value for report_name: 

  输入报表的名称,默认会根据前面输入的值来生成一个名称,比如这里默认生成的名称为ashrpt_1_1105_0941.html。

    Using the report name ashrpt_1_1105_0941.html

    Summary of All User Input

    -------------------------

    Format         : HTML

    DB Id          : 3812548755

    Inst num       : 1

    Begin time     : 05-11 月-09 09:33:44

    End time       : 05-11 月-09 09:41:44

    Slot width     : Default

    Report targets : 0

    Report name    : ashrpt_1_1105_0941.html

  报表成功生成,可以随时打开ashrpt_1_1105_0941.html浏览详细信息了。

2、生成指定数据库实例的指定时间段时的统计报表

  对于RAC架构的数据库,有时候DBA可能会希望看到其中某个节点(或实例)的负载情况,这种情况下,可以使用ashwrpi.sql(附加的i应该是表示instance),例如:

    SQL>  @$ORACLE_HOME/rdbms/admin/ashrpti.sql

    Specify the Report Type

    ~~~~~~~~~~~~~~~~~~~~~~~

    Enter ¨html¨ for an HTML report, or ¨text¨ for plain text

    Defaults to ¨html¨

    Enter value for report_type:  html

  选择生成的报表文件类型,仍然选择html类型。

    Type Specified:  html

    Instances in this Workload Repository schema

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

       DB Id     Inst Num DB Name      Instance     Host

    ------------ -------- ------------ ------------ ------------

      948405229         2 JSSDB        jssdbn2      jssdbn2

    * 948405229         1 JSSDB        jssdbn1      jssdbn1

    Defaults to current database

    Enter value for dbid:  948405229

  这里多了两步,首先是要选择数据库的DBID,接下来是选择实例ID。

    Using database id: 948405229

    Defaults to current instance

    Enter value for inst_num:  1

    Using instance number: 1

    ASH Samples in this Workload Repository schema

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    Oldest ASH sample available:  15-Oct-09 21:24:53   [  29499 mins in the past]

    Latest ASH sample available:  05-Nov-09 09:00:56   [      3 mins in the past]

    Specify the timeframe to generate the ASH report

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    Enter begin time for report:

    --    Valid input formats:

    --      To specify absolute begin time:

    --        [MM/DD[/YY]] HH24:MI[:SS]

    --        Examples: 02/23/03 14:30:15

    --                  02/23 14:30:15

    --                  14:30:15

    --                  14:30

    --      To specify relative begin time: (start with ¨-¨ sign)

    --        -[HH24:]MI

    --        Examples: -1:15  (SYSDATE - 1 Hr 15 Mins)

    --                  -25    (SYSDATE - 25 Mins)

    Defaults to -15 mins

    Enter value for begin_time: 

  输入开始的时间,后面的步骤与前面生成数据库级的操作完全相同,不再演示。

  前面介绍的这种种特性以及脚本均是工具,工具永远都只是起辅助的作用,能不能用好,还是取决于使用工具的人,祝好运吧。

发表于 2009-11-23 10:17 javaex 阅读(763) 评论(0)  编辑  收藏 所属分类: ORACLE
 
新用户注册  刷新评论列表  

只有注册用户登录后才能发表评论。


网站导航:
博客园   IT新闻   Chat2DB   C++博客   博问   管理
相关文章:
  • Oracle 10g Scheduler 特性 转自 http://blog.csdn.net/tianlesoftware/archive/2009/10/22/4715218.aspx
  • 全面学习ORACLE Scheduler特性 (12)使用Window和Window Group 转自三思 http://www.5ienet.com/note/html/scheduler/oracle-scheduler-using-window.shtml
  • 全面学习ORACLE Scheduler特性 (11)使用Job Classes 转自三思 http://www.5ienet.com/note/html/scheduler/oracle-scheduler-using-job-classes.shtml
  • 全面学习ORACLE Scheduler特性 (10)使用Chains之管理CHAIN 转自三思 http://www.5ienet.com/note/html/scheduler/oracle-scheduler-alter-chains.shtml
  • 全面学习ORACLE Scheduler特性 (9)使用Chains之创建CHAIN 转自三思 http://www.5ienet.com/note/html/scheduler/oracle-scheduler-create-chains.shtml
  • 全面学习ORACLE Scheduler特性 (8)使用Events之Aapplication抛出的Events 转自三思 http://www.5ienet.com/note/html/scheduler/oracle-scheduler-using-application-events.shtml
  • 全面学习ORACLE Scheduler特性 (7)使用Events之Scheduler抛出的Events 转自三思 http://www.5ienet.com/note/html/scheduler/oracle-scheduler-using-scheduler-events.shtml
  • 全面学习ORACLE Scheduler特性 (6)设置Repeat Interval参数 转自三思 http://www.5ienet.com/note/html/scheduler/oracle-scheduler-repeat_interval.shtml
  • 全面学习ORACLE Scheduler特性 (5)Schedules调度Programs执行的Jobs 转自三思 http://www.5ienet.com/note/html/scheduler/oracle-scheduler-schedule-job-execute.shtml
  • 全面学习ORACLE Scheduler特性 (4)使用和管理Schedules 转自三思 http://www.5ienet.com/note/html/scheduler/oracle-scheduler-create-schedule.shtml