Automatic Performance Management

9

Copyright © 2008, Oracle. All rights reserved.

Objectives

&uning #tatistics #'A Attach AW! Advisors Async( Commit

After completing this lesson, you should be able to: • Diagnose database performance issues • Configure the Automatic Wor load !epository • Access the database advisors • "se the #$% Access Advisor to improve database performance • "se asynchronous COMMIT effectively

9-2

Copyright © 2008, Oracle. All rights reserved.

&uning Activities
&he three activities in performance management are: • Performance planning • )nstance tuning • #$% tuning

9-3

Copyright © 2008, Oracle. All rights reserved.

Performance Planning
• • • • • • )nvestment options #ystem architecture #calability Application design principles Wor load testing, modeling, and implementation Deploying ne* applications

9-4

Copyright © 2008, Oracle. All rights reserved.

er!or"a#ce la##i#g $%ll &otes age 9-5 Copyright © 2008. All rights reserved. Oracle. .

uirements in each part of the database( &une the operating system for optimal performance of the database( 9-' Copyright © 2008.defined goals( Allocate memory to database structures( Consider )-O re.)nstance &uning • • • • +ave *ell. . All rights reserved. Oracle.

Oracle.Performance &uning Methodology &he tuning steps: • &une from the top do*n( &une: ) &he design before tuning the application code ) &he code before tuning the instance • &une the area *ith the greatest potential benefit( ) )dentify the longest *aits( ) )dentify the largest service times( • #top tuning *hen the goal is met( 9-( Copyright © 2008. All rights reserved. .

#tatistics Collection • • Performance tuning depends on the collection of accurate statistics( &here are different types of statistics: ) Optimi/er statistics ) #ystem statistics • &here are different methods of collecting statistics: ) ) ) ) Automatically. All rights reserved. . *ith the DBMS_STATS pac age 0y setting database initiali/ation parameters 0y importing statistics from another database 9-8 Copyright © 2008. through GATHER_STATS_JOB Manually. Oracle.

. Oracle.&otes O#ly *lide 9-9 Copyright © 2008. All rights reserved.

. Oracle. All rights reserved.+0 Copyright © 2008.Oracle Wait 1vents • &uning 2 #tatistics #'A Attach AW! Advisors Async( Commit • A collection of *ait events provides information about the sessions or processes that had to *ait or must *ait for different reasons( &hese events are listed in the V$EVENT_NAME vie*( 9 .

++ V$SYSTEM_. Oracle. .#ystem #tatistics V$SYSSTAT • stat st !" • name • !lass • #al$e • stat_ % V$EVENT_NAME • e#ent_n$mbe' • e#ent_ % • name • pa'amete') • pa'amete'* • pa'amete'+ • &a t_!lass 9 .AIT_C-ASS • &a t_!lass_ % • &a t_!lass" • &a t_!lass • total_&a ts • t me_&a te% V$SGASTAT • pool • name • bytes V$SYSTEM_EVENT • e#ent • total_&a ts • total_t meo$ts • t me_&a te% • a#e'a(e_&a t • t me_&a te%_m !'o Copyright © 2008. All rights reserved.

&otes O#ly *lide 9 .+2 Copyright © 2008. Oracle. All rights reserved. .

" • e#ent" • e#ent • p)/*/+te0t • p)/*/+ • p)/*/+'a& • &a t_!lass • &a t_t me • se!on%s_ n_&a t • state • 111 V$SESSION_EVENT • s % • e#ent • total_&a ts • total_t meo$ts • t me_&a te% • a#e'a(e_&a t • ma0_&a t • t me_&a te%_m !'o • e#ent_ % 9 .!elated #tatistics V$STATNAME • stat st !" • name • !lass V$SESSTAT • s % • stat st !" • #al$e V$SESSION • s % • se' al" • $se'name • !omman% • os$se' • se. Oracle.+3 V$EVENT_NAME • e#ent" • name • pa'amete') • pa'amete'* • pa'amete'+ Copyright © 2008. All rights reserved. .Displaying #ession.

on a per event basis • V$SERVICE_.!elated #tatistics 3or n.tier environments.Displaying #ervice.AIT_C-ASS2 Aggregated *ait counts and *ait times for each service on a *ait class basis 9 . you can see service. Oracle.+4 Copyright © 2008. . All rights reserved.level statistics in these vie*s: • V$SERVICE_EVENT2 Aggregated *ait counts and *ait times for each service. because session statistics are not as helpful.

All rights reserved. .AITSTAT V$-ATCH Copyright © 2008. Oracle.+5 Dis V$DATA5I-E V$5I-ESTAT V$-OG V$-OG_HISTORY V$DB5I-E V$TEM35I-E V$TEM3SEG_6SAGE V$SEGMENT_STATISTICS Contention V$-OC7 V$6NDOSTAT V$.&roubleshooting and &uning 4ie*s )nstance-Database V$DATABASE V$INSTANCE V$3ARAMETER V$S33ARAMETER V$SYSTEM_3ARAMETER V$3ROCESS V$BG3ROCESS V$34_3ROCESS_SYSSTAT V$SYSTEM_EVENT Memory V$B655ER_3OO-_STATISTICS V$-IBRARYCACHE V$SGAIN5O V$3GASTAT 9 .

