search
HomeDatabaseMysql Tutorial 《Oracle AWR与ASH性能报告深入解析》-核心参数详解-手操-图文

《OracleAWR与ASH性能报告深入解析》一数据库版本LEO1@LEO1select*fromv$version;BANNER---------------------------------..

                         《Oracle AWR与ASH性能报告深入解析》

一数据库版本

LEO1@LEO1> select * from v$version;

BANNER

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

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

PL/SQL Release 11.2.0.1.0 - Production

CORE 11.2.0.1.0 Production

TNS for Linux: Version 11.2.0.1.0 - Production

NLSRTL Version 11.2.0.1.0 - Production

二 AWR性能诊断报告

AWR:Automatic Workload Repository 自动工作负载信息库

通常在诊断数据库性能的时候分三个阶段

第一阶段:SQL语句级性能优化

第二阶段:session级性能优化,这时我们可以用ASH来做分析

第三阶段:DB级性能优化,AWR就是数据库层性能诊断报告,当我们无法判断数据库哪里性能出现问题时我们可以做一个全身体检报告来找到我们瓶颈所在。

AWR机制:通过对系统整体动态采样收集快照信息,存储在SYSAUX表空间,每小时采样一次,可以保存7天,MMON进程实施,快照分析后写入DBA_HIST_%开头的数据字典。

AWR信息来源:DBA_HIST_%开头的数据字典,请见下图

LEO1@LEO1> select table_name from dictionary where table_name like 'DBA_HIST_%';

TABLE_NAME

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

DBA_HIST_ACTIVE_SESS_HISTORY

DBA_HIST_ASH_SNAPSHOT

DBA_HIST_BASELINE

DBA_HIST_BASELINE_DETAILS

DBA_HIST_BASELINE_METADATA

DBA_HIST_BASELINE_TEMPLATE

DBA_HIST_BG_EVENT_SUMMARY

DBA_HIST_BUFFERED_QUEUES

DBA_HIST_BUFFERED_SUBSCRIBERS

DBA_HIST_BUFFER_POOL_STAT

DBA_HIST_CLUSTER_INTERCON

DBA_HIST_COLORED_SQL

DBA_HIST_COMP_IOSTAT

DBA_HIST_CR_BLOCK_SERVER

DBA_HIST_CURRENT_BLOCK_SERVER

DBA_HIST_DATABASE_INSTANCE

DBA_HIST_DATAFILE

DBA_HIST_DB_CACHE_ADVICE

…………………………………………………

109 rows selected.

AWR信息就是来自上面这些数据字典表,它是把这些表中数据进行汇总统计后生成HTML or TXT格式

LEO1@LEO1> select snap_id,name,value from DBA_HIST_SGA where snap_id>=173 and snap_id

SNAP_ID NAME VALUE

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

173 Database Buffers 117440512

173 Fixed Size 2214856

173 Redo Buffers 8052736

173 Variable Size 385877048

174 Database Buffers 117440512

174 Fixed Size 2214856

174 Redo Buffers 8052736

174 Variable Size 385877048

上面这个例子显示了173-174快照中SGA的信息

OEM可以生成图形化性能分析图,UI版AWR

AWR基线:我们可以在数据库平稳正常的状态下创建AWR基线(参照物),在实际生产中可以作为性能指标曲线的一个参照物,有了基线对比,我们就可以很方便的了解到系统的一个真实的性能趋势。

AWR创建:sqlplus / as system @下面的脚本就可以创建AWR报告了

创建脚本目录:/u01/app/oracle/product/11.2.0/db_1/rdbms/admin/awrrpt.sql

AWR报告分析说明

1. WORKLOAD REPOSITORY report for    

2. DB Name

DB Id

Instance

Inst num

Startup Time

Release

RAC

EMSTA

433507400

emsta1

1

14-Aug-12 22:08

11.2.0.2.0

YES



Host Name

Platform

CPUs

Cores

Sockets

Memory (GB)

emsta1

Solaris[tm] OE (64-bit)

64

32

8

128.00




Snap Id

Snap Time

Sessions

Cursors/Session

Begin Snap:

