oracle报告指标,Oracle AWR报告指标全解析(二)

2-7  Service Wait Class StatsService Wait Class Stats            Snaps: 70719-70723

-> Wait Class info for services in the Service Statistics section.

-> Total Waits and Time Waited displayed for the following wait

classes:  User I/O, Concurrency, Administrative, Network

-> Time Waited (Wt Time) in seconds

Service Name

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

User I/O  User I/O  Concurcy  Concurcy     Admin     Admin   Network   Network

Total Wts   Wt Time Total Wts   Wt Time Total Wts   Wt Time Total Wts   Wt Time

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

itms-contentmasterdb-prod

33321670     71443    678373    113759         0         0 1.718E+08       127

SYS$USERS

173233      3656      6738        30         2         0     72674         3

itmscmp

676773      1319      1831         0         0         0      2216         0

itscmp

219577       236      1093         0         0         0     18112         0

itscmp_dgmgrl

34         0         8         0         0         0         9         0

SYS$BACKGROUND

71940      1300    320677        56         0         0    442252       872

-------------------------------------------------------------User I/O Total Wts : 对应该服务名下 用户I/O类等待的总的次数

User I/O Wt Time : 对应该服务名下 用户I/O累等待的总时间,单位为 1/100秒

Concurcy Total Wts: 对应该服务名下 Concurrency 类型等待的总次数

Concurcy Wt Time :对应该服务名下 Concurrency 类型等待的总时间, 单位为 1/100秒

Admin Total Wts: 对应该服务名下Admin 类等待的总次数

Admin Wt Time: 对应该服务名下Admin类等待的总时间,单位为 1/100秒

Network Total Wts : 对应服务名下Network类等待的总次数

Network Wt Time: 对应服务名下Network类等待的总事件, 单位为 1/100秒

2-8 Host CPUHost CPU (CPUs:   24 Cores:   12 Sockets:    2)

~~~~~~~~         Load Average

Begin       End     %User   %System      %WIO     %Idle

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

8.41     12.84      24.7       7.1       0.2      65.8

“Load Average”  begin/end值代表每个CPU的大致运行队列大小。上例中快照开始到结束,平均 CPU负载增加了;与《2-5 Operating System Statistics》中的LOAD相呼应。

%User+%System=> 总的CPU使用率,在这里是31.8%

Elapsed Time * NUM_CPUS * CPU utilization= 60.23 (mins)  * 24 * 31.8% = 459.67536 mins=Busy Time

2-8 Instance CPUInstance CPU

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

% of total CPU for Instance:      26.7

% of busy  CPU for Instance:      78.2

%DB time waiting for CPU - Resource Mgr:       0.0

%Total CPU,该实例所使用的CPU占总CPU的比例  % of total CPU for Instance

%Busy CPU,该实例所使用的Cpu占总的被使用CPU的比例  % of busy CPU for Instance

例如共4个逻辑CPU,其中3个被完全使用,3个中的1个完全被该实例使用,则%Total CPU= ? =25%,而%Busy CPU= 1/3= 33%

当CPU高时一般看%Busy CPU可以确定CPU到底是否是本实例消耗的,还是主机上其他程序

% of busy CPU for Instance= (DB CPU+ background cpu time) / (BUSY_TIME /100)= (20,649.1  + 1,980.9)/ (2,894,855 /100)= 78.17%

% of Total CPU for Instance = ( DB CPU+ background cpu time)/( BUSY_TIME+IDLE_TIME/100) = (20,649.1  + 1,980.9)/ ((2,894,855+5,568,240) /100) = 26.73%

%DB time waiting for CPU (Resource Manager)= (RSRC_MGR_CPU_WAIT_TIME/100)/DB TIME

3 TOP SQL

TOP SQL 的数据部分来源于 dba_hist_sqlstat

3-1 SQL ordered by Elapsed Time ,按照SQL消耗的时间来排列TOP SQLSQL ordered by Elapsed Time        Snaps: 70719-70723

-> Resources reported for PL/SQL code includes the resources used by all SQL

statements called by the code.

-> % Total DB Time is the Elapsed Time of the SQL statement divided

into the Total Database Time multiplied by 100

-> %Total - Elapsed Time  as a percentage of Total DB time

-> %CPU   - CPU Time      as a percentage of Elapsed Time

-> %IO    - User I/O Time as a percentage of Elapsed Time

-> Captured SQL account for   53.9% of Total DB Time (s):         883,542

-> Captured PL/SQL account for    0.5% of Total DB Time (s):         883,542

Elapsed                  Elapsed Time

Time (s)    Executions  per Exec (s)  %Total   %CPU    %IO    SQL Id

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

181,411.3         38,848          4.67   20.5     .0     .1 g0yc9szpuu068

注意对于PL/SQL,SQL Statistics不仅会体现该PL/SQL的执行情况,还会包括该PL/SQL包含的SQL语句的情况。如上例一个TOP PL/SQL执行了448s,而这448s中绝大多数是这个PL/SQL下的一个SQL执行500次耗费的。

则该TOP PL/SQL和TOP SQL都上榜,一个执行一次耗时448s,一个执行500次耗时448s。 如此情况则Elapsed Time加起来可能超过100%的Elapsed Time,这是正常的。

对于鹤立鸡群的SQL很有必要一探究竟,跑个@?/rdbms/admin/awrsqrpt看看吧!

Elapsed Time (s): 该SQL累计运行所消耗的时间,

Executions :  该SQL在快照时间内 总计运行的次数    ;  注意, 对于在快照时间内还没有执行完的SQL 不计为1一次,所以如果看到executions=0而 又是TOP SQL,则很有可能是因为该SQL 运行较旧还没执行完,需要特别关注一下。

Elapsed Time per Exec (s):平均每次执行该SQL耗费的时间 , 对于OLTP类型的SELECT/INSERT/UPDATE/DELETE而言平均单次执行时间应当非常短,如0.1秒 或者更短才能满足其业务需求,如果这类轻微的OLTP操作单次也要几秒钟的话,是无法满足对外业务的需求的; 例如你在ATM上提款,并不仅仅是对你的账务库的简单UPDATE,而需要在类似风险控制的前置系统中记录你本次的流水操作记录,实际取一次钱可能要有几十乃至上百个OLTP类型的语句被执行,但它们应当都是十分快速的操作; 如果这些操作也变得很慢,则会出现大量事务阻塞,系统负载升高,DB TIME急剧上升的现象。  对于OLTP数据库而言 如果执行计划稳定,那么这些OLTP操作的性能应当是铁板钉钉的,但是一旦某个因素 发生变化,例如存储的明显变慢、内存换页的大量出现时 则上述的这些transaction操作很可能成数倍到几十倍的变慢,这将让此事务系统短期内不可用。

对于维护操作,例如加载或清除数据,大的跑批次、报表而言 Elapsed Time per Exec (s)高一些是正常的。

%Total  该SQL所消耗的时间占总的DB Time的百分比, 即 (SQL Elapsed Time / Total DB TIME)

% CPU   该SQL 所消耗的CPU 时间 占 该SQL消耗的时间里的比例, 即 (SQL CPU Time / SQL Elapsed Time) ,该指标说明了该语句是否是CPU敏感的

%IO 该SQL 所消耗的I/O 时间 占 该SQL消耗的时间里的比例, 即(SQL I/O Time/SQL Elapsed Time) ,该指标说明了该语句是否是I/O敏感的

