开启辅助访问 切换到宽版

精易论坛

 找回密码
 注册

QQ登录

只需一步,快速开始

用微信号发送消息登录论坛

新人指南 邀请好友注册 - 我关注人的新帖 教你赚取精币 - 每日签到


求职/招聘- 论坛接单- 开发者大厅

论坛版规 总版规 - 建议/投诉 - 应聘版主 - 精华帖总集 积分说明 - 禁言标准 - 有奖举报

查看: 2444|回复: 3
收起左侧

[其它数据库例题] Oracle 11g r1教程:AWR使用

[复制链接]

结帖率:61% (35/57)
发表于 2013-1-13 09:17:04 | 显示全部楼层 |阅读模式   海南省海口市
一、 AWR使用
SQL>@?/rdbms/admin/awrrpt.sql
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
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 的值: 1
Listing the last day's Completed Snapshots
                                                        Snap
Instance     DB Name        Snap Id    Snap Started    Level
------------ ------------ --------- ------------------ -----
orcl10g      ORCL10G            142 03 7月  2009 08:11     1
                                143 03 7月  2009 09:00     1
                                144 03 7月  2009 10:00     1
                                145 03 7月  2009 11:00     1
                                146 03 7月  2009 12:01     1
Specify the Begin and End Snapshot Ids
~~
输入 begin_snap 的值:  142
Begin Snapshot Id specified: 142
输入 end_snap 的值: 146
End   Snapshot Id specified: 146
Specify the Report Name
~~
The default report file name is awrrpt_1_142_146.html.  To use this name,
press to continue, otherwise enter an alternative.
输入 report_name 的值:  /home/oracle/awrrpt_1_142_146.html
Report written to /home/oracle/awrrpt_1_142_146.html
二、AWR管理
(1)关闭awr:
SQL> exec dbms_workload_repository.modify_snapshot_settings(interval=>0);
说明:把interval设为0则已经关闭awr功能。
验证:
SQL> select * from dba_hist_wr_control;
      DBID    SNAP_INTERVAL        RETENTION          TOPNSQL
----------    ------------------- ------------------- ----------
450641661    +40150 00:00:00.0   +00008 00:00:00.0   DEFAULT  

(2)打开awr:
SQL> exec dbms_workload_repository.modify_snapshot_settings(interval=>30, retention=>5*24*60);
说明:收集间隔时间为30分钟一次,并且保留5天时间(单位都是分钟)
如果执行时报错:
SQL> exec dbms_workload_repository.modify_snapshot_settings(interval=>30, retention=>5*24*60);
BEGIN dbms_workload_repository.modify_snapshot_settings(interval=>30, retention=>5*24*60); END;
*
ERROR at line 1:
ORA-13541: system moving window baseline size (691200) greater than retention (432000)
ORA-06512: at "SYS.DBMS_WORKLOAD_REPOSITORY", line 89
ORA-06512: at "SYS.DBMS_WORKLOAD_REPOSITORY", line 137
ORA-06512: at line 1
原因是系统设置的baseline size值(691200)大于此时设置的retention(432000),那么此时有两种方法解决:
方法1:增大retention值,也就是增大保存天数,比如修改为:
SQL> exec dbms_workload_repository.modify_snapshot_settings(interval=>30, retention=>9*24*60);
PL/SQL procedure successfully completed.
验证:
SQL> select * from dba_hist_wr_control;
      DBID    SNAP_INTERVAL        RETENTION          TOPNSQL
----------    ------------------- ------------------- ----------
450641661     +00000 00:30:00.0    +00009 00:00:00.0   DEFAULT

(3)查看快照记录:
select * from sys.wrh$_active_session_history
结帖率:0% (0/4)

签到天数: 3 天

发表于 2018-3-7 22:53:44 | 显示全部楼层   浙江省绍兴市
XP系统连接成功,Windows7系统的连接方法不曾接触过。
回复 支持 反对

使用道具 举报

结帖率:37% (7/19)
发表于 2013-1-21 16:42:32 | 显示全部楼层   北京市北京市
看看这个      
回复 支持 反对

使用道具 举报

结帖率:100% (32/32)

签到天数: 2 天

发表于 2013-1-14 22:51:50 | 显示全部楼层   广东省佛山市
我来消灭0回复..
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则 致发广告者

发布主题 收藏帖子 返回列表

sitemap| 易语言源码| 易语言教程| 易语言论坛| 易语言模块| 手机版| 广告投放| 精易论坛
拒绝任何人以任何形式在本论坛发表与中华人民共和国法律相抵触的言论,本站内容均为会员发表,并不代表精易立场!
论坛帖子内容仅用于技术交流学习和研究的目的,严禁用于非法目的,否则造成一切后果自负!如帖子内容侵害到你的权益,请联系我们!
防范网络诈骗,远离网络犯罪 违法和不良信息举报电话0663-3422125,QQ: 793400750,邮箱:wp@125.la
Powered by Discuz! X3.4 揭阳市揭东区精易科技有限公司 ( 粤ICP备12094385号-1) 粤公网安备 44522102000125 增值电信业务经营许可证 粤B2-20192173

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