Professional Documents
Culture Documents
Practices
a ble
f e r
ans
n - t r
a no
h a s .
m ) uide
o
.c nt G
o o
y ah tude
l i n @ is S
h i ck se th
( r ich to u
c k lin ense
i lic
ar dH
h
Ric
Unauthorized reproduction or distribution prohibited. Copyright© 2008, Oracle and/or its affiliates.
Table of Contents
Practice 2-1: Writing Tuning Goals................................................................................ 5
Practice 3-1: Using the Alert Log Information for Tuning............................................. 7
Practice 3-2: Viewing System Statistics and Wait Events.............................................. 8
Practice 4-1: Working with Metrics.............................................................................. 10
Practice 4-2: Working with Baselines........................................................................... 11
Practice 5-1: Installing Statspack.................................................................................. 14
Practice 5-2: Creating Statspack Snapshots.................................................................. 15
Practice 5-3: Generating Statspack Reports.................................................................. 16
Practice 6-1: Using AWR-Based Tools ........................................................................ 18
Practice 7-1: Using Enterprise Manager to Identify OS Issues .................................... 20
Practice 7-2: Using Enterprise Manager to Identify Database Performance Issues ..... 21
Practice 8-1: Tuning a Hard Parse Workload ............................................................... 23 a b le
f e
Practice 8-2: Sizing the Shared Pool............................................................................. 24
r
an
Practice 8-3: Keeping Objects in the Shared Pool ........................................................ 25
s
n - t r
Practice 9-1: Using the DB Cache Advisor .................................................................. 27
a no
Practice 9-2: Using the Keep Pool ................................................................................ 28
a s .
Practice 10-1: Enabling Automatic Shared Memory .................................................... 30
h
m ) uide
Practice 10-2: Adjusting Memory As Workloads Change ........................................... 31
o
.c nt G
Practice 11-1: Diagnosing Checkpoint and Redo ......................................................... 33
o o
ah tude
Practice 12-1: Tuning I/O: A Demonstration................................................................ 35
y
l i n @ is S
Practice 13-1: Tuning PGA_AGGREGATE_TARGET .............................................. 38
h i ck se th
Practice 13-2: Tuning Temporary Tablespace Performance ........................................ 40
Practice 14-1: Tuning Database Space Usage .............................................................. 42
( r ich to u
Practice 16-1: Using Services with a Single-Instance Oracle Database (Optional) ..... 45
c k lin ense
Practice 16-2: Trace Services in a Single-Instance Oracle Environment (Optional).... 46
i lic
ar dH
h
Ric
a ble
f e r
ans
n - t r
a no
h a s .
m ) uide
o
.c nt G
o o
y ah tude
l i n @ is S
h i ck se th
( r ich to u
c k lin ense
i lic
ar dH
h
Ric
a ble
f e r
ans
n - t r
a no
h a s .
m ) uide
o
.c nt G
o o
y ah tude
l i n @ is S
h i ck se th
( r ich to u
c k lin ense
i lic
ar dH
h
Ric
a ble
f e r
an s
n - t r
a no
h a s .
m ) uide
o
.c nt G
o o
y ah tude
l i n @ is S
h i ck se th
( r ich to u
c k lin ense
i lic
ar dH
h
Ric
The first exercise takes you through setting server-generated alerts for some important
performance metrics. You then see how you are alerted when thresholds are crossed.
The second exercise explains how to set up and use metric baselines.
a ble
f e r
ans
n - t r
a no
h a s .
m ) uide
o
.c nt G
o o
y ah tude
l i n @ is S
h i ck se th
( r ich to u
c k lin ense
i lic
ar dH
h
Ric
c k lin ense
d Hi lic
ar
R ich
R ich per second (tps), or generate a transaction rate of 4 tps. Use the lab_04_02_04.sh
script with a parameter to set the transaction rate. Choose the tps rate to execute on
the basis of the cycle you determined in step 3 on the Baseline Statistics Visualization
page. Match the hour on the visualization graph to the current time. After you make
your observations, end the workload by deleting the runload file with rm
/home/oracle/workshops/runload. What do you observe, and why?
6) Create a workload that exceeds the baseline workload. Depending on the time of the
day (the hour) when you do this practice, generate a transaction rate of 14
transactions per second (tps), or generate a transaction rate of 9 tps. Use the
lab_04_02_04.sh script with a parameter to set the transaction rate. Choose the
tps rate to execute on the basis of the cycle you determined in step 3 on the Baseline
Statistics Visualization page. Match the hour on the visualization graph to the current
time. After you make your observations, end the workload by deleting the runload
file with rm /home/oracle/workshops/runload. What do you observe, and
why?
7) From your Database Control Console, deactivate your metric baseline, and then
disable metric baselines. Then log out of Enterprise Manager.
a ble
f e r
ans
n - t r
a no
h a s .
m ) uide
o
.c nt G
o o
y ah tude
l i n @ is S
h i ck se th
( r ich to u
c k lin ense
i lic
ar dH
h
Ric
During this practice, you are going to install Statspack and capture Statspack snapshots to
analyze a workload running on your orcl database.
a ble
f e r
ans
n - t r
a no
h a s .
m ) uide
o
.c nt G
o o
y ah tude
l i n @ is S
h i ck se th
( r ich to u
c k lin ense
i lic
ar dH
h
Ric
a ble
f e r
ans
n - t r
a no
h a s .
m ) uide
o
.c nt G
o o
y ah tude
l i n @ is S
h i ck se th
( r ich to u
c k lin ense
i lic
ar dH
h
Ric
a ble
f e r
ans
n - t r
a no
h a s .
m ) uide
o
.c nt G
o o
y ah tude
l i n @ is S
h i ck se th
( r ich to u
c k lin ense
i lic
ar dH
h
Ric
a ble
f e r
ans
n - t r
a no
h a s .
m ) uide
o
.c nt G
o o
y ah tude
l i n @ is S
h i ck se th
( r ich to u
c k lin ense
i lic
ar dH
h
Ric
a ble
f e r
ans
n - t r
a no
h a s .
m ) uide
o
.c nt G
o o
y ah tude
l i n @ is S
h i ck se th
( r ich to u
c k lin ense
i lic
ar dH
h
Ric
a ble
f e r
ans
n - t r
a no
h a s .
m ) uide
o
.c nt G
o o
y ah tude
l i n @ is S
h i ck se th
( r ich to u
c k lin ense
i lic
ar dH
h
Ric
a ble
f e r
ans
n - t r
a no
h a s .
m ) uide
o
.c nt G
o o
y ah tude
l i n @ is S
h i ck se th
( r ich to u
c k lin ense
i lic
ar dH
h
Ric
a ble
f e r
an s
n - t r
a no
h a s .
m ) uide
o
.c nt G
o o
y ah tude
l i n @ is S
h i ck se th
( r ich to u
c k lin ense
i lic
ar dH
h
Ric
a ble
f e r
ans
n - t r
a no
h a s .
m ) uide
o
.c nt G
o o
y ah tude
l i n @ is S
h i ck se th
( r ich to u
c k lin ense
i lic
ar dH
h
Ric
This lesson has a demonstration of diagnosing I/O performance problems and possible
changes to mitigate those problems.
a ble
f e r
ans
n - t r
a no
h a s .
m ) uide
o
.c nt G
o o
y ah tude
l i n @ is S
h i ck se th
( r ich to u
c k lin ense
i lic
ar dH
h
Ric
mozilla file:///home/oracle/labs/lab_12_01.html
c o m Guid
4) . t
What conclusions can you draw from theseodemonstrations?
o n
h e
@ ya Stud
k l in this
c h hic use
n ( ri e to
i c kli cens
d H li
ar
R ich
a ble
f e r
an s
n - t r
a no
h a s .
m ) uide
o
.c nt G
o o
y ah tude
l i n @ is S
h i ck se th
( r ich to u
c k lin ense
i lic
ar dH
h
Ric
7) Hi a newlisetting
Make
rd determined.
c for PGA_AGGREGATE_TARGET on the basis of the value you
c h a
Ri 8) Execute the workload again.
9) After a few minutes, check the PGA Advisor and the PGA Memory Usage Details
pages.
a) View the PGA Advice page; have the recommended values changed?
b) View the PGA Memory Usage Details page. Are there any multipass work areas?
10) After the workload has been running about 5 minutes, stop the workload with rm
runload.
11) Create an AWR snapshot and an AWR report for the last two snapshots.
12) Review the AWR report for symptoms, recommendations concerning PGA area
sizing, and changes that show improved performance.
a) Save this report to file for later viewing. Name the file awr13_1_12.html.
b) Check Load Profile for physical reads and writes per second.
c) Have the SQL statements that perform the most reads changed?
a ble
f e r
ans
n - t r
a no
h a s .
m ) uide
o
.c nt G
o o
y ah tude
l i n @ is S
h i ck se th
( r ich to u
c k lin ense
i lic
ar dH
h
Ric
In this practice, you change tablespace properties that are impacting performance. These
changes do not apply to every database; they are specific to certain types of applications.
a ble
f e r
an s
n - t r
a no
h a s .
m ) uide
o
.c nt G
o o
y ah tude
l i n @ is S
h i ck se th
( r ich to u
c k lin ense
i lic
ar dH
h
Ric
a ble
f e r
ans
n - t r
a no
h a s .
m ) uide
o
.c nt G
o o
y ah tude
l i n @ is S
h i ck se th
( r ich to u
c k lin ense
i lic
ar dH
h
Ric
a ble
f e r
ans
n - t r
a no
h a s .
m ) uide
o
.c nt G
o o
y ah tude
l i n @ is S
h i ck se th
( r ich to u
c k lin ense
i lic
ar dH
h
Ric
In this practice, you create the following configuration in the orcl database:
1) Use the DBMS_SERVICE package to create a service called SERV1. Then, make sure
that you add your service name to your tnsnames.ora file.
a ble
e r
2) After you have created your services, try connecting to your database by using your
service name. What happens and why? a n sf
n - tr
3) How would you make sure that you could connect using your service?
a no Do it, and
connect to your instance using your service.
h a s .
4) Execute the lab_c_01_04.sql script as sysdba.
o m ide creates a new
) Thisuscript
user; connect to your instance using this user
o o .cand thenSERV1
t G service. The script then
executes the following query:
y ah tude
i n i S
@DBA_OBJECTS,DBA_OBJECTS,DBA_OBJECTS
s
SELECT COUNT(*) FROM
l
k et h
Do not wait for c h
the hic to ucomplete
script s continue to next step.
( r i t o
5) After the
k linexecution n e access the EM Top Consumers page from the Performance
sstarts,
c e
i page,licand check that SERV1 is using more and more resources. Also, check
tabbed
H
d
har
the statistics on your service with V$SERVICE_STATS from a SQL*Plus session
Ric connected as SYSDBA.
6) Set alert thresholds for your SERV1 service by using Database Control. Specify the
values defined at the beginning of this practice.
7) From your terminal emulator session, execute the lab_c_01_07.sql script. This
script executes a workload under the SERV1 service. Observe the Metric Value graph
on the Service Response Time (per user call) (microseconds): Service Name SERV1
page. What is your conclusion?
8) Use Database Control to remove the thresholds that you specified during this practice.