View
1
Download
0
Category
Preview:
Citation preview
<Insert Picture Here>
OTN-DBA Day : Upgrading to Oracle 11gR2What you need to know
2009.11.18
Oracle Customer Service
<Insert Picture Here>
Agenda
1. Why Upgrade?
• Oracle의 Version 관리 정책의 이해
• 11g New Features
2. 11gR2 Upgrade 사젂 준비 사항• H/W, S/W 홖경 영향도 분석
3. 성공적인 Upgrade 방안• Challenges of Upgrading DBMS
• Top Upgrade Secrets
<Insert Picture Here>
Agenda
1. Why Upgrade?
• Oracle의 Version 관리 정책의 이해
• 11g New Features
2. 11gR2 Upgrade 사젂 준비 사항• H/W, S/W 홖경 영향도 분석
3. 성공적인 Upgrade 방안• Challenges of Upgrading DBMS
• Top Upgrade Secrets
Core Drivers of Upgrade
COMPLIANCE - so sensitive data and services are not exposed
BUSINESS THREATS and OPPORTUNITIES - a competitor introduces new products, services, effective business operations
BUSINESS GROWTH – initial estimate is conservative
New Technology – Better Performance, Maximize Availability
Cost Effectiveness- TCO , Compression
Software Life Cycle – Stability, End of Service
Oracle Database Lifetime
Extended Support
t2008
2003
2004
2005
2006
2007
2002
2009
2010
Today
2011
2012
2013
2014
Sustaining Support
Premier Support
R2July 2007 July 2010
R2
http://www.oracle.com/support/library/brochure/lifetime-support-technology.pdf
2015
2016
August 2012 August 2015
July 2008
R2
2017
2018
향후 Upgrade 대상 Version
현재 운영 Version
• 유지보수 Full Support 지원 영역
•Vers
ion
Up
gra
de
July 2010 July 2013July 2011
Oracle Database Lifetime
참고 : My oracle Support note 번호 : 161818.1
10gR2 버젂 또한 2010년 07월이 PS 기간이 만료됨…
서서히 11gR2 Upgrade을 준비할 시점임
Lifetime Support Policy
FeaturePremier
Support
Extended
Support
Sustaining
Support
Support 기간 제품출시 후 5년간PS 종료 후 별도
계약에 의해 3년간PS 종료 후 제품
폐기시까지
Major Product and Technology Releases
Technical Support
Access to Knowledge Base
(MetaLink/Customer Connection/SupportWeb)
Updates, Fixes, Security Alerts and Critical
Patch Updates
No
(Pre-existing Only)
Tax, Legal and Regulatory Updates No
Upgrade Scripts No
Certification with existing Third Party
Products/Versions No
Certification with new Oracle Products No
Certification with New Third Party
Products/Versions No No
* PS : Premier Support의 약어
Continuous Database Innovation
Exadata Storage
Real Application Testing
Advanced CompressionAutomatic Storage Management
Transparent Data Encryption
Self Managing Database
XML Database
Oracle Data Guard
Real Application Clusters
Flashback Query
Virtual Private Database
Built in Java VM
Partitioning Support
Built in Messaging
Object Relational Support
Multimedia Support
Data Warehousing Optimizations
Parallel Operations
Distributed SQL & Transaction Support
Cluster and MPP Support
Multi-version Read Consistency
Client/Server Support
Platform Portability
Commercial SQL Implementation
Oracle 2Oracle 9i
Oracle 5
Oracle 6
Oracle 7
Oracle 8
Oracle 8i
Oracle 10g
Oracle 11g
11g New Features Summary
• 가용성 / 운영 / 성능에 대한 강화– Real Application Clusters, Active Data Guard
– Adaptive Cursor Sharing, Result Cache
• Data Information 관리 강화 (ILM)– Partitioning
– Advanced Compression
• 보안,Governance, Risk & Compliance– Security Options (TDE 강화)
– Total Recall
• 비용 젃감 , 변경관리 최적화, Risk 감소– Real Application Testing
– SQL Plan management
• DW, 대용량 Data 관리/성능 강화– Oracle Information Appliances
– OLAP, Mining, Warehouse Builder
High Availability- Active Data Guard
Primary
Database
Online 동기화
Standby
Database
RAC
Idle Standby SiteOnline Primary Site
Active Dataguard
RAC
Active Standby Site
Standby에서 Read-only 질의 가능서버 활용도 최대화
활용예) 실시간성 reporting, Read only성 업무, Select 위주 SQL, DB백업, 복구
Performance
Results
Cache
SQL Query 결과를 메로리
캐쉬에 저장되어 동일 Query
수행 시 SQL에 대한 재 수행
대싞 보관된 result을 바로
보내어 성능 극대화
Adaptive
Cursor
Sharing
Bind 변수를 사용하여 수행되는 SQL에 대해 변수 값과
일량(buffer gets)을 모니터링 함
Bind에 따라 일량(buffer gets) 차이가 발생할 경우 실행계획을
재 생성하여 성능 극대화하여 데이터 분포에 따른 급격한 성능
변화 제거
join
join
T1 GBY
join
T2 T3
GBY
cache
Bind 변수에 의한 성능 왜곡 최소화
반복적인 동일 SQL 수행 성능의 극대화
Security- TDE (Transparent data encryption)
11g Tablespace Level Encryption– 테이블스페이스 젂체가 암호화
– Server Process 입장에서는 암호화와 상관 없이 동작
– Range Scan의 제약조건 없음.
10g Column Level Encryption– 테이블의 특정 칼럼만 암호화
– SGA에도 암호화된 채로 존재
– Range Scan의 제약 사항 존재
SGA
3
3
4
4
2
2
1
1
DBWR
2
3
4
3 4
4
3
SQL
ResultServer Process
1
SGA
2
2
1
1
DBWR
3
4 1
3
3
4
4
Server Process
2
4
13
43
3
4
42
3
12
암호화복호화
암호화
복호화
일반테이블스페이스 일반테이블스페이스 암호화된테이블스페이스
일반블록
암화화대상 블록
특정칼럼만암호화된블록
전체암호화된블록
Application 수정 없이 손쉬운 DB 작업만으로 DATA 암호화 가능
Reduce risk of change- SQL Plan management
• 사젂에 검증된 SQL Plan만 Query 수행
• SQL Plan의 관리• 미 검증 Plan은 자동 저장관리
• 검증과정을 통해 성능을 향상할 경우에는 수용
HJ
HJ
GB
ParseExecute
검증된 Plan일 경우 해당Plan 대로 수행
NL
NL
GB 미검증 Plan은 저장하고검증된 Plan으로 변경하여 수행
여러 환경 변화에 따른 SQL Plan 변경을 방지하여 성능 일관성 유지
Reduce risk of change- Database Replay
Capture Replay
Workload
운영 DBMS에서 캡쳐한 Workload을 그대로 Test에 재생
활용예) 운영DB에 변경사항 반영 젂에 불안정 요소를 인지, 분석, fix할 수 있음
운영 DB 환경 테스트 DB 환경
Reduce risk of change- SQL Performance Analyzer
……
Client
Client …
Client
Capture SQL
Middle Tier
Storage
Re-execute SQL Queries
Use SQL Tuning Advisor to automatically tune regression
Test System에 운영 DBMS의 특정 SQL을 자동 수집하여 재현
활용예) Identify and remediate performance regressions before end-users impacted
운영 DB 환경 테스트 DB 환경
Reduce Cost- Advanced Compression
0
500
1000
1500
2000
2500
3x Savings
Space Table Scans
0
0.1
0.2
0.3
0.4
2.5x faster
DML Performance
0
10
20
30
40
< 3% overhead
Real World ERP 10 Largest Tables
약간의 DML overhead (3% 전후) But
Space에 젃약( 70%) + 읽기 성능 향상 (2.5배)
Redo / Archive logs all instances
Service
public network
Node1
Operating System
Oracle
Clusterware
instance 1
ASM
Shared storage
Database / Control files
OCR and Voting Disks
VIP1
Managed by ASM
Listener
cluster
Interconnect
Service
Node n
Operating System
Oracle
Clusterware
instance N
ASM
VIP n
Listener
Automatic
Storage
Management
Disk Group
Cluster Volume Manager
불필요
Cluster File System
불필요
File Names
Tablespace
Tables
ASM
Reduce Cost- Oracle Clusterware & ASM
R2
오라클 Clusterware 및 ASM 사용한다는 것은비용 절감 뿐만 아니라 단일 Vendor 환경으로 문제 해결시간 단축
<Insert Picture Here>
Agenda
1. Why Upgrade?
• Oracle의 Version 관리 정책의 이해
• 11g New Features
2. 11gR2 Upgrade 사젂 준비 사항• H/W, S/W 홖경 영향도 분석
3. 성공적인 Upgrade 방안• Challenges of Upgrading DBMS
• Top Upgrade Secrets
H/W & OS 환경 영향도
OS / Clusterware
/ JDK
Version
• OS의 Software Lifetime 고려
• Upgrade 하려는 DBMS Version과 OS Version과의 Certification 문제
• Upgrade or Migration 진행 젃차에 반영
CPU
• 현재의 CPU 사용량 검검
• 일반적으로 Version이 한 단계 올라갈 경우 보통 증설이 불필요: SQL Plan 안정화 및 Version Up에 따른 성능 향상 효과로 보완
• 향후 업무량 증가(SQL추가, Data 증가)를 고려한 CPU 증설 검토
Memory
• 현재의 Memory 사용량 점검
• 일반적으로 Version이 한 단계 올라갈 경우 Oracle이 사용하는 Process의 최소50%에서 최대 100% 증설 검토
• 향후 업무량 증가(AP 서버 확대, Connection 수 증가)를 고려한 Memory 증설 검토
Storage• RAC일 경우 CRS 설치영역, ocr/voting disk 영역 추가 할당
• sysaux에 대한 영역, 용량 산정 결과에 따른 기타 system 영역 확장 고려
Network• RAC의 경우 현재의 Traffic을 기준으로 Interconnect Line에 대한 Switch 이
중화, bandwidth 산정
* Note : 자세한 영향도 평가는 젂문가의 AS/IS DB 분석을 통해 산정됩니다.
RAC H/W 구성 권고
FC채널Cache
Oracle Interconnect Line
Public Line
Storage Line
TCP
Gigabit 이상 권고
상기 Image는 이해를 돕기 위한sample입니다.
Oracle Interconnect에 대한 Switch 이중화, Nic에 대한 이중화 구현을 권고함
Crossover Cable 더 이상 Support하지 않음
R2
S/W 환경 영향도
• Client certification - Note: 207303.1
x
x Certified
Not supported anymore Never supported
x
x
xx x x
x x xx x
10.1.0
10.1.0
9.2.0
9.0.1
9.2.0 9.0.1 8.1.7
8.1.7
Database Release
C
l
i
e
n
t
x
xx
x x10.2.0
xx
10.2.0
x
x
x
x
xx
x x
11.1.0
11.2.0 x
x
x Supported but ES
x
xx
11.2.0
x
x x x11.1.0 xx
S/W 환경 영향도
• Database links
• Only supported if matrix shows ‚Supported‘ in both directions
• Not supported means: Use it on your own risk
• Forms/Reports certification
• My oracle Support Certify Tab Development Tools
• JDBC certification
• My oracle Support
Note:203849.1
• 기타 Clients
• 해당 tool별 제공 Vendor 문의
<Insert Picture Here>
Agenda
1. Why Upgrade?
• Oracle의 Version 관리 정책의 이해
• 11g New Features
2. 11gR2 Upgrade 사젂 준비 사항• H/W, S/W 홖경 영향도 분석
3. 성공적인 Upgrade 방안• Challenges of Upgrading DBMS
• Top Upgrade Secrets
Challenges of Upgrading DBMS
Quality Assurance
• SQL Performance
• Difficulty in Testing Real Workloads
Application Compatibility
• Need to Upgrade Applications too
Downtime
Prevent Known Issues
Cost down, Upgrading Skills
Etc (Fast resolution, workaround …)
Challenges of Upgrading DBMS
어떤 Task들을 언제, 어떻게 수행해야 할까? 어디부터 시작해야 하나?
신규 시스템은 제대로구성 되었나? DB, Cluster, RAC, interconnect, parameter…
Etc ? ? ?Upgrade후 새로운문제점은 없을까?
사전에 장애를예방할 수 없을까?
Test는 무엇을 어떤식으로 진행하나? 결과 검증은 어떻게?
Plan변경에 따른성능저하?
실제와 비슷한시스템 부하를어떻게 만들어테스트 하나?
Issue발생 시신속한해결이필요한데
우리 인력이훌륭하지만 이런
작업은 경험이 없어서리…
Upgrade 정상여부확인방법 ?
Open시비상사태 ?
?
Plan
Test
Execute
Post UpgradeGovernance
Upgrade Secret #1
• Read the documentation
Documentation
• Upgrade Guides•
+
http://download.oracle.com/docs/cd/B28359_01/server.111/b28300/toc.htm
http://download.oracle.com/docs/cd/E11882_01/server.112/e10819/toc.htm
• Note:429825.1Complete Checklist for Manual Upgrades to 11g
• Note:837570.1Complete Checklist for Manual Upgrades to 11g Release 2
Documentation
• Note: 601807.1 Upgrade Companion 11g
• Note: 785351.1 Upgrade Companion 11 Release 2
Upgrade Secret #2
• Patch your new $ORACLE_HOME
before you upgrade
Patch Set Installation
• Install patch sets and patches to your 'fresh' $OH
before you start the upgrade
Recommended Patches
Patch Set Update (PSU) Installation
• Install PSUs as well• Note:854428.1: Introduction to Database Patch Set Updates
• Database PSUs include:• Fixes for critical issues that may affect a large number of customers
and that are already proven in the field
• Critical Patch Update (CPU) fixes
• Database PSUs do not include:• Changes that require re-certification
• Fixes that require configuration changes
• Typically 50-100 new bug fixes - cumulative
• Guaranteed to be RAC rolling installable
• Change the fifth digit of the release number, e.g. 10.2.0.4.3
• Will be released 4x per year such as CPUs on the same schedule• Platforms:
Solaris SPARC64, Linux x86 and x86-64, HP-UX PA-RISC, HP Itanium, IBM AIX
효율적인 오라클 DB Patch 적용
Premier Support 기간 (출시 후 5년)
1년 2년 3년 4년 5년
Patchset#1
Patchset#2
Patchset#3
Patchset#4 UpgradeNew Version
출시
Patch
6개월단위
PatchPatchPatchPatch
분석된 Patch를 정기적으로 적용
상기 권고 사항과 고객 업무 , Project 일정에 맞추어 진행 관리 필요
1. 현재 운영 Version에 대한 최싞 출시된 Patchset 조사
2. 최싞 patchset 이후 출시된 PSU, CPU Patch조사
3. Database 제품 군에 따른 Merge Patch , bundle Patch 조사
4. 기존에 적용된 Patch에 대한 상기 Patch에 반영되어 있는지 조사
5. 기타 주요한 one-off Patch들에 대한 조사
6. OS Patch에 대한 조사
효율적인 오라클 DB Patch 적용
테스트/개발 Online 운영
주기적으로 Data복제
테스트/개발서버는동일 장비에서 2개DB로 분리운영
업무테스트환경구축
운영 DBMS
Version
표준구성안을위한 테스트
업무 연동 테스트운영 적용
계획운영시스템 적용 모니터링
오라클 Patch 적용 및 Parameter 변경에 대한 Best Practice
1. 운영계와 가능한 동일한 Architecture을 가진 Test 환경 구성- Storage는 가능한 동일하게, cpu/memory는 작아도 큰 영향없음
2. 고객 표준 System 변경관리 젃차에 따른 DB 패치 적용
Upgrade Secret #3
• Preserve performance statistics
Preserve Performance Statistics
• Upgrade Project 수행 젂 충분한 성능 Data 수집은 매우 중요한 작업임( OS, DB, Middleware등 가능한 Data 수집 및 보관)
• 수집 기간 : 최소 4주이며 권장 기간은 3개월 이상임주요 Peak time(결산, Batch)의 성능 Data 포함
• 수집 주기 : 30분 or 60분단위
• In Oracle 8i/9i/10g(if you don’t use AWR): Note:466350.1
• Use STATSPACK
• Export the PERFSTAT user right before the upgrade
• In Oracle 10g/11g:
• Use AWR
• Export the AWR with DBMS_SWRF_INTERNAL.AWR_EXTRACT
• Use ADR DIFF reports to compare before & after upgrade performance:
Upgrade Secret #4
• The upgrade won't take hours ...
Upgrade Length
• How long will the upgrade take
to complete?
• Independent of:
• Size of the database
• Used datatypes
• Dependent mainly on:
• The number of installed components and options
• Valid and non-stale data dictionary statistics
• Number of synonyms – they'll get recompiled (upgrade from 9i)
• Number of objects in XDB
• At a very low rate, if COMPATIBLE is increased:
• Number of datafiles
• Size of redo logs
Upgrade Length
• Speed up your upgrade performance by:
• Truncating the auditing table SYS.AUD$
• Creating dictionary statistics right before the upgrade
• Oracle 9i:
• Oracle 10g/11g:
SQL> truncate SYS.AUD$;
SQL> exec DBMS_STATS.GATHER_SCHEMA_STATS
('SYS', options => 'GATHER',estimate_percent =>
DBMS_STATS.AUTO_SAMPLE_SIZE, method_opt => 'FOR
ALL COLUMNS SIZE AUTO', cascade => TRUE);
SQL> exec DBMS_STATS.GATHER_DICTIONARY_STATS;
Upgrade Secret #5
• Sanity operations
Plan table , Recycle bin
• Drop table SYS.PLAN_TABLE$ and the public synonym
PUBLIC.PLAN_TABLE
• For background information please see:
• Alert Note:782735.1, Note:605317.1 and Note:736353.1
• Otherwise the component "Oracle Server" may be INVALID after the upgrade
• Applies to upgrades to:
• 10.2.0.4, 11.1.0.6 and 11.1.0.7
• Issue has been introduced with DBMS_SQLPA
• If upgrading from 10g or 11g, purge the recycle bin before
the upgrade.
SQL> purge DBA_RECYCLEBIN;
Upgrade Secret #6
• How to Handle Timezone Changes
Timezone Patches - 11gR1
• Upgrade to Oracle Database 11gR1:
• New 11g-$OH has timezone V4
• Source $OH (<10.2.0.4) has to be patched to timezone V4
• Note:359145.1Download and run the check script utltzuv2.sql
• Note:413671.1
Download and apply the patch
Timezone Patches - 11gR2
• Upgrade to Oracle Database 11g Release 2:
• New 11.2-$OH has timezone V11
• No need to patch the source $OH
• Database only needs to be adjusted if you are using thedatatype TIMESTAMP WITH TIMEZONE
• Conversion done after the upgrade
• See Note 944122.1
• Package DBMS_DST
• DBMS_DST.FIND_AFFECTED_TABLES
• DBMS_DST.BEGIN_UPGRADE
• DBMS_DST.UPGRADE_DATABASE
• DBMS_DST.END_UPGRADE
R2
Upgrade Secret #7
• Always run the pre-upgrade script:
• Upgrade to Oracle Database 11g : utlu111i.sql
• Upgrade to Oracle Database 11.2 : utlu112i.sql
Pre-Upgrade Check
• Get the current version of utlu1nmi.sql
• Download it now!
•Note:884522.1
Upgrade Secret #8
• After the upgrade ...
Post Upgrade
• Create system statistics during a regular workload period - otherwise
non-appropriate values for the CBO will be used:
SQL> select pname NAME, pval1 VALUE, pval2 INFO
from aux_stats$;
NAME VALUE INFO
-------------------- ---------- ------------------------------
STATUS COMPLETED
DSTART 04-03-2009 12:30
DSTOP 05-03-2009 12:30
FLAGS 1
CPUSPEEDNW 1392.39
IOSEEKTIM 8.405
IOTFRSPEED 255945.605
...
SQL> exec DBMS_STATS.GATHER_SYSTEM_STATS('start');
...
SQL> exec DBMS_STATS.GATHER_SYSTEM_STATS('stop');
Post Upgrade
• Create fixed table statistics
• Directly after catupgrd.sql has been completed
• This will speed up the job processing for recompilation with utlrp.sql
• Again: after a few days regular database workload
SQL> exec DBMS_STATS.GATHER_FIXED_OBJECTS_STATS;
Upgrade Secret #9
• 최적의 Upgrade Path 및 방법론 선택
Upgrade Path
Stay on same OS?N Y
UPGRADEExport/Import
CTAS, COPY
Transportable Tablespaces
Oracle Streams DBUA
Downtime >60min?
Y
N
Data GuardLogical Standby
Manual Upgrade
SQL> @catupgrd
• 별도 장비가 있을 경우 (H/W, Storage등)
안정적인 검증 Test 홖경 마련으로 Downtime 최소화 ,
방안에 따라 Data 재편성 효과등 새롭게 New Feature
적용이 가능한 방식임
• 일반적인 방식으로 운영장비에서 바로 Upgrade
Oracle이 권고하는 방식으로써 가장성공적이고 쉬운 Upgrade 방식이나일정시간 Downtime이 필요함
Upgrade Path
R2
R2
10.2.0.2
10.1.0.5
R2
7.3.4
8.0.6
8.1.7.4
9.0.1.4
9.2.0.8
9.2.0.4
"Empty" arrows mean: no specific patch release required
Command Line vs. DBUA
• Command line upgrade is better than DBUA
But DBUA는 아래와 같은 장점이 있음• DBUA does a lot of helpful checks & Simple
• Less error-prone
• DBUA changes the parameter and values for you
• DBUA uses the same scripts
Prevent execution plan changes
• Classical approach:• Rule Based Optimizer (RBO desupport since Oracle 10g - Note:189702.1)
• Hints
• Stored Outlines
• Rewriting SQL statements
• optimizer_features_enabled=n.n.n
• Change specific optimizer parameters
• Import and fix object and systems statistics
• Modern, efficient and better resource consumption:• SQL Plan Management
Without SQL Plan Management
• Challenging to "freeze" execution plans and statistics
• Difficulty:
• Statement has been parsed and a plan got created
Verification happens during execution:
• Now some conditions get changed (statistics, upgrade, parameters)
• A new plan will be created - is it better or worse???
HJ
HJ
GB
Parse Execute Plan acceptable
NL
NL
GB
Parse Execute Plan possiblynot acceptable
SQL Plan Management - Upgrade 1
• Upgrade scenario 1
STS
Plan History
Plan Baseline
GB
NL
NL
GB
HJ
HJ
GB
NL
NL
Repeatable plans will be addedto the Plan Baseline upon 2ndexecution
GB
NL
NL
Now: Differentplans createdwith OFE=11will be added tothe Plan Historyfor later verification
SQL Plan Management - Upgrade 2
• Upgrade scenario 2
Staging
Table
STSexp imp
expdp impdpDB-Link ...
STS
Plan History
Plan Baseline
GB
NL
NL
GB
HJ
HJ
GB
NL
NL
10.2 plans will be addedto the SQL Plan Baseline
GB
NL
NL
Every new and better planwill be stored in the Plan History
DBMS_SQLTUNE 사용(STS: Sql Tuning Set)
Upgrade Secret #10
• Better not test ... something is bound to go wrong anyway
Testing is the secret of upgrade's success
• Never ever change too many system components at once!
• Clearly document all changes into a change log!
• Always (!!!) use real world data for testing!
• Reserve enough time and resources for testing.
• ALWAYS collect sufficient performance data BEFORE starting
the upgrade!!
• Create a fallback strategy!
• PLEASE test your fallback strategy - does it really work??
• Please remember:
Upgrade has never been easier - but you still
have to test!!!
Summary
• Upgrade has never been easier ...
• But don't forget to test carefully
• Oracle Database 11g has many great features
• Stable and fast optimizer
• SQL Plan Management
• Online application upgrade
• Etc
• Let's go to 11gR2
For More Information
http://search.oracle.com
or
oracle.com
Recommended