SQL Id : 通过计算SQL 文本获得的SQL_ID ,不同的SQL文本必然有不同的SQL_ID, 对于10g~11g而言 只要SQL文本不变那么在数据库之间 该SQL 对应的SQL_ID应当不不变的, 12c中修改了SQL_ID的计算方法

Captured SQL account for   53.9% of Total DB Time (s) 对于不绑定变量的应用来说Top SQL有可能失准,所以要参考本项

3-2  SQL ordered by CPU TimeSQL ordered by CPU Time             Snaps: 70719-70723

-> Resources reported for PL/SQL code includes the resources used by all SQL

statements called by the code.

-> %Total - CPU Time      as a percentage of Total DB CPU

-> %CPU   - CPU Time      as a percentage of Elapsed Time

-> %IO    - User I/O Time as a percentage of Elapsed Time

-> Captured SQL account for   34.9% of Total CPU Time (s):          20,649

-> Captured PL/SQL account for    0.5% of Total CPU Time (s):          20,649

CPU                   CPU per           Elapsed

Time (s)  Executions    Exec (s) %Total   Time (s)   %CPU    %IO    SQL Id

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

1,545.0    1,864,424       0.00    7.5    4,687.8   33.0   65.7 8g6a701j83c8q

Module: MZIndexer

SELECT t0.BOOLEAN_VALUE, t0.CLASS_CODE, t0.CREATED, t0.END_DATE, t0.PRODUCT_ATTR

IBUTE_ID, t0.LAST_MODIFIED, t0.OVERRIDE_FLAG, t0.PRICE, t0.PRODUCT_ATTRIBUTE_TYP

E_ID, t0.PRODUCT_ID, t0.PRODUCT_PUB_RELEASE_TYPE_ID, t0.PRODUCT_VOD_TYPE_ID, t0.

SAP_PRODUCT_ID, t0.START_DATE, t0.STRING_VALUE FROM mz_product_attribute t0 WHER

CPU TIME :   该SQL 在快照时间内累计执行所消耗的CPU 时间片,单位为s

Executions :  该SQL在快照时间内累计执行的次数

CPU per Exec (s) :该SQL 平均单次执行所消耗的CPU时间 ,  即  ( SQL CPU TIME / SQL Executions )

%Total : 该SQL 累计消耗的CPU时间 占  该时段总的 DB CPU的比例,  即 ( SQL CPU TIME /  Total DB CPU)

% CPU   该SQL 所消耗的CPU 时间 占 该SQL消耗的时间里的比例, 即 (SQL CPU Time / SQL Elapsed Time) ,该指标说明了该语句是否是CPU敏感的

%IO 该SQL 所消耗的I/O 时间 占 该SQL消耗的时间里的比例, 即(SQL I/O Time/SQL Elapsed Time) ,该指标说明了该语句是否是I/O敏感的

3-3 Buffer Gets SQL ordered by GetsSQL ordered by Gets               DB/Inst: ITSCMP/itscmp2  Snaps: 70719-70723

-> Resources reported for PL/SQL code includes the resources used by all SQL

statements called by the code.

-> %Total - Buffer Gets   as a percentage of Total Buffer Gets

-> %CPU   - CPU Time      as a percentage of Elapsed Time

-> %IO    - User I/O Time as a percentage of Elapsed Time

-> Total Buffer Gets:   2,021,476,421

-> Captured SQL account for   68.2% of Total

Buffer                 Gets              Elapsed

Gets   Executions   per Exec   %Total   Time (s)   %CPU    %IO    SQL Id

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

4.61155E+08   1,864,424        247.3   22.8    4,687.8   33.0   65.7 8g6a701j83c

注意 buffer gets 逻辑读是消耗CPU TIME的重要源泉, 但并不是说消耗CPU TIME的只有buffer gets。 大多数情况下 SQL order by CPU TIME 和 SQL order by buffers gets 2个部分的TOP SQL 及其排列顺序都是一样的,此种情况说明消耗最多buffer gets的 就是消耗最多CPU 的SQL ,如果我们希望降低系统的CPU使用率,那么只需要调优SQL 降低buffer gets 即可。

但也并不是100%的情况都是如此, CPU TIME的消耗者 还包括 函数运算、PL/SQL 控制、Latch /Mutex 的Spin等等, 所以SQL order by CPU TIME 和 SQL order by buffers gets 2个部分的TOP SQL 完全不一样也是有可能的, 需要因地制宜来探究到底是什么问题导致的High CPU,进而裁度解决之道。

Buffer Gets : 该SQL在快照时间内累计运行所消耗的buffer gets,包括了consistent read 和 current read

Executions :  该SQL在快照时间内累计执行的次数

Gets  per Exec : 该SQL平均单次的buffer gets , 对于事务型transaction操作而言 一般该单次buffer gets小于2000

% Total  该SQL 累计运行所消耗的buffer gets占 总的db buffer gets的比率, (SQL buffer gets / DB total buffer gets)

3-4  Physical Reads  SQL ordered by ReadsSQL ordered by Reads              DB/Inst: ITSCMP/itscmp2  Snaps: 70719-70723

-> %Total - Physical Reads as a percentage of Total Disk Reads

-> %CPU   - CPU Time      as a percentage of Elapsed Time

-> %IO    - User I/O Time as a percentage of Elapsed Time

-> Total Disk Reads:      56,839,035

-> Captured SQL account for   34.0% of Total

Physical              Reads              Elapsed

Reads  Executions per Exec   %Total   Time (s)   %CPU    %IO    SQL Id

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

9,006,163           1 9.0062E+06   15.8      720.9    5.9   80.9 4g36tmp70h185

Physical reads : 该SQL累计运行所消耗的物理读

Executions :  该SQL在快照时间内累计执行的次数

Reads per Exec : 该SQL 单次运行所消耗的物理读,  (SQL Physical reads/Executions) , 对于OLTP transaction 类型的操作而言单次一般不超过100

%Total : 该SQL 累计消耗的物理读 占  该时段总的 物理读的比例,  即 ( SQL physical read  /  Total DB physical read )

3-5 Executions  SQL ordered by ExecutionsSQL ordered by Executions         Snaps: 70719-70723

-> %CPU   - CPU Time      as a percentage of Elapsed Time

-> %IO    - User I/O Time as a percentage of Elapsed Time

-> Total Executions:      48,078,147

-> Captured SQL account for   50.4% of Total

Elapsed

Executions   Rows Processed  Rows per Exec   Time (s)   %CPU    %IO    SQL Id

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

6,327,963      11,249,645            1.8      590.5   47.8   52.7 1avv7759j8r

按照 执行次数来排序的话,也是性能报告对比时一个重要的参考因素,因为如果TOP SQL的执行次数有明显的增长,那么 性能问题的出现也是意料之中的事情了。 当然执行次数最多的,未必便是对性能影响最大的TOP SQL

Executions :  该SQL在快照时间内累计执行的次数

Rows Processed: 该SQL在快照时间内累计执行所处理的总行数

Rows per Exec: SQL平均单次执行所处理的行数,  这个指标在诊断一些 数据问题造成的SQL性能问题时很有用

3-6 Parse Calls     SQL ordered by Parse CallsSQL ordered by Parse Calls          Snaps: 70719-70723

-> Total Parse Calls:       2,160,124

-> Captured SQL account for   58.3% of Total

% Total

