度量快速开发平台-专业、快速的软件定制快开平台

 找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
热搜: 部件 流程 SQL
查看: 589|回复: 2
打印 上一主题 下一主题

[分享] oracle awr报告生成和分析

[复制链接]

328

主题

3738

帖子

8566

积分

作者

Rank: 7Rank: 7Rank: 7

积分
8566
QQ
跳转到指定楼层
楼主
发表于 2020-6-29 21:30:06 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

 最近由于数据库cpu占用非常高,导致VCS常常自动切换,引起很多问题。

最近学习一下数据库awr分析数据库sql执行性能的分析报告。下面将初步讲解一下:

1、先登陆数据库,生成awr报告。

linux:~ # su - oracle
oracle@linux:~> sqlplus '/as sysdba'

SQL*Plus: Release 11.1.0.6.0 - Production on Sun Apr 7 14:02:38 2013

Copyright (c) 1982, 2007, Oracle.  All rights reserved.


Connected to:
Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

2、输入分析命令
SQL> @?/rdbms/admin/awrrpt

Current Instance
~~~~~~~~~~~~~~~~

   DB Id    DB Name      Inst Num Instance
----------- ------------ -------- ------------
2045388596 UTF8                1 utf8


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'
Enter value for report_type: html


3、输入要生成报告的文件格式
Type Specified:  html


Instances in this Workload Repository schema
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

   DB Id     Inst Num DB Name      Instance     Host
------------ -------- ------------ ------------ ------------
* 2045388596        1 UTF8         utf8         linux

Using 2045388596 for database Id
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 <return> without
specifying a number lists all completed snapshots.


4、输入要生成报告相隔的天数
Enter value for num_days: 1

Listing the last day's Completed Snapshots

                                                        Snap
Instance     DB Name        Snap Id    Snap Started    Level
------------ ------------ --------- ------------------ -----
utf8         UTF8              2809 26 Oct 2014 00:00      1
                                 2810 26 Oct 2014 01:00      1
                                 2811 26 Oct 2014 02:00      1
                                 2812 26 Oct 2014 03:00      1
                                 2813 26 Oct 2014 04:00      1
                                 2814 26 Oct 2014 05:00      1
                                 2815 26 Oct 2014 06:00      1
                                 2816 26 Oct 2014 07:00      1
                                 2817 26 Oct 2014 08:00      1
                                 2818 26 Oct 2014 09:00      1
                                 2819 26 Oct 2014 10:00      1
                                 2820 26 Oct 2014 11:00      1
                                 2821 26 Oct 2014 12:00      1


5、输入相隔的快照之间的Snap Id开始号和结束号

Specify the Begin and End Snapshot Ids
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Enter value for begin_snap: 2809

Enter value for end_snap: 2821
End   Snapshot Id specified: 2821



Specify the Report Name
~~~~~~~~~~~~~~~~~~~~~~~
The default report file name is awrrpt_1_2809_2821.html.  To use this name,
press <return> to continue, otherwise enter an alternative.


6、输入生成报告的名字:

Enter value for report_name: 20130407awr.html



分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
收藏收藏
回复

使用道具 举报

348

主题

3572

帖子

9250

积分

论坛元老

Rank: 8Rank: 8

积分
9250
沙发
发表于 2020-6-3 01:15:32 | 只看该作者
给你32个赞

点评

谢赞  详情 回复 发表于 2020-6-3 21:33
若現在就覺得失望無力,未來那麽遠妳該怎麽扛...
————————————————————————致自己
回复 支持 反对

使用道具 举报

328

主题

3738

帖子

8566

积分

作者

Rank: 7Rank: 7Rank: 7

积分
8566
QQ
板凳
 楼主| 发表于 2020-6-3 21:33:40 | 只看该作者

谢赞
回复 支持 反对

使用道具 举报

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

本版积分规则

手机版|小黑屋|重庆度量科技  本站关键词:快速开发平台

GMT+8, 2024-9-27 23:28 , Processed in 0.118240 second(s), 26 queries .

Powered by Discuz! X3.2

© 2001-2013 Comsenz Inc.

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