Oracle的awr报表分析数据库性能

简介:

早上群里喊数据库挂了,开始阶段服务登录不上,等登录系统后发现系统负载很高。

运行的oracle服务,今天就用oracle的awr作了一把分析,步骤如下:

一、登录数据库

[root@iZ233j4mpnbZ ~]# su - oracle

[oracle@iZ233j4mpnbZ ~]$ sqlplus sys as sysdba

 

SQL*Plus: Release 11.2.0.1.0 Production on Tue Jun 21 14:36:31 2016

 

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

 

Enter password: 

 

Connected to:

Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production

With the Partitioning, OLAP, Data Mining and Real Application Testing options

 

SQL> 

二、数据异常时间段的参数

输入完后,将输出在当前文件夹下。

 #执行对应的awrrpt.sql脚本文件

SQL> @?/rdbms/admin/awrrpt.sql

 

Current Instance

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

 

   DB Id    DB Name Inst Num Instance

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

  745948352 XFIREORC1 xfireorc

 

 

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'

#输入文件类型,默认为html

Enter value for report_type: html

 

Type Specified:  html

 

 

Instances in this Workload Repository schema

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

 

   DB Id     Inst Num DB Name   InstanceHost

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

* 745948352    1 XFIREORC   xfireorciZ233j4mpnbZ

 

Using  745948352 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.

 

 #列出多少天内的快照

Enter value for num_days: 1

 

Listing the last day's Completed Snapshots

 

Snap

Instance     DB Name    Snap Id    Snap Started    Level

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

xfireorc     XFIREORC       9501 21 Jun 2016 00:00   1

      9502 21 Jun 2016 01:00   1

      9503 21 Jun 2016 02:00   1

      9504 21 Jun 2016 03:00   1

      9505 21 Jun 2016 04:01   1

      9506 21 Jun 2016 05:00   1

      9507 21 Jun 2016 06:00   1

      9508 21 Jun 2016 07:00   1

      9509 21 Jun 2016 08:00   1

      9510 21 Jun 2016 09:00   1

      9511 21 Jun 2016 10:00   1

      9512 21 Jun 2016 11:00   1

      9513 21 Jun 2016 12:00   1

      9514 21 Jun 2016 13:00   1

      9515 21 Jun 2016 14:00   1

 

 

 #对应的输入编号,指定分析一个具体时间段内的快照。

Specify the Begin and End Snapshot Ids

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

Enter value for begin_snap: 9511

Begin Snapshot Id specified: 9511

 

Enter value for end_snap: 9512

End   Snapshot Id specified: 9512

 

 

 

Specify the Report Name

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

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

press <return> to continue, otherwise enter an alternative.

 #输入文件名

Enter value for report_name: report10-11

 

Using the report name report10-11

三、分析

将输出的报告,拷贝到本地进行分析。里边的内容有很多,但是真的很强大。也很易懂。

1、分析单条语句造成的Physical Reads(物理读)次数


2、分析语句占用cpu的总的时间

目录
相关文章
|
10月前
|
缓存 关系型数据库 BI
使用MYSQL Report分析数据库性能(下)
使用MYSQL Report分析数据库性能
594 158
|
10月前
|
Oracle 关系型数据库 Linux
【赵渝强老师】Oracle数据库配置助手:DBCA
Oracle数据库配置助手(DBCA)是用于创建和配置Oracle数据库的工具,支持图形界面和静默执行模式。本文介绍了使用DBCA在Linux环境下创建数据库的完整步骤,包括选择数据库操作类型、配置存储与网络选项、设置管理密码等,并提供了界面截图与视频讲解,帮助用户快速掌握数据库创建流程。
838 93
|
9月前
|
Oracle 关系型数据库 Linux
【赵渝强老师】使用NetManager创建Oracle数据库的监听器
Oracle NetManager是数据库网络配置工具,用于创建监听器、配置服务命名与网络连接,支持多数据库共享监听,确保客户端与服务器通信顺畅。
450 0
|
10月前
|
缓存 监控 关系型数据库
使用MYSQL Report分析数据库性能(中)
使用MYSQL Report分析数据库性能
638 156
|
10月前
|
缓存 监控 关系型数据库
使用MYSQL Report分析数据库性能(上)
最终建议:当前系统是完美的读密集型负载模型,优化重点应放在减少行读取量和提高数据定位效率。通过索引优化、分区策略和内存缓存,预期可降低30%的CPU负载,同时保持100%的缓冲池命中率。建议每百万次查询后刷新统计信息以持续优化
756 161
|
10月前
|
SQL Oracle 关系型数据库
Oracle数据库创建表空间和索引的SQL语法示例
以上SQL语法提供了一种标准方式去组织Oracle数据库内部结构,并且通过合理使用可以显著改善查询速度及整体性能。需要注意,在实际应用过程当中应该根据具体业务需求、系统资源状况以及预期目标去合理规划并调整参数设置以达到最佳效果。
656 8
|
10月前
|
关系型数据库 MySQL 数据库
自建数据库如何迁移至RDS MySQL实例
数据库迁移是一项复杂且耗时的工程,需考虑数据安全、完整性及业务中断影响。使用阿里云数据传输服务DTS,可快速、平滑完成迁移任务,将应用停机时间降至分钟级。您还可通过全量备份自建数据库并恢复至RDS MySQL实例,实现间接迁移上云。
|
10月前
|
关系型数据库 MySQL 数据库
阿里云数据库RDS费用价格:MySQL、SQL Server、PostgreSQL和MariaDB引擎收费标准
阿里云RDS数据库支持MySQL、SQL Server、PostgreSQL、MariaDB,多种引擎优惠上线!MySQL倚天版88元/年,SQL Server 2核4G仅299元/年,PostgreSQL 227元/年起。高可用、可弹性伸缩,安全稳定。详情见官网活动页。
1583 152
|
10月前
|
关系型数据库 MySQL 数据库
阿里云数据库RDS支持MySQL、SQL Server、PostgreSQL和MariaDB引擎
阿里云数据库RDS支持MySQL、SQL Server、PostgreSQL和MariaDB引擎,提供高性价比、稳定安全的云数据库服务,适用于多种行业与业务场景。
1100 156

推荐镜像

更多