Parse Calls  Executions     Parses    SQL Id

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

496,475      577,357     22.98 d07gaa3wntdff

Parse Calls : 解析调用次数, 与上文的 Load Profile中的Parse 数一样 包括 软解析soft parse和硬解析hard parse

Executions :  该SQL在快照时间内累计执行的次数

%Total Parses : 本SQL 解析调用次数 占 该时段数据库总解析次数的比率, 为 (SQL Parse Calls / Total DB Parse Calls)

3-7  SQL ordered by Sharable MemorySQL ordered by Sharable Memory     Snaps: 70719-70723

-> Only Statements with Sharable Memory greater than 1048576 are displayed

Sharable Mem (b)  Executions   % Total    SQL Id

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

8,468,359           39     0.08 au89sasqfb2yn

Module: MZContentBridge

SELECT t0.ASPECT_RATIO, t0.CREATED, t0.FILE_EXTENSION, t0.HEIGHT, t0.VIDEO_FILE_

DIMENSIONS_ID, t0.LAST_MODIFIED, t0.NAME, t0.WIDTH FROM MZ_VIDEO_FILE_DIMENSIONS

t0 WHERE (t0.HEIGHT = :1 AND t0.WIDTH = :2 )

SQL ordered by Sharable Memory ,    一般该部分仅列出Sharable Mem (b)为1 MB以上的SQL 对象 (Only Statements with Sharable Memory greater than 1048576 are displayed)   数据来源是 DBA_HIST_SQLSTAT.SHARABLE_MEM

Shareable Mem(b):  SQL 对象所占用的共享内存使用量

Executions :  该SQL在快照时间内累计执行的次数

%Total :  该SQL 对象锁占共享内存 占总的共享内存的比率

3-8   SQL ordered by Version Count

Version Count  Oracle中的执行计划可以是多版本的,即对于同一个SQL语句有多个不同版本的执行计划,这些执行计划又称作子游标, 而一个SQL语句的文本可以称作一个父游标。 一个父游标对应多个子游标,产生不同子游标的原因是 SQL在被执行时无法共享之前已经生成的子游标, 原因是多种多样的,例如 在本session中做了一个优化器参数的修改 例如optimizer_index_cost_adj 从100 修改到99,则本session的优化环境optimizer env将不同于之前的子游标生成环境,这样就需要生成一个新的子游标,例如:SQL> create table emp as select * from scott.emp;

Table created.

SQL> select * from emp where empno=1;

no rows selected

SQL> select /*+ MACLEAN */ * from emp where empno=1;

no rows selected

SQL> select SQL_ID,version_count from V$SQLAREA WHERE SQL_TEXT like '%MACLEAN%' and SQL_TEXT not like '%like%';

SQL_ID        VERSION_COUNT

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

bxnnm7z1qmg26             1

SQL> select count(*) from v$SQL where SQL_ID='bxnnm7z1qmg26';

COUNT(*)

----------

1

SQL> alter session set optimizer_index_cost_adj=99;

Session altered.

SQL> select /*+ MACLEAN */ * from emp where empno=1;

no rows selected

SQL> select SQL_ID,version_count from V$SQLAREA WHERE SQL_TEXT like '%MACLEAN%' and SQL_TEXT not like '%like%';

SQL_ID        VERSION_COUNT

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

bxnnm7z1qmg26             2

SQL> select count(*) from v$SQL where SQL_ID='bxnnm7z1qmg26';

COUNT(*)

----------

2

SQL> select child_number ,OPTIMIZER_ENV_HASH_VALUE,PLAN_HASH_VALUE from v$SQL where SQL_ID='bxnnm7z1qmg26';

CHILD_NUMBER OPTIMIZER_ENV_HASH_VALUE PLAN_HASH_VALUE

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

0               3704128740      3956160932

1               3636478958      3956160932

可以看到上述 演示中修改optimizer_index_cost_adj=99 导致CBO 优化器的优化环境发生变化, 表现为不同的OPTIMIZER_ENV_HASH_VALUE,之后生成了2个子游标,但是这2个子游标的PLAN_HASH_VALUE同为3956160932,则说明了虽然是不同的子游标但实际子游标里包含了的执行计划是一样的;  所以请注意 任何一个优化环境的变化 (V$SQL_SHARED_CURSOR)以及相关衍生的BUG 都可能导致子游标无法共享,虽然子游标无法共享但这些子游标扔可能包含完全一样的执行计划,这往往是一种浪费。

注意V$SQLAREA.VERSION_COUNT 未必等于select count(*) FROM V$SQL WHERE SQL_ID=”  ,即 V$SQLAREA.VERSION_COUNT 显示的子游标数目 未必等于当前实例中还存有的子游标数目, 由于shared pool aged out算法和其他一些可能导致游标失效的原因存在,所以子游标被清理掉是很常见的事情。 V$SQLAREA.VERSION_COUNT只是一个计数器,它告诉我们曾经生成了多少个child cursor,但不保证这些child 都还在shared pool里面。

此外可以通过v$SQL的child_number字段来分析该问题,如果child_number存在跳号则也说明了部分child被清理了。

子游标过多的影响, 当子游标过多(例如超过3000个时),进程需要去扫描长长的子游标列表child cursor list以找到一个合适的子游标child cursor,进而导致cursor sharing 性能问题 现大量的Cursor: Mutex S 和 library cache lock等待事件。

Executions :  该SQL在快照时间内累计执行的次数

Hash Value :  共享SQL 的哈希值

Only Statements with Version Count greater than 20 are displayed    注意该环节仅列出version count > 20的语句

3-9   Cluster Wait Time SQL ordered by Cluster Wait TimeSQL ordered by Cluster Wait Time  DB/Inst: ITSCMP/itscmp2  Snaps: 70719-70723

-> %Total - Cluster Time  as a percentage of Total Cluster Wait Time

-> %Clu   - Cluster Time  as a percentage of Elapsed Time

-> %CPU   - CPU Time      as a percentage of Elapsed Time

-> %IO    - User I/O Time as a percentage of Elapsed Time

-> Only SQL with Cluster Wait Time > .005 seconds is reported

-> Total Cluster Wait Time (s):         525,480

-> Captured SQL account for   57.2% of Total

Cluster                        Elapsed

Wait Time (s)   Executions %Total    Time(s)   %Clu   %CPU    %IO    SQL Id

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

132,639.3       38,848   25.2  181,411.3   73.1     .0     .1 g0yc9szpuu068

Only SQL with Cluster Wait Time > .005 seconds is reported  这个环节仅仅列出Cluster Wait Time > 0.005 s的SQL

该环节的数据主要来源 于 DBA_HIST_SQLSTAT.CLWAIT_DELTA Delta value of cluster wait time

Cluster Wait Time :   该SQL语句累计执行过程中等待在集群等待上的时间,单位为秒, 你可以理解为 当一个SQL 执行过程中遇到了gc buffer busy、gc cr multi block request 之类的Cluster等待,则这些等待消耗的时间全部算在 Cluster Wait Time里。

Executions :  该SQL在快照时间内累计执行的次数

%Total:  该SQL所消耗的Cluster Wait time 占 总的Cluster Wait time的比率, 为(SQL cluster wait time / DB total cluster Wait Time)

%Clu: 该SQL所消耗的Cluster Wait time 占该SQL 总的耗时的比率,为(SQL cluster wait time / SQL elapsed Time),该指标说明了该语句是否是集群等待敏感的

