Documente Academic
Documente Profesional
Documente Cultură
Change
2
Lets Go
Green
3
as
from all_objects
order by dbms_random.random;
Table created.
ops$tkyte%ORA11GR2> create index t_idx on t(str,object_name);
Index created.
ops$tkyte%ORA11GR2> begin
2
dbms_stats.gather_table_stats
( user, 'T',
estimate_percent=>100 );
end;
-------------------------------------------------------------------------------------| Id
| Operation
| Name
| Rows
-------------------------------------------------------------------------------------|
0 | SELECT STATEMENT
1 |
19 |
1 |
1 |
19 |
2 |
292 |
5548 |
296
(0)| 00:00:04 |
|*
3 |
| T_IDX |
292 |
(0)| 00:00:01 |
SORT AGGREGATE
296
(0)| 00:00:04 |
|
--------------------------------------------------------------------------------------
from all_objects
1 row created.
ops$tkyte%ORA11GR2> begin
2
dbms_stats.gather_table_stats
( user, 'T',
estimate_percent=>100 );
end;
--------------------------------------------------------------------------| Id
| Operation
| Name | Rows
--------------------------------------------------------------------------|
0 | SELECT STATEMENT
1 |
19 |
1 |
1 |
19 |
|*
2 |
293 |
5567 |
SORT AGGREGATE
297
(1)| 00:00:04 |
|
297
(1)| 00:00:04 |
---------------------------------------------------------------------------
SQL Plan
Management
Never
Stopping
Planning
Ahead
10
11
11
Planning Ahead
Forget and let it go
ASH and AWR
Test Stopping
To Scale
Never
SQL Plan Management
12
SQL
Plan Management
13
13
Parse
Plan Baseline
HJ
GB
HJ
HJ
HJ
14
GB
NL
GB
GB
Hard Parse
Plan Baseline
NL
NL
NL
NL
NL GB
NL
GB
GB
GB
HJ
HJ
NL
HJ
HJ
HJ
HJ
15
Plan History
Plan Baseline
DBA
GB
GB
GB
NL
HJ
NL
NL
HJ
NL
NL
Automatic Job
16
Upgrade Scenario
Your 9i application is already in 11g for whatever reason
Youd like to have query plan stability
Coupled with the opportunity to use better plans do not want
to be frozen
17
STS
Repeatable plans will be added
to the Plan Baseline upon 2nd
execution
Plan History
GB
NL
Plan Baseline
GB
GB
GB
NL
HJ
NL
NL
OPTIMIZER_FEATURES_ENABLE=9.2.0
OPTIMIZER_CAPTURE_SQL_PLAN_BASELINES=TRUE
HJ
NL
Now: Different
plans created
with OFE=11
will be added to
the Plan History
for later verification
NL
OPTIMIZER_FEATURES_ENABLE=11.2.0
OPTIMIZER_CAPTURE_SQL_PLAN_BASELINES=FALSE
18
Upgrade Scenario
Your application is in 9i
Youd like to have query plan stability
Coupled with the opportunity to use better plans do not want
to be frozen
19
STS
Exp/imp outlines to
New system
SS
exp imp
expdp impdp
DB-Link ...
DBMS_SPM.MIGRATE_STORED_OUTLINE
Plan History
Plan Baseline
GB
GB
GB
NL
HJ
NL
NL
HJ
NL
20
Upgrade Scenario
Same Scenario but your application is in 10g
Youd like to have query plan stability
Coupled with the opportunity to use better plans do not want
to be frozen
21
Staging
STS
Table
STS
exp imp
expdp impdp
DB-Link ...
Plan History
GB
NL
Plan Baseline
GB
GB
GB
NL
HJ
NL
NL
HJ
NL
NL
22
Upgrade Scenario
You would like to deploy from development to
production..
You would like to deploy at a customer site
And you want to start with a stable set of plans
Using better plans only after they have been verified
23
@Vendor
@Customer
DBMS_SPM.CREATE_STGTAB_BASELINE
Staging
Staging
exp imp
expdp impdp
Table
Table
DBMS_SPM.UNPACK_STGTAB_BASELINE
DBMS_SPM.PACK_STGTAB_BASELINE
Plan Baseline
Plan Baseline
GB
GB
GB
GB
GB
GB
NL
HJ
NL
NL
HJ
NL
NL
HJ
NL
NL
HJ
NL
24
Test to Scale
25
25
26
Supported Changes
Changes
Unsupported
(there are
other tools
for that)
Client
Client
Client
Middle Tier
Changes Supported
Recording of
External Client
Requests
Storage
CPU, Memory
Storage
Etc.
27
Client
Client
Client
File System
Minimal overhead
Avoids function call when possible
Buffered I/O
Middle Tier
File 1
File n
Storage
28
Test System
File 1
File 1
File 2
File 2
File n
File n
Capture Files
Metadata
Replay Files
29
Test System
Replay Clients
File 1
File 2
File n
Metadata
Replay Files
30
Data Divergence
Replay: Number of rows returned by each call are compared and
divergences reported
User: Application level validation scripts
Performance Reporting
Capture and Replay Report: Provides high-level performance information
ADDM Report: Provides in-depth performance analysis
AWR, ASH Report: Facilitates comparative or skew analysis
31
Test
Client
Re-execute SQL
Middle Tier
Capture
SQL
Oracle DB
Storage
Transport
SQL
Test
Make Change
Steps
(1)
Capture
SQL (STS)
(2)
(3)
Transport
STS
Execute SQL
Pre-change
(6)
(4)
(5)
Compare
Perf.
Execute SQL
Post-change
Reiterate
No
Done?
(7)
Production Change /
(7)
Tuning Deployment
Tuned System
Yes
33
From:
To:
Database Replay
What is it?
How it works?
When to use?
SQL
SQL
Dependency
Concurrency
Speed up/down
35
More information
36
37
37
Flashback
Query
Flashback
Tables
Flashback
Database
Flashback
Data Archive
and
Transaction
38
Restore Points
Restore point specifies a jump label
Named Restore Point
Similar to a bookmark
"Can be" - but no guarantee
Will be recorded to the control file
Never Stopping
40
40
Clients
Redo
A
Version X
1
Logs
Queue
Version X
X+1
Redo
A
X
2
Upgrade
Redo
B
X+1
X+1
Switchover to B, upgrade A
Patch Set
Upgrades
Major
Release
Upgrades
Cluster
Software &
Hardware
Upgrades
X
X+1
Run in mixed mode to test
41
Pre-upgrade
edition
43
Object_4
(inherited)
Object_3
Object_3
(inherited)
Object_2
Object_2
(inherited)
Object_1
Object_1
(inherited)
Pre-upgrade
edition
is child of
Post-upgrade
edition
44
Object_4*
(actual)
Object_3
Object_3*
(actual)
Object_2
Object_2
(inherited)
Object_1
Object_1
(inherited)
Pre-upgrade
edition
is child of
Post-upgrade
edition
45
Planning Ahead
Upgrade Planner
46
46
47
Knowledge
Management
Configuration
Management
Knowledge
Management
Problem/SR
Management
Configuration
Management
Performance
Management
Problem
Diagnosis
Provisioning
& Patching
Enterprise Manager
Customer
Operating Systems
Problem/SR
Management
Databases
Middleware
Applications
48
48
Benefits
Reduced time to create, manage and execute Upgrade plan
Streamlined process to request merge patches
Greater Reliability due to Software Currency
Latest SW, Patch, and Certification information
Accuracy of recommendations based on config data (not manual)
Lower Risk
Automated analysis for missing patches and conflict checking
2010 Oracle Corporation
49
49
Capabilities
Upgrade path SW
recommendations w/
Value
Reduced Time in research,
analysis and management of
Upgrade Plan
50
50
Sub-Phase
Preparation
Upgrade
Plan
My Oracle
Support
Upgrade Plan*
Upgrade
Testing
Upgrade
Rehearsal
Real Application
Testing
Production
Upgrade
Provisioning
Post-Upgrade
Monitoring
51
51
52
Upgrade is easier!
The upgrade to Oracle Database 11g is much easier than any
upgrades to earlier Oracle releases
Size of Upgrade guides:
8.1.7- 512 pages
9.0.1- 484 pages 111 steps for an RDBMS with 9 components
9.2.0- 344 pages
10.1.0 - 170 pages
10.2.0 - 140 pages
11.1.0 - 186 pages
11.2.0 -178 pages
53
53
Documentation
54
9.2.0.8
10.1.0.5
10.2.0.2
11.1.0.6
11.2
56