. DBA_TAB_CO-6MNS DBA_C-6STERS DBA_INDE4ES DBA_TAB_HISTOGRAMS • &his statistical information is static until you ree5ecute the appropriate procedures in DBMS_STATS( 9 .+' Copyright © 2008.Dictionary 4ie*s • &he follo*ing dictionary and special vie*s provide useful statistics after using the DBMS_STATS pac age: ) ) ) ) DBA_TAB-ES. Oracle. All rights reserved.

or is hung: • Direct access to #'A for performance monitoring 6memory access mode7 ) ) ) ) ) V$SESSION V$SESSION_. All rights reserved.+( Copyright © 2008.Diagnosis of +ung or 15tremely #lo* Databases &uning #tatistics 2 #'A Attach AW! Advisors Async( Commit "se for problem analysis *hen the database is performing very slo*ly.AIT V$SYSTEM_EVENT V$SYSSTAT +ang analysis using 1nterprise Manager 9 . Oracle. .

."sing Memory Access Mode 8 . Oracle. All rights reserved.+8 Copyright © 2008. 9 : 9 .

All rights reserved."sing the +ang Analysis Page Micro.+9 Copyright © 2008. Oracle.*indo* 9 . .

#otes o#ly page/ 9 . .si#g the -a#g A#alysis age . Oracle. All rights reserved.20 Copyright © 2008..

All rights reserved.memory statistics <:== a(m( >:== a(m( ?:== a(m( @:== a(m( #napshot 8 #napshot 9 #napshot : #napshot .Automatic Wor load !epository MMON ADDM finds top problems( &uning #tatistics #'A Attach 2 AW! Advisors Async( Commit SYSA64 #'A )n. Oracle.2+ Copyright © 2008. . @::= a(m( 9 .

Oracle. All rights reserved.#otes o#ly slide/ 9 . .A%to"atic 0or1load 2epository .22 Copyright © 2008.

All rights reserved.OR7-OAD_RE3OSITORY1CREATE_BASE-INE 8 9 sta't_snap_ % IN N6MBER : en%_snap_ % IN N6MBER : basel ne_name IN VARCHAR*. .AW! #napshot 0aselines !elevant period in the past DBMS_.23 Copyright © 2008. Oracle.< 9 .

24 Copyright © 2008. .Advisory 3rame*or : Overvie* &uning #tatistics #'A Attach AW! 2 Advisors Async( Commit #$% &uning Advisor Memory ADDM P'A P'A Advisor 0uffer Cache Advisor %ibrary Cache Advisor #'A #$% Access Advisor #pace #egment Advisor "ndo Advisor 9 . All rights reserved. Oracle.

All rights reserved.25 Copyright © 2008. Oracle.&otes O#ly *lide 9 . .

2' Copyright © 2008.Database Control and Advisors 9 . . All rights reserved. Oracle.

. All rights reserved.2( Copyright © 2008.&ypical Advisor &uning #ession Create an advisor tas ( Adjust tas parameters( Perform analysis( Co )mplement recommendations( Accept resultsA Bes 9 . Oracle.

.Manually )nvo ing ADDM 9 .28 Copyright © 2008. All rights reserved. Oracle.

"sing the #$% &uning Advisor: !evie* • "se the #$% &uning Advisor to analy/e #$% statements and obtain performance recommendations( #ources for #$% &uning Advisor to analy/e: ) &op #$%: Analy/es the top #$% statements currently active ) #$% &uning #ets: Analy/es a set of #$% statements you provide ) #napshots: Analy/es a snapshot ) 0aselines: Analy/es a baseline • 9 .29 Copyright © 2008. All rights reserved. . Oracle.

.#$% Access Advisor: Overvie* Wor load specification -#$% statement -#$% &uning #et -#$% cache contents -#tatistics -#chema name !ecommendations -)nde5es -Materiali/ed vie*s -Materiali/ed vie* logs #$% Access Advisor 9 . All rights reserved.30 Copyright © 2008. Oracle.

.&ypical #$% Access Advisor #ession 9 . Oracle.3+ Copyright © 2008. All rights reserved.

All rights reserved. Oracle. .32 Copyright © 2008.Wor load #ource 9 .

All rights reserved.!ecommendation Options 9 .33 Copyright © 2008. Oracle. .

34 Copyright © 2008. All rights reserved. Oracle. .!ecommendation Options 9 .

!evie*ing !ecommendations 9 . All rights reserved. Oracle. .35 Copyright © 2008.

3' Copyright © 2008.Asynchronous COMMIT • • • • &uning #tatistics #'A Attach AW! Advisors 2 Async( Commit &he default COMMIT behavior is to *ait until redo is saved in the redo log files( &he default behavior can no* be changed to Dnot *ait(E Asynchronous COMMIT is useful for high transaction throughput( +o*ever. All rights reserved. . Oracle. transactions may be lost( ) Machine crashes ) 3ile )-O problems *ith redo log files 9 .

.level e5amples: A-TER SYSTEM SET COMMIT_.RITE = IMMEDIATE: NO.AIT 6this is the default7 IMMEDIATE.AIT • COMMIT statement e5amples: COMMIT .AIT A-TER SESSION SET COMMIT_.RITE BATCH NO. or session. All rights reserved.AIT BATCH.RITE = IMMEDIATE: . . Oracle.AIT COMMIT . NO. .AIT • #ystem.AIT 9 .AIT BATCH.RITE BATCH .3( Copyright © 2008."sing Asynchronous COMMIT • Possible combinations: ) ) ) ) IMMEDIATE. NO.

Oracle. you should have learned ho* to: • Diagnose database performance issues • Configure the Automatic Wor load !epository • Access the database advisors • "se the #$% Access Advisor to improve database performance • "se asynchronous COMMIT effectively 9 .38 Copyright © 2008.#ummary )n this lesson. . All rights reserved.

All rights reserved.39 Copyright © 2008.Practice Overvie*: "sing ADDM to Diagnose Performance Problems &his practice covers the follo*ing topics: • 4ie*ing and interpreting ADDM findings to diagnose a performance problem • )mplementing those findings 9 . . Oracle.

All rights reserved.40 Copyright © 2008. Oracle. .9 .