% CPU   该SQL 所消耗的CPU 时间 占 该SQL消耗的时间里的比例, 即 (SQL CPU Time / SQL Elapsed Time) ,该指标说明了该语句是否是CPU敏感的

%IO 该SQL 所消耗的I/O 时间 占 该SQL消耗的时间里的比例, 即(SQL I/O Time/SQL Elapsed Time) ,该指标说明了该语句是否是I/O敏感的

4 Instance Activity StatsInstance Activity Stats           DB/Inst: ITSCMP/itscmp2  Snaps: 70719-70723

-> Ordered by statistic name

Statistic                                     Total     per Second     per Trans

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

Batched IO (bound) vector count             450,449          124.6           1.8

Batched IO (full) vector count                5,485            1.5           0.0

Batched IO (space) vector count               1,467            0.4           0.0

Batched IO block miss count               4,119,070        1,139.7          16.7

Batched IO buffer defrag count               39,710           11.0           0.2

Batched IO double miss count                297,357           82.3           1.2

Batched IO same unit count                1,710,492          473.3           7.0

Batched IO single block count               329,521           91.2           1.3

Batched IO slow jump count                   47,104           13.0           0.2

Batched IO vector block count             2,069,852          572.7           8.4

Batched IO vector read count                262,161           72.5           1.1

Block Cleanout Optim referenced              37,574           10.4           0.2

CCursor + sql area evicted                    1,457            0.4           0.0

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

Instance Activity Stats  的数据来自于 DBA_HIST_SYSSTAT,DBA_HIST_SYSSTAT来自于V$SYSSTAT。

这里每一个指标都代表一种数据库行为的活跃度,例如redo size 是指生成redo的量,sorts (disk) 是指磁盘排序的次数,table scans (direct read)  是指直接路径扫描表的次数。

虽然这些指标均只有Total、per Second每秒、 per Trans每事务 三个维度,但对诊断问题十分有用。

我们来举几个例子:

1、 例如当 Top Event 中存在direct path read为Top 等待事件, 则需要分清楚是对普通堆表的direct read还是由于大量LOB读造成的direct path read, 这个问题可以借助 table scans (direct read)、table scans (long tables)、physical reads direct   、physical reads direct (lob) 、physical reads direct temporary几个指标来分析, 假设 physical reads direct   >> 远大于 physical reads direct (lob)+physical reads direct temporary , 且有较大的table scans (direct read)、table scans (long tables)  (注意这2个指标代表的是 扫描表的次数 不同于上面的phsical reads 的单位为 块数*次数), 则说明了是 大表扫描引起的direct path read。

2、 例如当 Top Event中存在enq Tx:index contention等待事件, 则需要分析root node splits   、branch node splits   、leaf node 90-10 splits   、leaf node splits 、failed probes on index block rec 几个指标,具体可以见文档《Oracle索引块分裂split信息汇总》

3、系统出现IO类型的等待事件为TOp Five 例如 db file sequential/scattered read ,我们需要通过AWR来获得系统IO吞吐量和IOPS:

physical read bytes 主要是应用造成的物理读取(Total size in bytes of all disk reads by application activity (and not other instance activity) only.) 而physical read total bytes则包括了 rman备份恢复 和后台维护任务所涉及的物理读字节数,所以我们在研究IO负载时一般参考 physical read total bytes;以下4对指标均存在上述的关系physical read bytesphysical read total bytes物理读的吞吐量/秒

physical read IO requestsphysical read total IO requests物理读的IOPS

physical write bytesphysical write total bytes物理写的吞吐量/秒

physical write IO requestsphysical write total IO requests物理写的IOPS

总的物理吞吐量/秒=physical read total bytes+physical write total bytes

总的物理IOPS= physical read total IO requests+ physical write total IO requests

IO的主要指标 吞吐量、IOPS和延迟 均可以从AWR中获得了, IO延迟的信息可以从 User I/O的Wait Class Avg Wait time获得,也可以参考11g出现的IOStat by Function summary

Instance Activity Stats有大量的指标,但是对于这些指标的介绍 没有那一份文档有完整详尽的描述,即便在Oracle原厂内部要没有(或者是Maclean没找到),实际是开发人员要引入某一个Activity Stats是比较容易的,并不像申请引入一个新后台进程那样麻烦,Oracle对于新版本中新后台进程的引入有严格的要求,但Activity Stats却很容易,往往一个one-off patch中就可以引入了,实际上Activity Stats在源代码层仅仅是一些计数器。’

对于深入的指标 例如  “Batched IO (space) vector count”这种由于某些新特性被引入的,一般没有很详细的材料,需要到源代码中去阅读相关模块才能总结其用途,对于这个工作一般原厂是很延迟去完成的,所以没有一个完整的列表。 如果大家有对此的疑问,请去t.askmaclean.com 发一个帖子提问。Instance Activity Stats - Absolute Values  Snaps: 7071

-> Statistics with absolute values (should not be diffed)

Statistic                            Begin Value       End Value

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

session pga memory max           1.157882826E+12 1.154290304E+12

session cursor cache count           157,042,373     157,083,136

session uga memory               5.496429019E+14 5.496775467E+14

opened cursors current                   268,916         265,694

workarea memory allocated                827,704         837,487

logons current                             2,609           2,613

session uga memory max           1.749481584E+13 1.749737418E+13

session pga memory               4.150306913E+11 4.150008177E+11

Instance Activity Stats – Absolute Values是显示快照 起点 和终点的一些指标的绝对值logon current 当前时间点的登录数

opened cursors current 当前打开的游标数

session cursor cache count 当前存在的session缓存游标数

Instance Activity Stats - Thread ActivityDB/Inst: G10R25/G10R25  Snaps: 3663-3

-> Statistics identified by '(derived)' come from sources other than SYSSTAT

Statistic                                     Total  per Hour

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

log switches (derived)                           17  2,326.47

log switches (derived) 日志切换次数 , 见 《理想的在线重做日志切换时间是多长?》

5 IO 统计

5-1 Tablespace IO Stats  基于表空间分组的IO信息Tablespace IO Stats               DB/Inst: ITSCMP/itscmp2  Snaps: 70719-70723

-> ordered by IOs (Reads + Writes) desc

Tablespace

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

Av       Av     Av                       Av     Buffer  Av Buf

Reads Reads/s  Rd(ms) Blks/Rd       Writes Writes/s      Waits  Wt(ms)

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

DATA_TS

17,349,398   4,801     2.3     1.5      141,077       39  4,083,704     5.8

INDEX_TS

9,193,122   2,544     2.0     1.0      238,563       66  3,158,187    46.1

UNDOTBS1

1,582,659     438     0.7     1.0            2        0     12,431    69.0

reads : 指 该表空间上发生的物理读的次数(单位不是块,而是次数)

Av Reads/s : 指该表空间上平均每秒的物理读次数 (单位不是块,而是次数)

Av Rd(ms): 指该表空间上每次读的平均读取延迟

Av Blks/Rd: 指该表空间上平均每次读取的块数目,因为一次物理读可以读多个数据块;如果Av Blks/Rd>>1 则可能系统有较多db file scattered read 可能是诊断FULL TABLE SCAN或FAST FULL INDEX SCAN,需要关注table scans (long tables) 和index fast full scans (full)   2个指标

Writes : 该表空间上发生的物理写的次数 ;  对于那些Writes总是等于0的表空间 不妨了解下是否数据为只读,如果是可以通过read only tablespace来解决 RAC中的一些性能问题。

Av Writes/s  : 指该表空间上平均每秒的物理写次数

buffer Waits:  该表空间上发生buffer busy waits和read by other session的次数( 9i中buffer busy waits包含了read by other session)。

Av Buf Wt(ms):  该表空间上发生buffer Waits的平均等待时间,单位为ms

5-2 File I/OFile IO Stats                    Snaps: 70719-70723

-> ordered by Tablespace, File

Tablespace               Filename

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

Av       Av     Av                       Av     Buffer  Av Buf

Reads Reads/s  Rd(ms) Blks/Rd       Writes Writes/s      Waits  Wt(ms)

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

AMG_ALBUM_IDX_TS         +DATA/itscmp/plugged/data2/amg_album_idx_ts01.dbf

23,298       6     0.6     1.0            2        0          0     0.0

AMG_ALBUM_IDX_TS         +DATA/itscmp/plugged/data3/amg_album_idx_ts02.dbf

3,003       1     0.6     1.0            2        0          0     0.0

Tablespace 表空间名

FileName  数据文件的路径

Reads: 该数据文件上累计发生过的物理读次数,不是块数

Av Reads/s: 该数据文件上平均每秒发生过的物理读次数,不是块数

Av Rd(ms): 该数据文件上平均每次物理读取的延迟,单位为ms

Av Blks/Rd:  该数据文件上平均每次读取涉及到的块数,OLTP环境该值接近 1

Writes : 该数据文件上累计发生过的物理写次数,不是块数

Av Writes/s: 该数据文件上平均每秒发生过的物理写次数,不是块数

buffer Waits:  该数据文件上发生buffer busy waits和read by other session的次数( 9i中buffer busy waits包含了read by other session)。

Av Buf Wt(ms):  该数据文件上发生buffer Waits的平均等待时间,单位为ms

若某个表空间上有较高的IO负载,则有必要分析一下 是否其所属的数据文件上的IO 较为均匀 还是存在倾斜, 是否需要结合存储特征来 将数据均衡分布到不同磁盘上的数据文件上,以优化 I/O

6 缓冲池统计 Buffer Pool StatisticsBuffer Pool Statistics              Snaps: 70719-70723

-> Standard block size Pools  D: default,  K: keep,  R: recycle

-> Default Pools for other block sizes: 2k, 4k, 8k, 16k, 32k

Free   Writ   Buffer

Number of Pool       Buffer     Physical    Physical   Buff   Comp     Busy

P      Buffers Hit%         Gets        Reads      Writes   Wait   Wait    Waits

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

16k     15,720  N/A            0            0           0      0      0        0

D    2,259,159   98 2.005084E+09   42,753,650     560,460      0      1 8.51E+06

该环节的数据主要来源于WRH$_BUFFER_POOL_STATISTICS, 而WRH$_BUFFER_POOL_STATISTICS是定期汇总v$SYSSTAT中的数据

P   pool池的名字   D: 默认的缓冲池 default buffer pool  , K : Keep Pool , R: Recycle Pool ;  2k 4k 8k  16k 32k: 代表各种非标准块大小的缓冲池

Number of buffers:  实际的 缓冲块数目,   约等于  池的大小 / 池的块大小

Pool Hit % :  该缓冲池的命中率

Buffer Gets: 对该缓冲池的中块的访问次数 包括  consistent gets 和 db block gets

Physical Reads: 该缓冲池Buffer Cache引起了多少物理读, 其实是physical reads cache ,单位为 块数*次数

Physical Writes :该缓冲池中Buffer cache被写的物理写, 其实是physical writes from cache, 单位为 块数*次数

Free Buffer Waits:  等待空闲缓冲的次数, 可以看做该buffer pool 发生free buffer waits 等待的次数

Write Comp Wait:   等待DBWR写入脏buffer到磁盘的次数, 可以看做该buffer pool发生write complete waits等待的次数

Buffer Busy Waits:  该缓冲池发生buffer busy wait 等待的次数

7-1 Checkpoint Activity  检查点与 Instance Recovery Stats    实例恢复Checkpoint Activity         Snaps: 70719-70723

-> Total Physical Writes:                      590,563

Other    Autotune      Thread

MTTR    Log Size    Log Ckpt    Settings        Ckpt        Ckpt

Writes      Writes      Writes      Writes      Writes      Writes

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

0           0           0           0      12,899           0

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

Instance Recovery Stats     Snaps: 70719-70723

-> B: Begin Snapshot,  E: End Snapshot

Estd

Targt  Estd                                     Log Ckpt Log Ckpt    Opt   RAC

MTTR   MTTR Recovery  Actual   Target   Log Sz   Timeout Interval    Log Avail

(s)    (s) Estd IOs RedoBlks RedoBlks RedoBlks RedoBlks RedoBlks  Sz(M)  Time

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

B     0     6    12828   477505  1786971  5096034  1786971      N/A    N/A     3

E     0     7    16990   586071  2314207  5096034  2314207      N/A    N/A     3

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

该环节的数据来源于WRH$_INSTANCE_RECOVERY

MTTR  Writes  :   为了满足FAST_START_MTTR_TARGET 指定的MTTR值 而做出的物理写  WRITES_MTTR

Log Size Writes :由于最小的redo log file而做出的物理写 WRITES_LOGFILE_SIZE

Log Ckpt writes: 由于 LOG_CHECKPOINT_INTERVAL 和 LOG_CHECKPOINT_TIMEOUT 驱动的增量检查点而做出的物理写 WRITES_LOG_CHECKPOINT_SETTINGS

Other Settings Writes :由于其他设置(例如FAST_START_IO_TARGET)而引起的物理写,  WRITES_OTHER_SETTINGS

Autotune Ckpt Writes : 由于自动调优检查点而引起的物理写, WRITES_AUTOTUNE

Thread Ckpt Writes :由于thread checkpoint而引起的物理写,WRITES_FULL_THREAD_CKPT

B 代表 开始点, E 代表结尾

Targt MTTR (s) : 目标MTTR (mean time to recover)意为有效恢复时间,单位为秒。 TARGET_MTTR 的计算基于 给定的参数FAST_START_MTTR_TARGET,而TARGET_MTTR作为内部使用。 实际在使用中 Target MTTR未必能和FAST_START_MTTR_TARGET一样。 如果FAST_START_MTTR_TARGET过小,那么TARGET_MTTR 将是系统条件所允许的最小估算值;  如果FAST_START_MTTR_TARGET过大,则TARGET_MTTR以保守算法计算以获得完成恢复的最长估算时间。

estimated_mttr (s):   当前基于 脏buffer和重做日志块的数量,而评估出的有效恢复时间 。 它的估算告诉用户 以当下系统的负载若发生实例crash,则需要多久时间来做crash recovery的前滚操作,之后才能打开数据库。

Recovery Estd IOs :实际是当前buffer cache中的脏块数量,一旦实例崩溃 这些脏块要被前滚

Actual RedoBlks :  当前实际需要恢复的redo重做块数量

Target RedoBlks :是 Log Sz RedoBlks 、Log Ckpt  Timeout  RedoBlks、 Log Ckpt Interval  RedoBlks 三者的最小值