6023

07-Sep-12 14:00:09

1788

2.8

End Snap:

6026

07-Sep-12 17:00:06

1793

2.9

Elapsed:


179.94 (mins)



DB Time:


79.25 (mins)




数据库名:EMSTA DB ID:433507400 实例名:emsta1 第一个实例 启动时间 版本 是RAC

主机名:emsta1 操作系统平台:Solaris 64位 64颗CPU 32核 内存:128GB

由上述硬件判断这是2台小机组成的RAC模式数据库,上面的是实例1,下面的是实例2,名称后缀不同。

起始快照id:6023

终止快照id:6026 快照与快照间隔1小时从14:00~17:00一共3小时采样信息

起始快照与终止快照间隔时间:180分钟

所有用户使用数据库时间总和(累加值):80分钟

起始时间有1788个会话,每个会话使用2.8个游标

结束时间有1793个会话,,每个会话使用2.9个游标    

DB Name

DB Id

Instance

Inst num

Startup Time

Release

RAC

EMSTA

433507400

emsta2

2

14-Aug-12 22:08

11.2.0.2.0

YES



Host Name

Platform

CPUs

Cores

Sockets

Memory (GB)

emsta2

Solaris[tm] OE (64-bit)

64

32

8

128.00




Snap Id

Snap Time

Sessions

Cursors/Session

Begin Snap:

6023

07-Sep-12 14:00:09

1363

3.0

End Snap:

6026

07-Sep-12 17:00:06

1378

3.0

Elapsed:


179.94 (mins)



DB Time:


136.61 (mins)




实例2中各个部分的含义值和实例1相同,这里不再另外说明

2.cache size    


Begin

End



Buffer Cache:

15,360M

15,360M

Std Block Size:

8K

Shared Pool Size:

6,272M

6,272M

Log Buffer:

111,456K


Instance1:数据库缓冲区15360M

共享池6272M

redo log 缓冲区111.456M

数据块大小8K    

Buffer Cache:

13,696M

13,696M

Std Block Size:

8K

Shared Pool Size:

6,144M

6,144M

Log Buffer:

111,456K


Instance2:数据库缓冲区13696M

共享池6144M

redo log 缓冲区111.456M

数据块大小8K

2个实例的SGA有一点点的大小差异,但是差距不大。

3.Load profile

数据库负载属性信息 美秒 每个事物 每次执行 每次调用    


Per Second

Per Transaction

Per Exec

Per Call

DB Time(s):

0.4

0.3

0.01

0.00

DB CPU(s):

0.4

0.2

0.01

0.00

Redo size:

15,275.9

8,983.0



Logical reads:

13,716.1

8,065.8



Block changes:

79.2

46.6



Physical reads:

365.3

214.8



Physical writes:

4.5

2.7



User calls:

232.7

136.8



Parses:

11.4

6.7



Hard parses:

0.3

0.2



W/A MB processed:

2.7

1.6



Logons:

0.0

0.0



Executes:

54.3

32.0



Rollbacks:

0.0

0.0



Transactions:

1.7





Instance1:逻辑读和物理读较多,是以读为主

Instance2:物理写较多,是以写为主

如果我们有一个基线值,就好比较性能优略了    


Per Second

Per Transaction

Per Exec

Per Call

DB Time(s):

0.8

0.1

0.00

0.00

DB CPU(s):

0.4

0.1

0.00

0.00

Redo size:

102,788.5

11,594.5



Logical reads:

4,287.6

483.6



Block changes:

436.4

49.2



Physical reads:

100.5

11.3



Physical writes:

40.6

4.6



User calls:

261.7

29.5



Parses:

108.9

12.3



Hard parses:

0.1

0.0



W/A MB processed:

0.9

0.1



Logons:

3.1

0.4



Executes:

263.1

29.7



Rollbacks:

0.0

0.0



Transactions:

8.9





业务类型不同关注数据指标也不同

OLAP:关注IO指标

OLTP:关注内存 CPU指标

4.Top 5 Timed Foreground Events


Leonarding
2013.3.10    
天津&spring    
分享技术~成就梦想    
Blog:

