Upload
truong-hoang
View
219
Download
0
Embed Size (px)
Citation preview
8/12/2019 What Do I Really Need to Know When Upgrading
1/56
Session S317113:
What do I really need to know when upgrading
Thomas Kyte
http://asktom.oracle.com/
8/12/2019 What Do I Really Need to Know When Upgrading
2/56
So What Does Oracle Database 11gMean To
8/12/2019 What Do I Really Need to Know When Upgrading
3/56
Small Changebut th inkabout it
8/12/2019 What Do I Really Need to Know When Upgrading
4/56
Small Changebut th inkabout it
ops$tkyte%ORA11GR2> create table t
2 as
3 select substr(object_name, 1, 1 ) str, all_objects.*
4 from all_objects
5 order by dbms_random.random;
Table created.
ops$tkyte%ORA11GR2> create index t_idx on t(str,object_name);
Index created.
ops$tkyte%ORA11GR2> begin2 dbms_stats.gather_table_stats
3 ( user, 'T',
4 method_opt => 'for all indexed columns size 254',
5 estimate_percent=>100 );
6 end;
7 /
PL/SQL procedure successfully completed.
8/12/2019 What Do I Really Need to Know When Upgrading
5/56
Small Changebut th inkabout it
ops$tkyte%ORA11GR2> select count(subobject_name) from t t1 where str = 'T';
----------------------------------------------------------------------------------
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time
----------------------------------------------------------------------------------
| 0 | SELECT STATEMENT | | 1 | 19 | 296 (0)| 00:00
| 1 | SORT AGGREGATE | | 1 | 19 | | | 2 | TABLE ACCESS BY INDEX ROWID| T | 292 | 5548 | 296 (0)| 00:00
|* 3 | INDEX RANGE SCAN | T_IDX | 292 | | 4 (0)| 00:00
----------------------------------------------------------------------------------
8/12/2019 What Do I Really Need to Know When Upgrading
6/56
Small Changebut th inkabout it
ops$tkyte%ORA11GR2> insert into t
2 select 'T', all_objects.*
3 from all_objects
4 where rownum begin
2 dbms_stats.gather_table_stats
3 ( user, 'T',
4 method_opt => 'for all indexed columns size 254',
5 estimate_percent=>100 );
6 end;
7 /
PL/SQL procedure successfully completed.
8/12/2019 What Do I Really Need to Know When Upgrading
7/56
Small Changebut th inkabout it
ops$tkyte%ORA11GR2> select count(subobject_name) from t t2 where str = 'T';
---------------------------------------------------------------------------
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
---------------------------------------------------------------------------
| 0 | SELECT STATEMENT | | 1 | 19 | 297 (1)| 00:00:04 |
| 1 | SORT AGGREGATE | | 1 | 19 | | ||* 2 | TABLE ACCESS FULL| T | 293 | 5567 | 297 (1)| 00:00:04 |
---------------------------------------------------------------------------
8/12/2019 What Do I Really Need to Know When Upgrading
8/56
The Law of unintended consequences holds that almost all
human actions have at least one unintended consequence.
Unintended consequences are a common phenomenon, due
the complexity of the world and human over-confidence.
8/12/2019 What Do I Really Need to Know When Upgrading
9/56
What do you have from the past
Online Parameter Changes
Online Major Memory ChangesOnline Schema Evolution
Online Index Creates
Quiesce
Rolling Upgrades
Online Disk reconfiguration (ASM)Online Cross Platform Tablespace Transport
Full Database Transports
And more.
8/12/2019 What Do I Really Need to Know When Upgrading
10/56
What do you need to know?
Test To Scale
SQL PlanManagement
The ability to and let it g
Never
Stopping
PlanningAhead
8/12/2019 What Do I Really Need to Know When Upgrading
11/56
2010 Oracle Corporation
Firstwhat do we needto do?
8/12/2019 What Do I Really Need to Know When Upgrading
12/56
Database Upgrade Process: Steps
1. Analyze & gather information about environment
2. Determine the upgrade path and choose upgrade method
3. Prepare backup / recovery strategy and clone database to te
4. Establish performance baseline/metrics before upgrade
5. Develop a test plan for database, applications, and reports
6. Test upgraded database with applications and reports
7. Ensure adequate performance by comparing metrics gathere
before and after upgrade8. Remediate regressions, e.g, tune queries, update database
parameters, call Support, etc.
9. Go Live!
Plann ing AhForget and let
ASH and A
Test To S
SQL Plan Managem
Never Stop
8/12/2019 What Do I Really Need to Know When Upgrading
13/56
2010 Oracle Corporation
SQLPlan Management
8/12/2019 What Do I Really Need to Know When Upgrading
14/56
SQL Plan Management
Phase 1 - Capture
Run applications to create a baseline OPTIMIZER_CAPTURE_SQL_PLAN_BASELINES=TRUE
Plan History
HJ
HJ
GB
Plan BaselineParse
HJ
HJ
GB
Repeated plans will be added to theSQL Plan Baseline during this phase
SQL MANAResi
Will occupy maWeekly
not used in
8/12/2019 What Do I Really Need to Know When Upgrading
15/56
SQL Plan Management
Phase 2 - Select ion
New Plans are generated (because something ch
But are not trusted OPTIMIZER_CAPTURE_SQL_PLAN_BASELINES=FALSE
New plan will be added to the Plan History but itwon't be used unless and untilit has been verified
Hard Parse
NL
NL
GB
Plan History
Plan Baseline
HJ
HJ
GB
GB
NL
NL
HJ
HJ
GB
HJ
GB
8/12/2019 What Do I Really Need to Know When Upgrading
16/56
SQL Plan Management
Phase 3Evolut ion
Plans are verifiedby testing the performance of
plan in the backgroundAutomagically or Manually
Plan History
Plan Baseline
GB
NL
NL
DBA
GB
HJ
HJ
Equal or better plans can be added tothe SQL Plan Baseline GB
NL
NL
Inefficient plan willbe kept in the
Plan History
GB
NL
NL
A
8/12/2019 What Do I Really Need to Know When Upgrading
17/56
Upgrade Scenario
Your 9i application is already in 11g for whatever r
Youd like to have query plan stability
Coupled with the opportunity to use better plansdo no
be frozen
The steps would be.
8/12/2019 What Do I Really Need to Know When Upgrading
18/56
SQL Plan ManagementParameterize
Plan History
Plan Baseline
GB
NL
NL
GB
HJ
HJ
GB
NL
NL
Repeatable plans will be addedto the Plan Baseline upon 2ndexecution
STS
GB
NL
NL
8/12/2019 What Do I Really Need to Know When Upgrading
19/56
Upgrade Scenario
Your application is in 9i
Youd like to have query plan stability
Coupled with the opportunity to use better plansdo no
be frozen
You will be changing platforms during the upgrade
doing a direct upgrade of the database) The steps would be.
8/12/2019 What Do I Really Need to Know When Upgrading
20/56
SQL Plan ManagementOutlines
STS SS
Capture query outlines on theproduction system
Exp/imp outlines toNew system
exp impexpdp impdp
DB-Link ...
Plan History
Plan Baseline
GB
NL
NL
GB
HJ
HJ
GB
NL
NL
DBMS_SPM.MIGRATE_STO3
8/12/2019 What Do I Really Need to Know When Upgrading
21/56
Upgrade Scenario
Same Scenario but your application is in 10g
Youd like to have query plan stability
Coupled with the opportunity to use better plansdo no
be frozen
You will be changing platforms during the upgrade
doing a direct upgrade of the database) The steps would be.
8/12/2019 What Do I Really Need to Know When Upgrading
22/56
SQL Plan ManagementTuning Pack
STS
Staging
Table
exp impexpdp impdp
DB-Link ...
STS
Plan History
Plan Baseline
GB
NL
NL
GB
HJ
HJ
GB
NL
NL
10.2 plans will becomthe SQL Plan Baselin
GB
NL
NL
3
8/12/2019 What Do I Really Need to Know When Upgrading
23/56
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
The steps would be.
8/12/2019 What Do I Really Need to Know When Upgrading
24/56
SQL Plan Management - New Application
DBMS_SPM.UNPACK_STGTAB
Plan Baseline
GB
NL
NL
GB
HJ
HJ
GB
NL
NL
3
@Vendor
Plan Baseline
GB
NL
NL
GB
HJ
HJ
GB
NL
NL
DBMS_SPM.CREATE_STGTAB_BASELINE
DBMS_SPM.PACK_STGTAB_BASELINE
Staging
Table
exp impexpdp impdp
@CustomerStaging
Table
8/12/2019 What Do I Really Need to Know When Upgrading
25/56
2010 Oracle Corporation
Test to Scale
Database Replay Overview
8/12/2019 What Do I Really Need to Know When Upgrading
26/56
Database Replay Overview
Replay actual production database workload in test environment
Identify, analyze and fix potential instabilities before makingchanges to production
Capture Workload in Production Capture full production workload with real load, timing & concurrency
characteristics (9i, 10g, 11g)
Move the captured workload to test system (11g)
Replay Workload in Test Make the desired changes in test system
Replay workload with full production characteristics
Honor commit ordering
Analyze & Report Errors
Data divergence
Performance divergence
Analys
Supported Changes
8/12/2019 What Do I Really Need to Know When Upgrading
27/56
Supported Changes
Changes SupportedDatabase Upgrades, Patches
Schema, Parameters
RAC nodes, Interconnect
OS Platforms, OS Upgrades
CPU, Memory
Storage
Etc.
ClientClient
Client
MiddleTier
Storage
E
Changes
Unsupported
(there are othertools for that)
St 1 W kl d C t
8/12/2019 What Do I Really Need to Know When Upgrading
28/56
Step 1: Workload Capture
Production Syst
ClientClient
Client
MiddleTier
Storage
All external client requests captured in binaryfiles
System background and internal activityexcluded
Minimal overheadAvoids function call when possible
Buffered I/O
Independent of client protocol
Can capture on 9i, 10g, and11gand replay on11g
Capture load for interesting time period, e.g.,peak workload, month-end processing, etc.
St 2 P W kl d Fil
8/12/2019 What Do I Really Need to Know When Upgrading
29/56
Step 2: Process Workload Files
Test System
File 1
File 2
File n
Capture Files
Setup test system
Application data should be same asproduction system as of capture start time
Use RMAN, Snapshot Standby, imp/exp,Data Pump, etc. to create test system
Make change: upgrade db and/or OS,change storage, migrate platforms, etc.
Processing transforms captured datainto replayable format
Once processed, workload can bereplayed many times
For RAC copy all capture files tosingle location for processing or useshared file system
St 3 R l W kl d
8/12/2019 What Do I Really Need to Know When Upgrading
30/56
Step 3: Replay Workload
Replays workload preservingtiming, concurrency anddependencies of the capturesystem
Replay Client is a specialprogram that consumesprocessed workload and sendsrequests to the replay system
Clients interpret captured callsinto sequence of OCI calls andsubmit to database
For high concurrencyworkloads, it may be necessaryto start multiple clients
Test System
Replay Clients
Analysis & Reporting
8/12/2019 What Do I Really Need to Know When Upgrading
31/56
Analysis & Reporting
Error Divergence: For each call error divergence
New: Error encountered during replay not seen during c
Not Found: Error encountered during capture not seen d
Mutated: Different error produced in replay than during c
Data Divergence
Replay: Number of rows returned by each call are compdivergences reported
User: Application level validation scripts
Performance ReportingCapture and Replay Report: Provides high-level perform
information
ADDM Report: Provides in-depth performance analysis
AWR, ASH Report: Facilitates comparative or skew ana
SQL Performance Anal er O er
8/12/2019 What Do I Really Need to Know When Upgrading
32/56
TransportSQL
SQL Performance Analyzer: Overv
Client
CaptureSQL
Middle Tier
Storage
Oracle DB
Re-execute SQL
Production Test
*No middle & application tier s
Make Changes / TuningRegressions
If adequate spare cycles available, optionallyexecute SQL here
SQL Performance Analyzer: Workf
8/12/2019 What Do I Really Need to Know When Upgrading
33/56
SQL Performance Analyzer: Workf
Production Test
Capture
SQL (STS)
Transport
STS
Execute SQL
Pre-change
Execute SQL
Post-change
Steps (1) (2) (3) (4) (5)
(6) Reiterate
(7)
N
(7)
Make Change
Production Change /Tuning Deployment
Tuned System
SQL Performance Analyzer: Key Differentiators
8/12/2019 What Do I Really Need to Know When Upgrading
34/56
To:
SQL Performance Analyzer: Key Differentiators
Automatic regress
Low risk, Low cos
Automated SQL cNegligible overhe
Production SQL c
From:
Manual regression tuning
High risk, High cost
Manual SQL capture,
High overhead
Non-production SQL context
Automated analysMonths of manual analysis
Complete SQL woPartial SQL workload
Real Application Testing: Tools of the Trade
8/12/2019 What Do I Really Need to Know When Upgrading
35/56
Real Application Testing: Tools of the Trade
SQL Performance Analyzer Database
What is it? Predicts SQL performance deviationsbefore end-users can be impacted, helps
assess impact of change on SQLresponse time
Replaysrealdataba
test system, helps as
change on workload
How it works? Executes each SQL, stored in SQLTuning Set, in isolationusing
production contextand then compares
before and after execution plans and run-
time statistics
Captures workloads
with production char
including concurren
synchronization &
When to use? Unit testingof SQL with the goal toidentify the set of SQL statements with
improved/regressed performance
Comprehensivetessystems of the datab
real production work
SQLSQL
Dependency
More information
8/12/2019 What Do I Really Need to Know When Upgrading
36/56
More information
Hands on Lab: S318966Database and Application Testing HOLWed: 4.45-5.45 pm
Marriott Golden Gate
SPA / Database Replay Demo grounds
Moscone West: 038/039
8/12/2019 What Do I Really Need to Know When Upgrading
37/56
2010 Oracle Corporation
The Ability to forgetAnd let it go
Flashback for Rapid Recovery from Human Erro
8/12/2019 What Do I Really Need to Know When Upgrading
38/56
Flashback for Rapid Recovery from Human Erro
FlashbackDatabase
Fla
Data
Tra
FlashbackTables
FlashbackQuery
Restore Points
8/12/2019 What Do I Really Need to Know When Upgrading
39/56
Restore Points
Restore pointspecifies a jump label
Named Restore PointSimilar to a bookmark
"Can be" - but no guaranteeWill be recorded to the control file
Guaranteed Restore PointSimilar to storage snapshots
Overrides the FLASHBACK_RETENTION_TARGET
Attention: A guarantee restore point can stop the whole database
SQL> CREATE RESTORE POINTrpt;SQL> FLASHBACK DATABASE TO RESTORE POINT rpt;
SQL> CREATE RESTORE POINTgrpt GUARANTEEFLASHBACK DASQL> FLASHBACK DATABASE TO RESTORE POINT grpt;
8/12/2019 What Do I Really Need to Know When Upgrading
40/56
2010 Oracle Corporation
Never Stopping
Rolling Database Upgrades
8/12/2019 What Do I Really Need to Know When Upgrading
41/56
M
R
U
P
U
C
SH
U
Initial SQL Apply Config
ClientsRedo
Version X Version X
1
BA
Switchover to B, upgrade A
Redo
4
Upgrade
X+1X+1
BA
Run in mixed mode to test
Redo
3
X+1X
A B
Upgrade node B to X+1
Upgrade
Logs
Queue
X
2
X+1
A B
Online Application Upgrade
8/12/2019 What Do I Really Need to Know When Upgrading
42/56
Online Application UpgradeEdition-based redefinition
Code changes are installed in the privacy of a new
editionData changes are made safely by writing only to necolumns or new tables not seen by the old edition
An editioning view exposes a different projection table into each edition to allow each to see just its o
columnsA crosseditiontrigger propagates data changes mby the old edition into the new editions columns, orhot-rollover) vice-versa
Editions & object visibility
8/12/2019 What Do I Really Need to Know When Upgrading
43/56
j y
Object_4
Object_3
Object_2
Object_1
Pre-upgradeedition
Editions & object visibility
8/12/2019 What Do I Really Need to Know When Upgrading
44/56
j y
Object_4
Object_3
Object_2
Object_1
Object_2
Object_1
Pre-upgradeedition
Post-upgradeedition
is child of
(in
(in
(in
(in
Object_4
Object_3
Editions & object visibility
8/12/2019 What Do I Really Need to Know When Upgrading
45/56
j y
Object_4
Object_3
Object_2
Object_1
Object_4*
Object_3*
Object_2
Object_1
Pre-upgradeedition
Post-upgradeedition
is child of
(a
(a
(in
(in
8/12/2019 What Do I Really Need to Know When Upgrading
46/56
2010 Oracle Corporation
Planning AheadUpgrade Planner
8/12/2019 What Do I Really Need to Know When Upgrading
47/56
The following is intended to outline our general prod
direction. It is intended for information purposes onland may not be incorporated into any contract. It is
commitment to deliver any material, code, or functio
and should not be relied upon in making purchasing
decisions.
The development, release, and timing of any featurefunctionality described for Oracles products remain
the sole discretion of Oracle.
MOS-EM: Unified View, Integrated Information
Between My Oracle Support and Enterprise Mana
8/12/2019 What Do I Really Need to Know When Upgrading
48/56
2010 Oracle Corporation
My Oracle Support
Performance
ManagementEnterprise Manager
Prov
& P
Problem
Diagnosis
Between My Oracle Support and Enterprise Mana
Oracle
Customer
DatabasesOperating Systems Middleware Applica
Problem/SR
Management
Configur
Managem
Knowledge
Management
Problem/SR
Management
Con
Man
Knowledge
Management
My Oracle SupportUpgrade Planner
8/12/2019 What Do I Really Need to Know When Upgrading
49/56
2010 Oracle Corporation
What Are We Announcing?
New Feature in My Oracle Support
Assist customers in planning the an Upgrade of Oracle technol
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 informationAccuracy of recommendations based on config data (not man
Lower Risk
Automated analysis for missing patches and conflict checking
My Oracle Support:Upgrade Planner
8/12/2019 What Do I Really Need to Know When Upgrading
50/56
2010 Oracle Corporation
Upgrade from 10.2.0.4 to 11.2
Where do I get the software
What are the valid SW upgradepaths ?
What is the certification/EOLstatus of the SW ?
What recommended patches doI apply post-upgrade?
How do I know if my 10.2.0.4
fixes will be on my 11.2
upgrade?
Are there patch conflicts?
Upgrade path SWrecommendations w/
Certification /EOL checks
Recommended Patches
Replacement/Merge Patch
Conflict Analysis for Patches
Research and Add Patches
Review Patch Feedback
Links to latest Support
Best Practices and knowledge
Reduced Tanalysis an
Upgrade P
Reduced Raccuracy (a
Improved qlatest Orac
Practices
Challeng es Capabil i t ies V
End-to-EndUpgrade Lifecycle
8/12/2019 What Do I Really Need to Know When Upgrading
51/56
My Oracle Support EM Grid Control
Integrated solution can be leveraged throughout full lifec
Preparation
My OracleSupport
Upgrade Plan*
Sub-Phase
*Will be integrated in upcoming release
Upgrade Post-U
UpgradePlan
UpgradeTesting
RehearsalProductionUpgrade
Monitor & M
Enterprise ManagerGrid Control
Real ApplicationTesting
Provisioning Mo
Phase
8/12/2019 What Do I Really Need to Know When Upgrading
52/56
How to get there
Upgrade is easier!
8/12/2019 What Do I Really Need to Know When Upgrading
53/56
2010 Oracle Corporation
The upgrade to Oracle Database 11g is much easierany upgrades to earlier Oracle releases
Size of Upgrade guides:8.1.7- 512 pages
9.0.1- 484 pages111 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
Documentation
8/12/2019 What Do I Really Need to Know When Upgrading
54/56
Note:785351.1 Upgrade Companion 11gRelease 2
What are my upgrade paths?Predictable performance post upgrade
8/12/2019 What Do I Really Need to Know When Upgrading
55/56
Predictable performance post-upgrade
10 2 0 2
11 1 0 6
10 1 0 5
9 2 0 8
11 SQL Plan Ma
Automated S
Real Applica
8/12/2019 What Do I Really Need to Know When Upgrading
56/56