Log Sz RedoBlks :   代表 必须在log file switch日志切换之前完成的 checkpoint 中涉及到的redo block,也叫max log lag; 数据来源select LOGFILESZ   from X$targetrba;  select LOG_FILE_SIZE_REDO_BLKS from v$instance_recovery;

Log Ckpt Timeout RedoBlks : 为了满足LOG_CHECKPOINT_TIMEOUT  所需要处理的redo block数,lag for checkpoint timeout ; 数据来源select CT_LAG from x$targetrba;

Log Ckpt Interval RedoBlks :为了满足LOG_CHECKPOINT_INTERVAL 所需要处理的redo block数, lag for checkpoint interval; 数据来源select CI_LAG from x$targetrba;

Opt Log Sz(M) :  基于FAST_START_MTTR_TARGET 而估算出来的redo logfile 的大小,单位为MB 。 Oracle官方推荐创建的重做日志大小至少大于这个估算值

Estd RAC Avail Time  :指评估的 RAC中节点失败后 集群从冻结到部分可用的时间, 这个指标仅在RAC中可用,单位为秒。 ESTD_CLUSTER_AVAILABLE_TIME

7-2 Buffer Pool Advisory 缓冲池建议Buffer Pool Advisory                      DB/Inst: ITSCMP/itscmp2  Snap: 70723

-> Only rows with estimated physical reads >0 are displayed

-> ordered by Block Size, Buffers For Estimate

Est

Phys      Estimated                  Est

Size for   Size      Buffers   Read     Phys Reads     Est Phys %DBtime

P    Est (M) Factor  (thousands) Factor    (thousands)    Read Time for Rds

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

D      1,920     .1          227    4.9  1,110,565,597            1 1.0E+09

D      3,840     .2          454    3.6    832,483,886            1 7.4E+08

D      5,760     .3          680    2.8    634,092,578            1 5.6E+08

D      7,680     .4          907    2.2    500,313,589            1 4.3E+08

D      9,600     .5        1,134    1.8    410,179,557            1 3.5E+08

D     11,520     .6        1,361    1.5    348,214,283            1 2.9E+08

D     13,440     .7        1,588    1.3    304,658,441            1 2.5E+08

D     15,360     .8        1,814    1.2    273,119,808            1 2.2E+08

D     17,280     .9        2,041    1.1    249,352,943            1 2.0E+08

D     19,200    1.0        2,268    1.0    230,687,206            1 1.8E+08

D     19,456    1.0        2,298    1.0    228,664,269            1 1.8E+08

D     21,120    1.1        2,495    0.9    215,507,858            1 1.7E+08

D     23,040    1.2        2,722    0.9    202,816,787            1 1.6E+08

D     24,960    1.3        2,948    0.8    191,974,196            1 1.5E+08

D     26,880    1.4        3,175    0.8    182,542,765            1 1.4E+08

D     28,800    1.5        3,402    0.8    174,209,199            1 1.3E+08

D     30,720    1.6        3,629    0.7    166,751,631            1 1.2E+08

D     32,640    1.7        3,856    0.7    160,002,420            1 1.2E+08

D     34,560    1.8        4,082    0.7    153,827,351            1 1.1E+08

D     36,480    1.9        4,309    0.6    148,103,338            1 1.1E+08

D     38,400    2.0        4,536    0.6    142,699,866            1 1.0E+08

缓冲池的颗粒大小 可以参考 SELECT * FROM V$SGAINFO where name like(‘Granule%’);

P 指 缓冲池的名字  可能包括 有 D default buffer pool , K  Keep Pool , R recycle Pool

Size For Est(M):  指以该尺寸的buffer pool作为评估的对象,一般是 目前current size的 10% ~ 200%,以便了解 buffer pool 增大 ~减小 对物理读的影响

Size Factor :  尺寸因子, 只 对应buffer pool 大小  对 当前设置的比例因子, 例如current_size是 100M , 则如果评估值是110M 那么 size Factor 就是 1.1

Buffers (thousands) :指这个buffer pool 尺寸下的buffer 数量, 要乘以1000才是实际值

Est  Phys Read Factor :评估的物理读因子, 例如当前尺寸的buffer pool 会引起100个物理读, 则别的尺寸的buffer pool如果引起 120个物理读, 那么 对应尺寸的Est  Phys Read Factor就是1.2

Estimated Phys Reads (thousands):评估的物理读数目, 要乘以 1000才是实际值, 显然不同尺寸的buffer pool对应不同的评估的物理读数目

Est Phys Read Time : 评估的物理读时间

Est %DBtime for Rds:评估的物理读占DB TIME的比率

我们 看buffer pool advisory 一般有2个目的:在物理读较多的情况下,希望通过增加buffer pool 大小来缓解物理读等待,这是我们关注Size Factor > 1的buffer pool尺寸是否能共有效减少Est Phys Read  Factor, 如果Est Phys Read  Factor随着Size Factor 增大 而显著减少,那么说明增大buffer cache 是可以有效减少物理读的。

在内存紧张的情况下 ,希望从buffer pool中匀出部分内存来移作他用, 但是又不希望 buffer cache变小导致 物理读增多 性能下降, 则此时 观察Est Phys Read  Factor 是否随着Size Factor 减小而 显著增大, 如果不是 则说明减少部分buffer cache 不会导致 物理读大幅增加,也就可以安心 减少 buffer cache

注意 Size Factor 和 Est Phys Read  Factor之间不是简单的 线性关系,所以需要人为介入评估得失

7-3 PGA Aggr SummaryPGA Aggr Summary                 Snaps: 70719-70723

-> PGA cache hit % - percentage of W/A (WorkArea) data processed only in-memory

PGA Cache Hit %   W/A MB Processed  Extra W/A MB Read/Written

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

99.9            412,527                        375

PGA Cache Hit % : 指 W/A WorkArea工作区的数据仅在内存中处理的比率, PGA缓存命中率

workarea是PGA中负责处理 排序、哈希连接和位图合并操作的区域; workarea 也叫做 SQL 作业区域

W/A  MB processes:   指 在Workarea中处理过的数据的量,单位为MB

Extra W/A MB Read/Written :  指额外从磁盘上 读写的 工作区数据, 单位为 MB

7-4 PGA Aggr Target StatsWarning:  pga_aggregate_target was set too low for current workload, as this

value was exceeded during this interval.  Use the PGA Advisory view

to help identify a different value for pga_aggregate_target.

PGA Aggr Target Stats       Snaps: 70719-70723

-> B: Begin Snap   E: End Snap (rows dentified with B or E contain data

which is absolute i.e. not diffed over the interval)

-> Auto PGA Target - actual workarea memory target

-> W/A PGA Used    - amount of memory used for all Workareas (manual + auto)

-> %PGA W/A Mem    - percentage of PGA memory allocated to workareas

-> %Auto W/A Mem   - percentage of workarea memory controlled by Auto Mem Mgmt

-> %Man W/A Mem    - percentage of workarea memory under manual control

%PGA  %Auto   %Man

PGA Aggr   Auto PGA   PGA Mem    W/A PGA     W/A    W/A    W/A Global Mem

Target(M)  Target(M)  Alloc(M)    Used(M)     Mem    Mem    Mem   Bound(K)

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

B      8,192        512   23,690.5      150.1     .6  100.0     .0    838,860

E      8,192        512   23,623.6      156.9     .7  100.0     .0    838,860

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

此环节的数据来源主要是 WRH$_PGASTAT