本文出自 “刘盛分享技术~成就梦想” 博客,请务必保留此出处

Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Reduce the use of MySQL memory in DockerReduce the use of MySQL memory in DockerMar 04, 2025 pm 03:52 PM

This article explores optimizing MySQL memory usage in Docker. It discusses monitoring techniques (Docker stats, Performance Schema, external tools) and configuration strategies. These include Docker memory limits, swapping, and cgroups, alongside

How to solve the problem of mysql cannot open shared libraryHow to solve the problem of mysql cannot open shared libraryMar 04, 2025 pm 04:01 PM

This article addresses MySQL's "unable to open shared library" error. The issue stems from MySQL's inability to locate necessary shared libraries (.so/.dll files). Solutions involve verifying library installation via the system's package m

How do you alter a table in MySQL using the ALTER TABLE statement?How do you alter a table in MySQL using the ALTER TABLE statement?Mar 19, 2025 pm 03:51 PM

The article discusses using MySQL's ALTER TABLE statement to modify tables, including adding/dropping columns, renaming tables/columns, and changing column data types.

Run MySQl in Linux (with/without podman container with phpmyadmin)Run MySQl in Linux (with/without podman container with phpmyadmin)Mar 04, 2025 pm 03:54 PM

This article compares installing MySQL on Linux directly versus using Podman containers, with/without phpMyAdmin. It details installation steps for each method, emphasizing Podman's advantages in isolation, portability, and reproducibility, but also

What is SQLite? Comprehensive overviewWhat is SQLite? Comprehensive overviewMar 04, 2025 pm 03:55 PM

This article provides a comprehensive overview of SQLite, a self-contained, serverless relational database. It details SQLite's advantages (simplicity, portability, ease of use) and disadvantages (concurrency limitations, scalability challenges). C

Running multiple MySQL versions on MacOS: A step-by-step guideRunning multiple MySQL versions on MacOS: A step-by-step guideMar 04, 2025 pm 03:49 PM

This guide demonstrates installing and managing multiple MySQL versions on macOS using Homebrew. It emphasizes using Homebrew to isolate installations, preventing conflicts. The article details installation, starting/stopping services, and best pra

How do I configure SSL/TLS encryption for MySQL connections?How do I configure SSL/TLS encryption for MySQL connections?Mar 18, 2025 pm 12:01 PM

Article discusses configuring SSL/TLS encryption for MySQL, including certificate generation and verification. Main issue is using self-signed certificates' security implications.[Character count: 159]

What are some popular MySQL GUI tools (e.g., MySQL Workbench, phpMyAdmin)?What are some popular MySQL GUI tools (e.g., MySQL Workbench, phpMyAdmin)?Mar 21, 2025 pm 06:28 PM

Article discusses popular MySQL GUI tools like MySQL Workbench and phpMyAdmin, comparing their features and suitability for beginners and advanced users.[159 characters]

See all articles

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
2 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
Repo: How To Revive Teammates
4 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
Hello Kitty Island Adventure: How To Get Giant Seeds
4 weeks agoBy尊渡假赌尊渡假赌尊渡假赌

Hot Tools

MinGW - Minimalist GNU for Windows

MinGW - Minimalist GNU for Windows

This project is in the process of being migrated to osdn.net/projects/mingw, you can continue to follow us there. MinGW: A native Windows port of the GNU Compiler Collection (GCC), freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All MinGW software can run on 64-bit Windows platforms.

DVWA

DVWA

Damn Vulnerable Web App (DVWA) is a PHP/MySQL web application that is very vulnerable. Its main goals are to be an aid for security professionals to test their skills and tools in a legal environment, to help web developers better understand the process of securing web applications, and to help teachers/students teach/learn in a classroom environment Web application security. The goal of DVWA is to practice some of the most common web vulnerabilities through a simple and straightforward interface, with varying degrees of difficulty. Please note that this software

Atom editor mac version download

Atom editor mac version download

The most popular open source editor

VSCode Windows 64-bit Download

VSCode Windows 64-bit Download

A free and powerful IDE editor launched by Microsoft

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools