Tom Wright
Customer Support Manager
tom.wright@oracle.com
Agenda
Recap
Challenges & Best Practices
AWR & STATSPACK
SQL Plan Management
Real Application Testing
Q&A
August 2015
August 2012
July 2013
July 2010
R2
January 2012
January 2009
Sustaining Support
Premier Support
Extended Support
July 2007
R2
July 2010
July 2008
t
2016
2015
2014
2013
2012
2011
2010
2009
2008
2007
2006
2005
2004
2003
2002
http://www.oracle.com/support/library/brochure/lifetime-support-technology.pdf
Premier
Support
Extended
Support
Sustaining
Support
Technical Support
Pre-existing Only
No
Upgrade Scripts
No
No
No
No
No
Easiest to Manage
Highest Quality of Service
Highest Performance and Scalability, Fault Tolerant,
Most Secure, Best Information
Auto-Tuning
Advisory
Replication
Recovery
RAC
Schema
Apps/SQL
Memory
Backup
Storage
Instrumentation
Auto-Tuning
Advisory
Replication
Recovery
RAC
Schema
Apps/SQL
Memory
Backup
Storage
Instrumentation
Documentation
Note: 466181.1 Upgrade Companion 10gR2
Documentation
Note: 601807.1 Upgrade Companion 11g
Documentation
Note: 601807.1 Upgrade Companion 11g
Support
Config View
SCM
Knowledge
Management
Oracle CCR
HTTPS
Proxy
Server
Simple install/
command UI
Customer Site
< Back
Next >
Cancel
What is a system?
Configuration files
Configuration files
Console
configuration
Console configuration
DCM
configuration
DCM configuration
Deployed
applications
Deployed applications
General
General
OPMN
configuration
OPMN configuration
JServ
JServlevel
level
Configuration files
Configuration files
Zones
Zones
HTTP
HTTPServer
Serverlevel
level
Cipher suites
Cipher suites
Configuration
files
Configuration files
General
General
Listen
addresses
Listen addresses
Performance
related settings
Performance related settings
Virtual
hosts
Virtual hosts
Host
Hostlevel
level
Operating system initialized services
IOCPUs
devices
IO devices
Network
interfaces
Network interfaces
Operating
system
Operating system
Component
Component
File
system
File system
Modules
Modules
OS
parameters
OS parameters
Registered
software
Registered software
Database
Database
level
level
Config version
Config version
Control
files
Control files
Data
files
Data files
Instance
information
Instance information
Feature
usage
Feature usage
High
water mark
High water mark
Initialization
Initialization
parameters
parameters
Session
high water
Session high water
mark
mark
Options
Options
Redo logs
Redo logs
Rollback
segments
Rollback segments
SGA
SGA
Tablespaces
Tablespaces
Database
users
Database users
Statspack
Statspack
configuration
Infrastructure
level
configuration
Infrastructure
level
Apps web configuration
Apps web configuration
Apps web configuration files
Apps web configuration files
Context
files
Context files
Database
configuration
Database configuration
Database
configuration files
Database configuration files
Custom
context variables
Custom context variables
Environment
context variables
Environment context variables
Global
context variables
Global context variables
Host
context variables
Host context variables
Install
context variables
Install context variables
Process
context variables
Process context variables
System
context variables
System context variables
Technology
stack inventory (file system)
Technology stack inventory (file system)
Workflow
mailer configuration
Workflow mailer configuration
Workflow
mailer configuration files
Workflow mailer configuration files
eBusiness
eBusinessSuite
Suite
# of active users
# of active users
Applied
patches
Applied patches
Custom
forms
Custom forms
Applications
system summary
Applications system summary
Applications
topology
Applications topology
Comprising
patches
Comprising patches
Component
versions
Component versions
Config
version
Config version
Custom
applications
Custom applications
Profile
options registered under custom
Profile options registered under custom
app.
app.
Custom
database objects
Custom database objects
Cust. Hooks
Cust. Hooks
Custom
message count
Custom message count
Custom
objects owned by Apps
Custom objects owned by Apps
Custom
request sets
Custom request sets
Responsibility
count
Responsibility count
Custom
triggers
Custom triggers
Custom
value sets table validated
Custom value sets table validated
Custom
value sets other
Custom value sets other
Custom
workflows
Custom workflows
Data
groups
Data groups
Database
version
Database version
End-Dated
users
End-Dated users
Generic
service components
Generic service components
parameters
parameters
High
priority patches not applied
High priority patches not applied
JTF hooks
JTF hooks
Localization
modules
Localization modules
NSL
languages
NSL languages
Other
customizations
Other customizations
Application
patch levels
Application patch levels
Printers
Printers
Printer
drivers
Printer drivers
Profile
options
Profile options
Registered
Oracle users
Registered Oracle users
Technology
stack inventory (DB)
Technology stack inventory (DB)
Configuration Manager
Oracle Configuration Manager and Oracle Enterprise Manager
Escalation Process
Call US: 800 223 1711
Other Global Support Hot Lines:
http://www.oracle.com/support/contact.html
V.P. or
Executive
Senior Manager
or Director
Manager /
Escalation Manager
Support Representative
Customer
Agenda
Recap
Challenges & Best Practices
AWR & STATSPACK
SQL Plan Management
Real Application Testing
Q&A
STATSPACK
AWR
SQL Plan Management
Real Application Testing
SQL Performance Analyzer
Database Replay
Rule Based Optimizer (Please note: RBO desupport since Oracle 10g)
Hints
Stored Outlines
Rewriting SQL statements
optimizer_features_enabled=n.n.n
Change specific optimizer parameters
Import and fix object and system statistics
Dictionary Statistics
Create dictionary statistics prior to the upgrade - otherwise
it will take significantly longer
SQL>
SQL> EXECUTE
EXECUTE dbms_stats.gather_schema_stats
dbms_stats.gather_schema_stats
('SYS',
('SYS',
options
options
estimate_percent
estimate_percent
method_opt
method_opt
cascade
cascade
=>
=> 'GATHER',
'GATHER',
=>
=> DBMS_STATS.AUTO_SAMPLE_SIZE,
DBMS_STATS.AUTO_SAMPLE_SIZE,
=>
=> 'FOR
'FOR ALL
ALL COLUMNS
COLUMNS SIZE
SIZE AUTO',
AUTO',
=>
=> TRUE);
TRUE);
SQL>
SQL> EXECUTE
EXECUTE dbms_stats.gather_dictionary_stats;
dbms_stats.gather_dictionary_stats;
Post Upgrade
Create system statistics during a regular workload period otherwise non-appropriate values for the CBO will be used:
SQL>
SQL> EXECUTE
EXECUTE dbms_stats.gather_system_stats('start');
dbms_stats.gather_system_stats('start');
...
...
SQL>
SQL> EXECUTE
EXECUTE dbms_stats.gather_system_stats('stop');
dbms_stats.gather_system_stats('stop');
SQL>
SQL> select
select pname
pname NAME,
NAME, pval1
pval1 WERT,
WERT, pval2
pval2 INFO
INFO
from
from aux_stats$;
aux_stats$;
NAME
WERT
NAME
WERT INFO
INFO
----------------------------------------------------------------------------- ---------- -----------------------------STATUS
COMPLETED
STATUS
COMPLETED
DSTART
04-07-2008
DSTART
04-07-2008 12:30
12:30
DSTOP
05-07-2008
12:30
DSTOP
05-07-2008 12:30
FLAGS
1
FLAGS
1
CPUSPEEDNW
1392,39
CPUSPEEDNW
1392,39
IOSEEKTIM
11,405
IOSEEKTIM
11,405
IOTFRSPEED
25595,605
IOTFRSPEED
25595,605
...
...
Post Upgrade
Create fixed table statistics soon after the upgrade:
SQL>
SQL> execute
execute
dbms_stats.gather_fixed_objects_stats;
dbms_stats.gather_fixed_objects_stats;
Agenda
Recap
Challenges & Best Practices
AWR & STATSPACK
SQL Plan Management
Real Application Testing
Q&A
STATSPACK
Database performance tool - pre-10g
Note:394937.1 STATSPACK guide
Export the PERFSTAT user
Agenda
Recap
Challenges & Best Practices
AWR & STATSPACK
SQL Plan Management
Real Application Testing
Q&A
Challenge
How do I ensure
plan stability???
Parse
Execute
HJ
Plan acceptable
HJ
Parse
Execute
NL
NL
Plan possibly
not acceptable
Parse
Execute
HJ
Plan acceptable
HJ
Initial plan
will be accepted
if repeated and
will be added to the
SQL Plan Baseline
Plan History
Plan Baseline
GB
HJ
HJ
Parse
NL
NL
Plan History
GB
Plan Baseline
NL
NL
GB
HJ
HJ
Parse
Execute
HJ
HJ
Plan History
GB
Plan Baseline
NL
NL
GB
HJ
HJ
Plan History
GB
GB
NL
NL
NL
Plan Baseline
GB
NL
HJ
Plan History
GB
NL
Plan Baseline
NL
GB
GB
NL
HJ
NL
HJ
HJ
DBA
Optimizer
Upgrade scenario 2:
Ship the best execution plans for the new statements within a
staging table and ensure that they'll be used
Works since 10gR2
STS
Repeatable plans will be added
to the Plan Baseline upon 2nd
execution
Plan History
GB
NL
Plan Baseline
NL
GB
GB
GB
NL
HJ
NL
NL
OPTIMIZER_FEATURES_ENABLE=9.2.0
OPTIMIZER_CAPTURE_SQL_PLAN_BASELINE=TRUE
HJ
Now: Different
plans created
with OFE=11
will be added to
the Plan History
for later verification
NL
OPTIMIZER_FEATURES_ENABLE=11.1.0
OPTIMIZER_CAPTURE_SQL_PLAN_BASELINE=FALSE
Staging
STS
Table
STS
exp imp
expdp impdp
DB-Link ...
Plan Baseline
NL
GB
GB
GB
NL
HJ
NL
NL
HJ
NL
Staging
exp imp
expdp impdp
Table
Table
DBMS_SPM.UNPACK_STGTAB_BASELINE
DBMS_SPM.PACK_STGTAB_BASELINE
Plan Baseline
GB
NL
NL
Plan Baseline
GB
GB
GB
GB
GB
HJ
NL
NL
HJ
NL
HJ
NL
NL
HJ
NL
Agenda
Recap
Challenges & Best Practices
AWR & STATSPACK
SQL Plan Management
Real Application Testing
Q&A
Database Replay:
Techinical White Paper: Database Replay
http://www.oracle.com/technology/products/manageability/database/pd
f/ow07/db_replay_white_paper_ow07_1.pdf
Database Replay
What is it?
How it works?
When to use?
SQL
SQL
Dependency
Concurrency
Speed up/down
Agenda
Recap
Challenges & Best Practices
AWR & STATSPACK
SQL Plan Management
Real Application Testing
Q&A
Challenge
SPA interface
Rich GUI through Enterprise Manager
Command line interface through DBMS_SQLPA PL/SQL
package
Test
Re-execute SQL
Middle Tier
Capture
SQL
Transport
SQL
Oracle DB
Storage
Make Changes /
Tuning Regressions
* No middle & application tier setup required
Test
Make Change
Steps
(1)
Capture
SQL (STS)
(2)
(3)
Transport
STS
(4)
Execute SQL
Pre-change
(6)
(5)
Compare
Perf.
Execute SQL
Post-change
Reiterate
No
Done?
(7)
Production Change / Tuning
(7)
Deployment
Tuned System
Yes
SPA Workflows
Possible workflows:
Optimizer upgrade simulation (Start: 8.0.0)
Init parameter change
Guided workflow for manual changes
Goal:
Assess impact of upgrade on SQL workload
performance so that there are no surprises after
upgrade. Once upgraded to 11g new features can be
enabled one at a time.
EXEC DBMS_SQLTUNE.CAPTURE_CURSOR_CACHE_SQLSET( .. )
3
2
4
1
Parameter Changes
SPA Recommendation: SQL Tuning Advisor
Parameter Changes
SQL Tuning Advisor offers SQL Profiles
Parameter Changes
SPA run after SQL Profiles had been applied
Event 10046
ORCL_ora_133674.trc
ORCL_ora_133674.trc
ORCL_ora_133674.trc
ORCL_ora_133674.trc
...
copy
STS
Owner
Name
123
SH1
SAL1
124
SH2
CUST
exp / imp
Agenda
Recap
Challenges & Best Practices
AWR & STATSPACK
SQL Plan Management
Real Application Testing
Q&A
Challenge
Database Replay
Capture and replay an actual production database workload
Identify, analyze and fix potential instabilities before making changes to
production
Capture Workload in Production
Capture full production workload with real load, timing & concurrency
characteristics
Move the captured workload to test system
Production System
Client
Client
Client
File System
Middle Tier
File 1
File 2
File n
Storage
Test System
Pre-processing transforms
captured data into replayable
format
Once pre-processed, workload
can be replayed many times
File 1
File 1
File 2
File 2
File n
File n
Metadata
Capture Files
Replay Files
Test System
Replay Clients
File 1
File 2
File n
Metadata
Replay Files
Database Replay
Step-By-Step
Database Replay
1. Create a copy of the database to replay the workload
RMAN Duplicate
Snapshot Standby
Database Replay
2. Workflow in EM: Workload Capture
Database Replay
2. Preparation steps in EM: Workload Capture
Database Replay
3. Workload Filter:
Database Replay
4. Prepare an empty directory for capture files
Database Replay
Job scheduling - specify time frame for capture:
Database Replay
Database Control - capture review and submit:
Database Replay
Database Control - capture summary:
Database Replay
Database Control - capture statistics:
Database Replay
Preprocessing captured workload:
Database Replay
Replaying the captured workload:
Database Replay
Choose directory containing preprocessed capture files
Database Replay
Workload Replay - choose replay name:
Database Replay
Workload Replay: Wait for replay clients to connect
Database Replay
Workload Replay Clients: Calibrate
$> wrc mode=calibrate replaydir=/tmp/testing
Database Replay
Workload Replay: WRC client(s) connected
Database Replay
Monitor Workload Replay during replay
Database Replay
Monitor divergence stats:
Database Replay
Workload Replay result:
Database Replay
Workload replay reporting:
Performance Testing
Note:
Note:
Note:
Note:
Note:
Agenda
Recap
Challenges & Best Practices
AWR & STATSPACK
SQL Plan Management
Real Application Testing
Q&A