PGA Aggr  Target(M) :本质上就是pga_aggregate_target , 当然在AMM(memory_target)环境下 这个值可能会自动变化

Auto PGA Target(M)  : 在自动PGA 管理模式下 实际可用的工作区内存  “aggregate PGA auto target “, 因为PGA还有其他用途 ,不能全部作为workarea memory

PGA Mem Alloc(M) :目前已分配的PGA内存,  alloc  不等于 inuse 即分配的内存不等于在使用的内存,理论上PGA会将确实不使用的内存返回给OS(PGA memory freed back to OS) ,但是存在PGA占用大量内存而不释放的场景

在上例中 pga_aggregate_target 仅为8192M ,而实际processes 在 2,615~ 8000之间,如果一个进程耗费5MB的PGA 也需要 10000M的PGA ,而实际这里 PGA Mem Alloc(M)是23,690 M ,这说明 存在PGA 的过载, 需要调整pga_aggregate_target

W/A PGA Used(M) :所有的工作区workarea(包括manual和 auto)使用的内存总和量, 单位为MB

%PGA W/A Mem:  分配给workarea的内存量占总的PGA的比例,  (W/A PGA Used)/PGA Mem Alloc

%Auto W/A Mem : AUTO 自动工作区管理所控制的内存(workarea_size_policy=AUTO) 占总的workarea内存的比例

%Man W/A Mem : MANUAL 手动工作区管理所控制的内存(workarea_size_policy=MANUAL)占总的workarea内存的比例

Global Mem Bound(K) : 指 在自动PGA管理模式下一个工作区所能分配的最大内存(注意 一个SQL执行过程中可能有多个工作区workarea)。 Global Mem Bound(K)这个指标在实例运行过程中将被持续性的修正,以反应数据库当时工作区的负载情况。显然在有众多活跃工作区的系统负载下相应地Global Mem Bound将会下降。 但应当保持global bound值不要小于1 MB , 否则建议 调高pga_aggregate_target

7-5 PGA Aggr Target HistogramPGA Aggr Target Histogram           Snaps: 70719-70723

-> Optimal Executions are purely in-memory operations

Low     High

Optimal Optimal    Total Execs  Optimal Execs 1-Pass Execs M-Pass Execs

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

2K      4K        262,086        262,086            0            0

64K    128K            497            497            0            0

128K    256K            862            862            0            0

256K    512K            368            368            0            0

512K   1024K        440,585        440,585            0            0

1M      2M         68,313         68,313            0            0

2M      4M            169            161            8            0

4M      8M             50             42            8            0

8M     16M             82             82            0            0

16M     32M              1              1            0            0

32M     64M             12             12            0            0

128M    256M              2              0            2            0

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

数据来源:WRH$_SQL_WORKAREA_HISTOGRAM

Low Optimal: 此行所包含工作区workarea最适合内存要求的下限

High Optimal: 此行所包含工作区workarea最适合内存要求的上限

Total Execs: 在 Low Optimal~High Optimal 范围工作区内完成的总执行数

Optimal execs: optimal 执行是指完全在PGA内存中完成的执行次数

1-pass Execs :  指操作过程中仅发生1次磁盘读取的执行次数

M-pass Execs:  指操作过程中发生了1次以上的磁盘读取, 频发磁盘读取的执行次数

7-6 PGA Memory Advisory

PGA Memory Advisory                  Snap: 70723

-> When using Auto Memory Mgmt, minimally choose a pga_aggregate_target value

where Estd PGA Overalloc Count is 0

Estd Extra    Estd P Estd PGA

PGA Target    Size           W/A MB   W/A MB Read/    Cache Overallo    Estd

Est (MB)   Factr        Processed Written to Disk   Hit %    Count    Time

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

1,024     0.1  2,671,356,938.7    387,531,258.9   87.0 1.07E+07 7.9E+11

2,048     0.3  2,671,356,938.7    387,529,979.1   87.0 1.07E+07 7.9E+11

4,096     0.5  2,671,356,938.7    387,518,881.8   87.0 1.07E+07 7.9E+11

6,144     0.8  2,671,356,938.7    387,420,749.5   87.0 1.07E+07 7.9E+11

8,192     1.0  2,671,356,938.7     23,056,196.5   99.0 1.07E+07 6.9E+11

9,830     1.2  2,671,356,938.7     22,755,192.6   99.0 6.81E+06 6.9E+11

11,469     1.4  2,671,356,938.7     20,609,438.5   99.0 4.15E+06 6.9E+11

13,107     1.6  2,671,356,938.7     19,021,139.1   99.0  581,362 6.9E+11

14,746     1.8  2,671,356,938.7     18,601,191.0   99.0  543,531 6.9E+11

16,384     2.0  2,671,356,938.7     18,561,361.1   99.0  509,687 6.9E+11

24,576     3.0  2,671,356,938.7     18,527,422.3   99.0  232,817 6.9E+11

32,768     4.0  2,671,356,938.7     18,511,872.6   99.0  120,180 6.9E+11

49,152     6.0  2,671,356,938.7     18,500,815.3   99.0    8,021 6.9E+11

65,536     8.0  2,671,356,938.7     18,498,733.0   99.0        0 6.9E+11

PGA Target   Est (MB)  用以评估的 PGA_AGGREGATE _TARGET值

Size Factr   , 当前用以评估的PGA_AGGREGATE _TARGET 和 当前实际设置的PGA_AGGREGATE _TARGET 之间的 比例因子  PGA Target Est / PGA_AGGREGATE_TARGE

W/A MB Processed :workarea中要处理的数据量, 单位为MB

Estd Extra  W/A MB Read/ Written to Disk :   以 one-pass 、M-Pass方式处理的数据量预估值, 单位为MB

Estd P Cache Hit % :  预估的PGA缓存命中率

Estd PGA Overalloc Count: 预估的PGA过载量, 如上文所述PGA_AGGREGATE _TARGET仅是一个目标值,无法真正限制PGA内存的使用,当出现 PGA内存硬性需求时会产生PGA overallocate 过载(When using Auto Memory Mgmt, minimally choose a pga_aggregate_target value where Estd PGA Overalloc Count is 0)

7-7  Shared Pool AdvisoryShared Pool Advisory                Snap: 70723

-> SP: Shared Pool     Est LC: Estimated Library Cache   Factr: Factor

-> Note there is often a 1:Many correlation between a single logical object

in the Library Cache, and the physical number of memory objects associated

with it.  Therefore comparing the number of Lib Cache objects (e.g. in

v$librarycache), with the number of Lib Cache Memory Objects is invalid.

Est LC Est LC  Est LC Est LC

Shared    SP   Est LC                  Time   Time    Load   Load       Est LC

Pool  Size     Size       Est LC    Saved  Saved    Time   Time      Mem Obj

Size(M) Factr      (M)      Mem Obj      (s)  Factr     (s)  Factr     Hits (K)

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

304    .8       56        3,987    7,728    1.0      61    1.4          332

352    .9      101        6,243    7,745    1.0      44    1.0          334

400   1.0      114        7,777    7,745    1.0      44    1.0          334

448   1.1      114        7,777    7,745    1.0      44    1.0          334

496   1.2      114        7,777    7,745    1.0      44    1.0          334

544   1.4      114        7,777    7,745    1.0      44    1.0          334

592   1.5      114        7,777    7,745    1.0      44    1.0          334

640   1.6      114        7,777    7,745    1.0      44    1.0          334

688   1.7      114        7,777    7,745    1.0      44    1.0          334

736   1.8      114        7,777    7,745    1.0      44    1.0          334

784   2.0      114        7,777    7,745    1.0      44    1.0          334

832   2.1      114        7,777    7,745    1.0      44    1.0          334

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

Shared  Pool  Size(M) :  用以评估的shared pool共享池大小,在AMM /ASMM环境下 shared_pool 大小都可能浮动

SP Size Factr :共享池大小的比例因子, (Shared Pool Size for Estim / SHARED_POOL_SIZE)

Estd LC Size(M) : 评估的 library cache 大小 ,单位为MB , 因为是shared pool中包含 library cache 当然还有其他例如row cache

Est LC Mem Obj   指评估的指定大小的共享池内的library cache memory object的数量  ESTD_LC_MEMORY_OBJECTS

Est LC Time Saved(s):   指在 指定的共享池大小情况下可找到需要的library cache memory objects,从而节约的解析时间 。  这些节约的解析时间也是 花费在共享池内重复加载需要的对象(reload),这些对象可能因为共享池没有足够的free memory而被aged out.  ESTD_LC_TIME_SAVED

Est LC Time Saved Factr : Est LC Time Saved(s)的比例因子,(  Est LC Time Saved(s)/ Current LC Time Saved(s) )   ESTD_LC_TIME_SAVED_FACTOR

Est LC Load Time (s):  在指定的共享池大小情况下解析的耗时

Est LC Load Time Factr:Est LC Load Time (s)的比例因子, (Est LC Load Time (s)/ Current LC Load Time (s))         ESTD_LC_LOAD_TIME_FACTOR

Est LC  Mem Obj Hits (K) :  在指定的共享池大小情况下需要的library cache memory object正好在共享池中被找到的次数  ESTD_LC_MEMORY_OBJECT_HITS;

对于想缩小 shared_pool_size 共享池大小的需求,可以关注Est LC  Mem Obj Hits (K) ,如上例中共享池为352M时Est LC  Mem Obj Hits (K) 就为334且之后不动,则可以考虑缩小shared_pool_size到该值,但要注意每个版本/平台上对共享池的最低需求,包括RAC中gcs resource 、gcs shadow等资源均驻留在shared pool中,增大db_cache_size时要对应关注。

7-8 SGA Target AdvisorySGA Target Advisory    Snap: 70723

SGA Target   SGA Size       Est DB     Est Physical

Size (M)     Factor     Time (s)            Reads

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

3,752        0.1 1.697191E+09 1.4577142918E+12

7,504        0.3 1.222939E+09  832,293,601,354

11,256        0.4 1.000162E+09  538,390,923,784

15,008        0.5  895,087,191  399,888,743,900

18,760        0.6  840,062,594  327,287,716,803

22,512        0.8  806,389,685  282,881,041,331

26,264        0.9  782,971,706  251,988,446,808

30,016        1.0  765,293,424  228,664,652,276

33,768        1.1  751,135,535  210,005,616,650

37,520        1.3  739,350,016  194,387,820,900

41,272        1.4  733,533,785  187,299,216,679

45,024        1.5  732,921,550  187,299,216,679

48,776        1.6  732,691,962  187,299,216,679

52,528        1.8  732,538,908  187,299,216,679

56,280        1.9  732,538,917  187,299,216,679

60,032        2.0  732,462,391  187,299,458,716

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

该环节数据来源于WRH$_SGA_TARGET_ADVICE

SGA target Size   : 用以评估的sga target大小 (sga_target)

SGA Size Factor:  SGA Size的比例因子,  (est SGA target Size / Current SGA target Size )

Est DB Time (s): 评估对应于该指定sga target size会产生多少量的DB TIME,单位为秒

Est Physical Reads:评估对应该指定的sga target size 会产生多少的物理读

7-9 Streams Pool AdvisoryStreams Pool Advisory                     DB/Inst: ITSCMP/itscmp2  Snap: 70723

Size for      Size   Est Spill   Est Spill Est Unspill Est Unspill

Est (MB)    Factor       Count    Time (s)       Count    Time (s)

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

64       0.5           0           0           0           0

128       1.0           0           0           0           0

192       1.5           0           0           0           0

256       2.0           0           0           0           0

320       2.5           0           0           0           0

384       3.0           0           0           0           0

448       3.5           0           0           0           0

512       4.0           0           0           0           0

576       4.5           0           0           0           0

640       5.0           0           0           0           0

704       5.5           0           0           0           0

768       6.0           0           0           0           0

832       6.5           0           0           0           0

896       7.0           0           0           0           0

960       7.5           0           0           0           0

1,024       8.0           0           0           0           0

1,088       8.5           0           0           0           0

1,152       9.0           0           0           0           0

1,216       9.5           0           0           0           0

1,280      10.0           0           0           0           0

该环节只有当使用了Streams  流复制时才会有必要数据, 数据来源 WRH$_STREAMS_POOL_ADVICE

Size for Est (MB) : 用以评估的 streams pool大小

Size Factor :streams pool大小的比例因子

Est Spill Count  :评估出的 当使用该大小的流池时 message溢出到磁盘的数量 ESTD_SPILL_COUNT

Est Spill Time (s): 评估出的 当使用该大小的流池时 message溢出到磁盘的耗时,单位为秒 ESTD_SPILL_TIME

Est Unspill Count:评估的 当使用该大小的流池时 message unspill 即从磁盘上读取的数量 ESTD_UNSPILL_COUNT

Est Unspill Time (s) : 评估的 当使用该大小的流池时 message unspill 即从磁盘上读取的耗时,单位为秒 ESTD_UNSPILL_TIME

7-10 Java Pool Advisory

java pool的相关指标与shared pool相似,不再鏖述

8 Wait Statistics

8-1 Buffer Wait StatisticsBuffer Wait Statistics          Snaps: 70719-70723

-> ordered by wait time desc, waits desc

Class                    Waits Total Wait Time (s)  Avg Time (ms)

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

data block           8,442,041             407,259             48

undo header             16,212               1,711            106

undo block              21,023                 557             26

1st level bmb            1,038                 266            256

2nd level bmb              540                 185            342

bitmap block                90                  25            276

segment header             197                  13             66

file header block          132                   6             43

bitmap index block          18                   0              1

extent map                   2                   0              0

数据来源 : WRH$_WAITSTAT

该环节是对 缓冲池中各类型(class) 块 等待的汇总信息, wait的原因一般是 buffer busy waits 和 read by other session

class 数据块的class,  一个oracle数据块即有class 属性 还有type 属性,数据块中记录type属性(KCBH), 而在buffer header里存有class属性(X$BH.class)

Waits: 该类型数据块的等待次数

Total Wait Time  (s) : 该类型数据块的合计等待时间 单位为秒

Avg Time (ms) : 该类型数据块 平均每次等待的耗时, 单位 ms

如果用户正使用 undo_management=AUTO 的SMU 则一般不会因为rollback segment过少而引起undo header block类块的等待

对于INSERT 而引起的 buffer争用等待:

1、 对于手动segment 管理MSSM 考虑增加Freelists、Freelist Groups

2、 使用ASSM ,当然ASSM本身没什么参数可调

对于INSERT ON INDEX 引起的争用:使用反向索引key

使用HASH分区和本地索引

可能的情况下 减少index的density

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值