Вы находитесь на странице: 1из 492

Upgrade, Upgrade,

Migrate & Migrate &


Consolidate Consolidate
to to Oracle Database 12c Oracle Database 12c
Updated: 25-JUN-2013
to to Oracle Database 12c Oracle Database 12c
Roy Swonger & Mike Dietrich Roy Swonger & Mike Dietrich
Database Upgrade and Utilities Database Upgrade and Utilities
Oracle Corporation Oracle Corporation
General Preparation Steps
Upgrade & Migration Cases
Fallback Strategies
Introduction & Overview
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 2
Performance Management
Wrap Up
Fallback Strategies
New Features in Oracle 12c
Database Upgrade Development Group
Roy Swonger
Senior Director Software Dev.
&
Product Management
Carol Tagliaferri
Senior Manager Software Dev.
Roy Swonger
Senior Director Software Dev.
&
Product Management
Carol Tagliaferri
Senior Manager Software Dev.
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 3
Cindy Lim
Principal Member Technical Staff
Joseph Errede
Principal Member Technical Staff
Eric Wittenberg
Principal Software Engineer
Mike Dietrich
Senior Principal Technologist
Cindy Lim
Principal Member Technical Staff
Joseph Errede
Principal Member Technical Staff
Eric Wittenberg
Principal Software Engineer
Mike Dietrich
Senior Principal Technologist
Some MAGIC Questions
Question? Answer
Change to new hardware?
Change to new operating system architecture?
Change the characterset?
Consolidation (schema/database/...) planned?
Number of database to upgrade/migrate?
Size of database(s) getting upgraded/migrated?
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 4
Exact source and target Oracle version(s)?
Max allowed downtime?
Fallback requirements?
Test environment and testing tools?
Does a performance baseline exist?
Change required to enable New Features?
Database Upgrade
A database upgrade is called "Upgrade" because the data dictionary
will get upgraded to a later version
This will include Oracle components, options such as JAVAVM, SDO
No data will be touched, changed or moved
Migration
A database migration will happen when the database will move to
Terminology
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 5
A database migration will happen when the database will move to
new: Hardware, operating system platform, character set
Software Upgrade
In-Place:
The new software will be installed into an existing SW location
Out-Of-Place
The new software will be installed into a new software location
2
0
0
2
2
0
0
3
2
0
0
4
2
0
0
5
2
0
0
6
2
0
0
7
2
0
0
8
2
0
0
9
2
0
1
0
2
0
1
1
2
0
1
2
2
0
1
3
2
0
1
4
2
0
1
5
2
0
1
6
2
0
1
7
2
0
1
8
2
0
1
9
2
0
2
0
2
0
2
1
2
0
2
2
2
0
2
3
2
0
2
4
2
0
2
5
Oracle 9.2 Oracle 9.2
(GA: (GA: Jul 2002) Jul 2002)
Oracle 10.1 Oracle 10.1
(GA: (GA: Jan 2004) Jan 2004)
Oracle 10.2 Oracle 10.2
(GA: (GA: Jul 2005) Jul 2005)
Oracle 11.1 Oracle 11.1
Lifetime Support Policy
JUL 2010 JUL 2010 JAN 2007 JAN 2007
JAN 2012 JAN 2012 JAN 2009 JAN 2009
JUL 2013 JUL 2013 JUL 2010 JUL 2010
today
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 6
Oracle 11.1 Oracle 11.1
(GA: (GA: Aug 2007) Aug 2007)
Oracle 11.2 Oracle 11.2
(GA: (GA: Sep 2009) Sep 2009)
Oracle Oracle 12.1 12.1
(GA: (GA: Jun 2013) Jun 2013)
Sustaining Support Sustaining Support
Extended Support Extended Support Waived Extended Support Waived Extended Support
Premier Support Premier Support
AUG 2015 AUG 2015 AUG 2012 AUG 2012
JAN 2018 JAN 2018 JAN 2015 JAN 2015
today
JUN JUN 2021 2021 JUN JUN 2018 2018
Lifetime Support Policy
http://www.oracle.com/us/support/lifetime-support/index.html
and Note: 209768.1 for Support Policy Explanation and details
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 7
Database Patch Set Roadmap
Release Schedule of Current Database Releases Note.742060.1
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 8
Note.742060.1 contains also information about platform desupport and patching end dates
Upgrade Companion
Note:1462240.1 Upgrade Companion 12c (coming soon)
Note:785351.1 Upgrade Companion 11.2
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 9
Upgrade OTN Page
http://otn.oracle.com/goto/upgrade
http://www.oracle.com/technetwork/database/upgrade/index.html
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 10
Maximum Availability Architecture OTN
http://otn.oracle.com/goto/maa
http://www.oracle.com/technetwork/database/features/availability/maa-090890.html
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 11
Upgrade Blog: blogs.oracle.com/UPGRADE
Scroll
down
to go
Scroll
down
to go
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 12
to the
slides
to the
slides
INTERNAL PPT DOWNLOAD ONLY
http://database.us.oracle.com
click click
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 13
Is It Time To Upgrade?
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 14
Upgrade and Migration Paths
Stay on same OS? N Y
UPGRADE/MIGRATION
exp/imp, expdp/impdp
Downtime >30min? N
SQL Apply &
Transient Standby
CTAS, COPY, SQL Loader
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 15
Oracle Golden Gate
DBUA
Y
Transient Standby
CLI
$> catctl.pl
Full Transportable Export/Import
Transportable Tablespaces
Step-by-Step vs Big Bang
Upgrade/migration in pieces over a period of time
Considered as risk mitigating
Everything in one downtime window
Sometimes necessary due to dependencies
Least critical systems first vs most critical system first
Strategies?
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 16
Learn more with every step
vs:
Learn about almost all from the beginning
General Preparation Steps
Upgrade & Migration Cases
Fallback Strategies
Introduction & Overview
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 17
Performance Management
Wrap Up
Fallback Strategies
New Features in Oracle 12c
Make sure everything is in good shape ...
So that you dont go off the rails!
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 18
Preparation Checklist
In the SOURCE environment:
Clean Up
Components
O Empty the recycle bin
O Check for INVALID objects in SYS/SYSTEM
O Check for duplicate objects in SYS/SYSTEM
O Remove outdated parameters
O Check for INVALID components
O Check for necessary components
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 19
Performance
Optional
O Check for necessary components
O Remove obsolete components
O Preserve performance statistics
O Check network performance
O Perform Integrity checks
Clean Up: Recycle Bin
Especially before patch or release upgrade purge the
recycle bin:
SQL>
General recommendation:
Empty the recycle bin at least once per week with an automatic job
during off-peak times
purge DBA_RECYCLEBIN; purge DBA_RECYCLEBIN;
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 20
during off-peak times
Clean Up: Invalid Objects
Always check for INVALID objects
SQL>
There should be no invalid objects owned by SYS or
SYSTEM
Recompile invalid objects with ?/rdbms/admin/utlrp.sql
select unique OBJECT_NAME, OBJECT_TYPE,
OWNER from DBA_OBJECTS where
STATUS='INVALID' order by OWNER;
select unique OBJECT_NAME, OBJECT_TYPE,
OWNER from DBA_OBJECTS where
STATUS='INVALID' order by OWNER;
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 21
Recompile invalid objects with ?/rdbms/admin/utlrp.sql
before upgrade/migration
Clean Up: Duplicate Objects
Always check for DUPLICATE objects in SYS/SYSTEM
SQL>
select OBJECT_NAME, OBJECT_TYPE from
DBA_OBJECTS where OBJECT_NAME||OBJECT_TYPE
in (select OBJECT_NAME||OBJECT_TYPE from
DBA_OBJECTS where OWNER='SYS') and
OWNER='SYSTEM' and OBJECT_NAME not in
('AQ$_SCHEDULES_PRIMARY', 'AQ$_SCHEDULES',
'DBMS_REPCAT_AUTH');
select OBJECT_NAME, OBJECT_TYPE from
DBA_OBJECTS where OBJECT_NAME||OBJECT_TYPE
in (select OBJECT_NAME||OBJECT_TYPE from
DBA_OBJECTS where OWNER='SYS') and
OWNER='SYSTEM' and OBJECT_NAME not in
('AQ$_SCHEDULES_PRIMARY', 'AQ$_SCHEDULES',
'DBMS_REPCAT_AUTH');
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 22
Clean up using MOS Note:1030426.6 How to Clean Up Duplicate
Objects Owned by SYS and SYSTEM Schema
'DBMS_REPCAT_AUTH'); 'DBMS_REPCAT_AUTH');
Clean Up: Parameters
Remove outdated parameters, underscores and events
from your init.ora/spfile
Example:
_always_semi_join=off
_unnest_subquery=false
optimizer_features_enable=10.2.0.4
event="10061 trace name context forever, level 10"
_always_semi_join=off
_unnest_subquery=false
optimizer_features_enable=10.2.0.4
event="10061 trace name context forever, level 10"
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 23
Important:
Also follow the application's upgrade instructions, such as EBS
interoperability notes these supersede any general removal
recommendation
event="10061 trace name context forever, level 10" event="10061 trace name context forever, level 10"
Clean Up: Parameters
Real World Crosscheck
Internal Oracle production database
Multimedia (ORDIM) component took very long to upgrade
_complex_view_merging = FALSE
_multi_join_key_table_lookup = FALSE
_library_cache_advice = FALSE
_index_join_enabled = FALSE
_push_join_union_view = FALSE
_push_join_predicate = FALSE
_always_semi_join = OFF
_complex_view_merging = FALSE
_multi_join_key_table_lookup = FALSE
_library_cache_advice = FALSE
_index_join_enabled = FALSE
_push_join_union_view = FALSE
_push_join_predicate = FALSE
_always_semi_join = OFF
Upgrade time Upgrade time
for ORDIM: for ORDIM:
49 49 minutes minutes
Remove all
underscores
and events
Upgrade time Upgrade time
for ORDIM: for ORDIM:
7 7 minutes minutes
Factor Factor
x7 x7
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 24
_always_semi_join = OFF
_pred_move_around = FALSE
_unnest_subquery = FALSE
_predicate_elimination_enabled = FALSE
_eliminate_common_subexpr = FALSE
_no_or_expansion = FALSE
event = '10195 trace name context forever, level 1'
event = '10778 trace name context forever, level 1
_always_semi_join = OFF
_pred_move_around = FALSE
_unnest_subquery = FALSE
_predicate_elimination_enabled = FALSE
_eliminate_common_subexpr = FALSE
_no_or_expansion = FALSE
event = '10195 trace name context forever, level 1'
event = '10778 trace name context forever, level 1
Components: Validation Check
Make sure all components are VALID before upgrade
SQL>
In case components are INVALID recompile with utlrp.sql
If that does not correct component status, further diagnosis might
select substr(COMP_ID, 1,10) compid,
substr(COMP_NAME,1,24) compname, STATUS,
VERSION from DBA_REGISTRY where
STATUS<>'VALID';
select substr(COMP_ID, 1,10) compid,
substr(COMP_NAME,1,24) compname, STATUS,
VERSION from DBA_REGISTRY where
STATUS<>'VALID';
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 25
If that does not correct component status, further diagnosis might
be required:
Note:472937.1 Information On Installed Database Components
Note:753041.1 How to diagnose Components with NON VALID status
Components: Necessary Components
General recommendation:
Standardize the set of installed database components throughout
your environment
XDB component is mandatory in Oracle Database 12c
Consolidation:
All components must be installed in a CDB
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 26
Components: Removal
3 potential reasons to remove components:
A component does not exist anymore in Oracle Database 12c
EM Database Control Repository
Oracle UltraSearch
Rules Manager and Expression Filter
OLAP AMD
Speed up the upgrade process
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 27
Speed up the upgrade process
Fewer components mean faster database upgrades
A component is obsolete
Typical example: In 11g, EM DB Control Repository exists you
migrate to EM Cloud Control with its own dedicated repository
Further information
Database Components Cleanup presentation on our Blog
http://apex.oracle.com/pls/apex/f?p=202202:2:::::P2_SUCHWORT:components
Performance: Preserve Statistics
Gather accurate performance statistics from production
Accurate means: Starting at least 1 month before the upgrade
This is of vital importance!!!
Use Automatic Workload Repository (AWR)
Snapshots interval 30-60 minutes and retention >31 days
Extract AWR: SQL>
Performance snapshot comparison using AWR DIFF reports:
@?/rdbms/admin/awrextr.sql
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 28
Performance snapshot comparison using AWR DIFF reports:
SQL>
Please note: AWR usage requires a Diagnostic Pack license
Alternative: STATSPACK MOS Note:466350.1
Time important queries, reports, and batch jobs
See also:
MOS Note:1477599.1 Best Practices Around Data Collection For Performance Issues
select * from table(
DBMS_WORKLOAD_REPOSITORY.AWR_DIFF_REPORT_HTML(
<DBID>, 1, 101, 121, <DBID>, 1, 201, 221));
Performance: Network Bandwidth
Theoretical vs Real World network transfer rates:
Interface
Data
Volumne
Theoretical
Transfer Speed
Real World
Transfer Speed
100 Mbit Ethernet
11MB/sec 40 GB/hour
<30 GB/hour
1 Gbit Ethernet
110MB/sec 400 GB/hour
<300 GB/hour
10 Gbit Ethernet
1.1GB/sec 4 TB/hour
<3 TB/hour
Infiniband IB 4xQDR
4GB/sec 14 .4TB/hour
<11 TB/hour
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 29
Typical issues:
Transfer protocols: ftp, scp, NFS all work single threaded by default
Different network segments: Repeaters/switches cause slow down
Security settings: Firewalls can kill all performance efforts
External network provider, long distances, etc
Infiniband IB 4xQDR
4GB/sec 14 .4TB/hour
<11 TB/hour
Performance: Network Strategies
Move archived data in advance
If data files include lots of free space, export/import to
avoid copying large numbers of empty blocks
Transfer protocols:
Start parallel copy operations
Slow hardware:
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 30
Slow hardware:
Install parallel network cards, replace outdated switches/repeaters
Use features such as Data Guard or GoldenGate
Sneakernet:
Optional: Integrity Checks
Health Check (hcheck.sql)
Download hcheck.sql from MOS Note:136697.1
This script will check for known problems in Oracle8i, Oracle9i, Oracle10g
and Oracle 11g.
Requires hOut Helper Package (hout.sql) from MOS Note:101468.1
RMAN Validation Check:
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 31
RMAN> backup check logical validate database;
See MOS Note:836658.1 for further details
Can be run in multiple parallel channels for speed up
Preparation Check List
In the TARGET environment:
Checks
Download
O Software Certification Information
O Installation Requirements
O Software and Patch Sets
O CPUs, PSUs and Bundle Patches
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 32
Settings
O CPUs, PSUs and Bundle Patches
O Single Patches
O Parameter Recommendations
Certification Check
Verify platform certification in My Oracle Support
Please see Note: 964664.1 and Note:431578.1 for explanations of Middleware and
Application Server product group assignments
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 33
Software Download
How to access the software?
Get the latest patch set (if there's one available)!
http://support.oracle.comis the only source for patches and
patch sets
Patch sets cannot be downloaded from eDelivery or OTN
Base release can be downloaded from:
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 34
Base release can be downloaded from:
http://edelivery.oracle.com/
Software Delivery Cloud (formerly know as eDelivery) is the
recommended source for downloading
If software is reissued, customers will be automatically informed via email
Or, download from OTN:
http://otn.oracle.com/indexes/downloads/index.html
Installation of the new Software
Patch Set /
Base Release
PSU/BP
O Install newest PATCH SET
(full install release since Oracle Database 11.2)
or
O Install base release into a new Oracle home
(if there's no patch set available yet)
O Apply newest available Patch Set Update (PSU)
or
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 35
Patches
or
O Apply recommended (bundled) patches (BP)
O Apply Interim Patches for known issues
Upgrade
O Now: Start the database upgrade/migration!!!
Example: Patch Set 11.2.0.3
Download patch set 11.2.0.3 from support.oracle.com:
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 36
Patch Set Installation 11.2.0.3
Default: out-of-place patch upgrade!!! Its a full release!!!
If you specify an in-place patch upgrade:
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 37
Patch Set Installation 11.2.0.3
Patch set 11.2.0.3 is a full release
Therefore no need anymore to install 11.2.0.1 first!!!
Only way to do an in-place patch set installation
Backup your /dbs and /network/admin files
./runInstaller detachHome ORACLE_HOME=<11.2.0.1-home>
$ ./runInstaller -detachHome ORACLE_HOME=/u01/orahomes/11.2.0
Starting Oracle Universal Installer...
$ ./runInstaller -detachHome ORACLE_HOME=/u01/orahomes/11.2.0
Starting Oracle Universal Installer...
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 38
Remove your 11.2.0.1 home contents
Install 11.2.0.3 into the previous 11.2.0.1 home
Restore /dbs and /network/admin files
Upgrade your database with DBUA or catupgrd.sql
Starting Oracle Universal Installer...
Checking swap space: must be greater than 500 MB. Actual 10047 MB Passed
The inventory pointer is located at /etc/oraInst.loc
The inventory is located at /u01/orabase
'DetachHome' was successful.
Starting Oracle Universal Installer...
Checking swap space: must be greater than 500 MB. Actual 10047 MB Passed
The inventory pointer is located at /etc/oraInst.loc
The inventory is located at /u01/orabase
'DetachHome' was successful.
Unattended Installation/Configuration
Oracle 11.2 see Note:885643.1
SAVE RESPONSEFILE option in OUI available
Or: Start OUI silent with all required parameters
Will work on Windows platform as well
Home Cloning (script or Lifecycle Management Pack)
Prepare a fully patched Oracle Home
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 39
Prepare a fully patched Oracle Home
Create an archive consisting of all files
Exclude *log, *dbf, tnsnames/listener/sqlnet.ora
Unpack archive and then $ORACLE_HOME/clone/bin/clone.pl...
See your installation guide for more information on cloning an Oracle
Home
For further information (also OS related) see the
Oracle Database Server Installation Master Note:1156586.1
Unattended Installation/Configuration
Oracle Database 12c:
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 40
O
O
Patching Notes Flow in MOS
MOS
Note:161818.1
Click on the releases
number
?
Oracle 11.2.0
MOS
Note:880782.1
Known Issues
and Alerts in
11.2.0.x
Click on
"Availability and
Known Issues"
for your patch
releases
MOS
Note:1348336.1
Availability and
Known Issues
in 11.2.0.3
Check for:
Recommended
Patches
Alerts
Notable Fixes
Issues
Introduced
MOS
Note:756671.1
Recommended
Database Patches
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 41
?
Oracle 12.1.0
MOS
Note:xxxx
Known Issues
and Alerts in
12.1.0.x
Click on
"Availability and
Known Issues"
for your patch
releases
MOS
Note:xxxx
Availability and
Known Issues
in 12.1.0.y
Check for:
Recommended
Patches
Alerts
Notable Fixes
Issues
Introduced
MOS
Note:756671.1
Recommended
Database Patches
Check for important alerts: Note:161818.1
Important Alerts and One-Off-Patches?
click click
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 42
Upgrade Information / Alerts
Known issues in 11.2.0.x? See Note:880782.1
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 43
click click
Upgrade Information / Alerts
Recommended Patches for 11.2.0.3? Note:1348336.1
See also Recommended Database Patches Note:756671.1
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 44
Recommended Patches: PSUs
Install the latest PSU as well
Note:854428.1: Introduction to Database Patch Set Updates
Note:1227443.1: Patch Set Updates Known Issues
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 fixes
Database PSUs do not include:
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 45
Database PSUs do not include:
Changes that require re-certification
Fixes that require configuration changes
Typically 25-100 new bug fixes per PSU
Guaranteed to be RAC rolling installable
Released 4x per year - same schedule for PSUs and CPUs
16-APR-2013, 16-JUL-2013, 15-OCT-2013 & 14-JAN-2014
PSU check: opatch lsinventory -bugs_fixed | grep -i 'DATABASE PSU'
Upgrade Information / Alerts
Alerts and new issues with 11.2.0.3? Note:1348336.1
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 46
Upgrade Information / Alerts
Alerts and new issues with 11.2.0.3? Note:1348336.1
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 47
Important Optimizer Issues and Fixes
Things to consider before upgrade to Oracle Database 11.2.0.3 to
avoid Poor Performance or Wrong Results: MOS Note:1392633.1
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 48
Recommended OS patches
MOS Note:169706.1: OS Installation and Configuration
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 49
Standby-First-Patching
Oracle Data Guard Standby-First Patch Apply
MOS Note:1265700.1 - Data Guard Standby-First Patch Apply
Apply a patch first on the physical standby site
Different software releases allowed between primary and standby
Role transitions allowed for rolling upgrades
Supported for:
Patch Set Update (PSU), Critical Patch Update (CPU) and PSE
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 50
Oracle Grid Infrastructure Patches or Software Updates
One-off patches
Oracle Exadata Database Machine bundled patches (BP), Quarter Database
Patches, Storage Server Software patches (Cell), hardware/network changes
Operating System software changes that do not have any dependencies on
Oracle database software
Available beginning with Oracle Database 11.2.0.1
RDBMS COMPATIBLE must remain the same
ASM COMPATIBLE can be different
Parameter Recommendations
General guidelines:
The fewer parameters you have in your spfile, the better
Remove outdated parameters, underscores, events ...
Unless directed by applications (e.g. E-Business Suite, Siebel,
SAP etc.) to set them
Try to adjust certain parameters based on testing, documentation
and white papers
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 51
and white papers
Don't trust statements such as ..."THE tuning guru said ..."
Parameter Recommendations - Info
June 6, 2012
https://www.pcworld.com/article/257045/6_5m_linkedin_passwords_posted_online_after_apparent_hack.html
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 52
Parameter Recommendations - Info
March 3, 2013:
http://www.huffingtonpost.com/2013/03/03/evernote-hacked-50-million-passwords-reset_n_2801108.html
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 53
Parameter Recommendations
SEC_CASE_SENSITIVE_LOGON=TRUE
Enables or disables password case sensitivity
Default TRUE since Oracle Database 11g
Deprecated since Oracle Database 12c
Recommendation:
Age out passwords having PASSWORD_VERSIONS<11G
When recreated, passwords will get salted
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 54
When recreated, passwords will get salted
This is a MUST no discussion, please!!
Check if passwords have been adjusted:
SQL>
select USERNAME, PASSWORD_VERSIONS from DBA_USERS;
USERNAME PASSWORD_VERSIONS
---------- -----------------
APP_USER 10G 11G 12C
HR_USER 10G 11G 12C
BOSS 10G
select USERNAME, PASSWORD_VERSIONS from DBA_USERS;
USERNAME PASSWORD_VERSIONS
---------- -----------------
APP_USER 10G 11G 12C
HR_USER 10G 11G 12C
BOSS 10G
Parameter Recommendations
sqlnet.ora
SQLNET.ALLOWED_LOGON_VERSION_SERVER
Determines minimum authentication protocol allowed by server
Default: 11
Values:
12a for Oracle Database 12c authentication protocols (strongest protection)
12 for the critical patch updates CPUOct2012 and later Oracle Database 11g
authentication protocols (recommended)
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 55
authentication protocols (recommended)
11 for Oracle Database 11g authentication protocols (default)
10 for Oracle Database 10g authentication protocols
8 for Oracle9i authentication protocol
If you connect with pre-11g clients to Oracle Database 12c you will
have to adjust the setting in your sqlnet.ora file(s)
Parameter Recommendations
AUDIT_TRAIL
Enables or disables database auditing
Attention:
New Unified Auditing can be linked into the kernel
Unified Auditing is not enabled by default
Recommendation:
Migrate to Unified Auditing
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 56
Migrate to Unified Auditing
Check if option is present :
SQL> select VALUE from V$OPTION where
PARAMETER='Unified Auditing';
Switch Unified Auditing on
make -f ins_rdbms.mk uniaud_on ioracle ORACLE_HOME=$ORACLE_HOME
Set AUDIT_TRAIL=NONE
Note:
Auditing table AUD$ will be moved into SYS schema if Label Security (OLS) is installed
Parameter Recommendations
DEFERRED_SEGMENT_CREATION
Newly created tables will just allocate segments when a first row
gets inserted
Tablespace must be locally manages
COMPATIBLE 11.2.0
Default is TRUE since Oracle Database 11.2
Recommendation:
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 57
Recommendation:
Set it to FALSE except for cases where an application creates a
large number of empty tables with may never get used
Please note:
Small performance penalty when the first row is inserted, because the new
segment must be created at that time
May cause contention issues using many Data Pump workers
See MOS Note 1216282.1
Parameter Recommendations
_OPTIMIZER_COST_BASED_TRANSFORMATION
See MOS Note: 1082127.1 for more details on CBQT
CBQT can add a high overhead at parse time but can yield considerable benefits by way of a better plan for the statement
Recommendation:
Due to limited gain and some open issues you may set it OFF
See MOS Note: 567354.1 about open issues and fixes:
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 58
Parameter Recommendations
SESSION_CACHED_CURSORS
Default: 50
Cursor caching mechanism was changed in Oracle 10.2.0.4
Recommendation:
Explicitly adjust SESSION_CACHED_CURSORS as the default
value of 50 may be too low, especially when PL/SQL is used
Too high values may lead to fragmentation in shared pool
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 59
Too high values may lead to fragmentation in shared pool
Use MOS SCRIPT: 208857.1 to adjust parameters
SESSION_CACHED_CURSORS and OPEN_CURSORS usage based
More information in MOS Note: 30804.1
Parameter Recommendation
_DATAFILE_WRITE_ERRORS_CRASH_INSTANCE=TRUE
Default: TRUE
For write errors to ANY data file, the default behavior has changed
since patch set 11.2.0.2
An I/O write error to ANY data file will crash the instance
Setting it to FALSE would revert to the "old" behavior:
Write error will OFFLINE the data file if:
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 60
Write error will OFFLINE the data file if:
Database is in archivelog mode
Data file does not belong to the SYSTEM tablespace
In that case it would initiate a SHUTDOWN ABORT
See Bug 7691270 and MOS Note: 7691270.8
Parameter Recommendation
MAX_STRING_SIZE
Values: STANDARD, EXTENDED
Controls the maximum size of VARCHAR2, NVARCHAR2, and RAW
data types in SQL
STANDARD [DEFAULT]
Length limits prior to Oracle Database 12c apply
VARCHAR2/NVARCHAR2: 4000 bytes
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 61
VARCHAR2/NVARCHAR2: 4000 bytes
RAW: 2000 bytes
EXTENDED
New 32767 byte limit applies
Requires COMPATIBLE 12.0.0
Change from STANDARD = EXTENDED is allowed, but no way back
Database in UPGRADE mode: @?/rdbms/admin/utl32k.sql
CELL_OFFLOADGROUP_NAME
CONNECTION_BROKERS
DB_BIG_TABLE_CACHE_PERCENT_TARGET
DB_INDEX_COMPRESSION_INHERITANCE
DNFS_BATCH_SIZE
ENABLE_PLUGGABLE_DATABASE
HEAT_MAP
MAX_STRING_SIZE
NONCDB_COMPATIBLE
OPTIMIZER_ADAPTIVE_FEATURES
New Parameters in Oracle Database 12c
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 62
OPTIMIZER_ADAPTIVE_FEATURES
OPTIMIZER_ADAPTIVE_REPORTING_ONLY
PARALLEL_DEGREE_LEVEL
PARALLEL_FAULT_TOLERANCE_ENABLED
PDB_FILE_NAME_CONVERT
PGA_AGGREGATE_LIMIT
SPATIAL_VECTOR_ACCELERATION
TEMP_UNDO_ENABLED
THREADED_EXECUTION
UNIFIED_AUDIT_SGA_QUEUE_SIZE
USE_DEDICATED_BROKER
Deprecated and Obsolete Parameters
Deprecated in Oracle Database 12c:
sec_case_sensitive_logon
Obsolete in Oracle Database 12c:
_app_ctx_vers
_log_io_size
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 63
General Preparation Steps
Upgrade & Migration Cases
Fallback Strategies
Introduction & Overview
Upgrade 32/64bit
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 64
Performance Management
Wrap Up
Fallback Strategies
New Features in Oracle 12c
Case 1: Upgrade to Oracle Database 12c
Database upgrade including migration to a new server
Example Facts & Description
1. Hardware migration
2. Database upgrade from Oracle 10.2.0.5 Linux 32bit to Oracle 12.1 Linux 64bit
3. Maximum tolerated downtime: 24 hours
4. Database size: 1TB
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 65
Oracle 10.2.0.5
RHEL4 32bit
1TB 1TB
24 hrs
Oracle 12.1.0.1
OEL6 64bit
Case 1: Upgrade to Oracle Database 12c
Database upgrade including migration to a new server
Install and
patch
Oracle 12c
Preupgrade
Checks
Prepare
Environment
Restore
Entire
Database
Upgrade
Database
Post
Upgrade
Actions
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 66
Oracle 10.2.0.5
RHEL4 32bit
1TB 1TB
24 hrs
Oracle 12.1.0.1
OEL6 64bit
Upgrade to Oracle Database 12c
Oracle
7.3.4
Oracle
8.0.6
Oracle
8.1.7.4
Oracle
9.0.1.4
Oracle
9.2.0.8
Oracle
101.0.5
Oracle
10.2.0.5
Oracle
11.10.7
Oracle
11.2.0.2
Oracle
12.1.0.1
Oracle 7.3 Oracle 7.3
(GA: (GA: 1996) 1996)
Oracle 8.0 Oracle 8.0
(GA: (GA: 1997 1997
Oracle 8.1 Oracle 8.1
(GA: (GA: 1998) 1998)
Oracle 9.0 Oracle 9.0
(GA: (GA: 2001) 2001)
Oracle 9.2 Oracle 9.2
(GA: (GA: Jul 2002) Jul 2002)
11.2.0.2 11.2.0.2 9.2.0.8 9.2.0.8 7.3.4 7.3.4
11.2.0.2 11.2.0.2 9.2.0.8 9.2.0.8 8.0.6 8.0.6
10.2.0.5 10.2.0.5 8.1.7.4 8.1.7.4
10.2.0.5 10.2.0.5 9.0.1.4 9.0.1.4
11.2.0.2 11.2.0.2 9.2.0.8 9.2.0.8
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 67
(GA: (GA: Jul 2002) Jul 2002)
Oracle 10.1 Oracle 10.1
(GA: (GA: Jan 2004) Jan 2004)
Oracle 10.2 Oracle 10.2
(GA: (GA: Jul 2005) Jul 2005)
Oracle 11.1 Oracle 11.1
(GA: (GA: Aug 2007) Aug 2007)
Oracle 11.2 Oracle 11.2
(GA: (GA: Sep 2009) Sep 2009)
Oracle Oracle 12.1 12.1
(GA: (GA: Jun 2013) Jun 2013)
DIRECT DIRECT 11.2.0.2 11.2.0.2
DIRECT DIRECT 11.1.0.7 11.1.0.7
DIRECT DIRECT 10.2.0.5 10.2.0.5
11.2.0.2 11.2.0.2 9.2.0.8 9.2.0.8
11.2.0.2 11.2.0.2 10.1.0.5 10.1.0.5
Please note: This graph will apply to database upgrades only!
What's new in upgrades to Oracle 12c?
New SQL Automation FixUp Scripts
Fixing issues before and after upgrade
Detailed recommendations
Parallel Upgrade
Saving up to 40% upgrade duration
Upgrade driven by catctl.pl, not catupgrd.sql anymore
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 68
catctl.pl catctl.pl
script3.sql script3.sql script2.sql script2.sql script1.sql script1.sql
script4.sql script4.sql
script5.sql script5.sql
script6.sql script6.sql
script6.sql script6.sql
script7.sql script7.sql
script8.sql script8.sql
script9.sql script9.sql
script10.sql script10.sql
script11.sql script11.sql
catctl.pl
script3.sql script2.sql script1.sql
script4.sql
script5.sql
script6.sql
script6.sql
script7.sql
script8.sql
script9.sql
script10.sql
script11.sql
Information
Please note:
All of the following actions will apply to database
upgrades without changing to new hardware as well
just skip the steps to copy files from one system to
another
Some of the following steps can be executed in parallel
or in a different order, especially during preparation
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 69
or in a different order, especially during preparation
phase for simplification these steps are kept in a
strongly sequential order for the slides only
Installation of Oracle Database 12c
Install and patch
Oracle 12c
Preupgrade
Checks
Prepare
Environment
Restore Entire
Database
Upgrade
Database
Post Upgrade
Actions
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 70
Oracle 10.2.0.5
RHEL4 32bit
Oracle 12.1.0.1
OEL6 64bit
1TB
Patch the new Oracle Database 12c home
Apply the newest available
Patch Set Update (PSU)
or
Apply recommended
(bundled) patches (BP)
Install and patch
Oracle 12c
Preupgrade
Checks
Prepare
Environment
Restore Entire
Database
Upgrade
Database
Post Upgrade
Actions
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 71
Oracle 10.2.0.5
RHEL4 32bit
Oracle 12.1.0.1
OEL6 64bit
1TB
Apply Interim Patches
for known issues
New preupgrade scripts
preupgrd.sql and utluppkg.sql supersede utlu112i.sql
Copy ?/rdbms/admin/preupgrd.sql and
?/rdbms/admin/utluppkg.sql from your new Oracle 12c
home to your "old" source $ORACLE_HOME/rdbms/admin
Start preupgrd.sql in your source database
You may start preupgrd.sql in source environment's SQL*Plus
Install and patch
Oracle 12c
Preupgrade
Checks
Prepare
Environment
Restore Entire
Database
Upgrade
Database
Post Upgrade
Actions
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 72
You may start preupgrd.sql in source environment's SQL*Plus
directly from the Oracle 12c home avoiding the copy operation
Oracle 10.2.0.5
RHEL4 32bit
Oracle 12.1.0.1
OEL6 64bit
1TB
Copy preupgrd.sql
and utluppkg.sql
preupgrd.sql generates 1 log file and 2 scripts
SQL> @?/rdbms/admin/preupgrd.sql
generates its output in directory:
$ORACLE_BASE/cfgtoollogs/V102/preupgrade
preupgrade.log
has detailed information about any findings, suggestions, warnings,
corrections and errors in your source database
preupgrade_fixups.sql
Install and patch
Oracle 12c
Preupgrade
Checks
Prepare
Environment
Restore Entire
Database
Upgrade
Database
Post Upgrade
Actions
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 73
Oracle 10.2.0.5
RHEL4 32bit
Oracle 12.1.0.1
OEL6 64bit
1TB
preupgrade_fixups.sql
is the script you will need run in your source database it will
fix some issues or direct to fixes the DBA has to implement
postupgrade_fixups.sql
is meant to run shortly after the upgrade and will fix open issues and it will
contain directions for manual interaction as well (eg time zone change)
Run the new preupgrade script preupgrd.sql
Install and patch
Oracle 12c
Preupgrade
Checks
Prepare
Environment
Restore Entire
Database
Upgrade
Database
Post Upgrade
Actions
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 74
Oracle 10.2.0.5
RHEL4 32bit
Oracle 12.1.0.1
OEL6 64bit
1TB
If JAVAVM is not present or invalid or option off
preupgrd.sql won't create output files
Workaround:
$ cd $ORACLE_BASE/cfgtoollogs
$ mkdir <DB_UNIQUE_NAME>
$ cd <DB_UNIQUE_NAME>
Install and patch
Oracle 12c
Preupgrade
Checks
Prepare
Environment
Restore Entire
Database
Upgrade
Database
Post Upgrade
Actions
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 75
Oracle 10.2.0.5
RHEL4 32bit
Oracle 12.1.0.1
OEL6 64bit
1TB
$ mkdir preupgrade
Tracked as Bug14614756
Output log:
Install and patch
Oracle 12c
Preupgrade
Checks
Prepare
Environment
Restore Entire
Database
Upgrade
Database
Post Upgrade
Actions
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 76
Oracle 10.2.0.5
RHEL4 32bit
Oracle 12.1.0.1
OEL6 64bit
1TB
Run preupgrade_fixups.sql:
Install and patch
Oracle 12c
Preupgrade
Checks
Prepare
Environment
Restore Entire
Database
Upgrade
Database
Post Upgrade
Actions
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 77
Oracle 10.2.0.5
RHEL4 32bit
Oracle 12.1.0.1
OEL6 64bit
1TB
Manual actions required:
Install and patch
Oracle 12c
Preupgrade
Checks
Prepare
Environment
Restore Entire
Database
Upgrade
Database
Post Upgrade
Actions
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 78
Oracle 10.2.0.5
RHEL4 32bit
Oracle 12.1.0.1
OEL6 64bit
1TB
Further manual actions may be recommended:
Remove Enterprise Manager Database Control Repository:
$>
SQL>
EM DB Control is superseded in 12c by EM Express
Therefore no repository is needed anymore
If the EM repository is not removed up front, it will be automatically
emctl stop dbconsole
@?/rdbms/admin/emremove.sql
emctl stop dbconsole
@?/rdbms/admin/emremove.sql
Install and patch
Oracle 12c
Preupgrade
Checks
Prepare
Environment
Restore Entire
Database
Upgrade
Database
Post Upgrade
Actions
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 79
Oracle 10.2.0.5
RHEL4 32bit
Oracle 12.1.0.1
OEL6 64bit
1TB
If the EM repository is not removed up front, it will be automatically
removed during the catuppst.sql post-upgrade phase
Further manual actions may be recommended:
Essential step if OLS (Label Security) and/or DV (Database Vault)
was already in the database prior to the upgrade
SQL>
Prepares the move of AUD$ table from SYSTEM to SYS
Processes the audit records to minimize downtime
Moves records to an interim temporary table
@?/rdbms/admin/olspreupgrade.sql @?/rdbms/admin/olspreupgrade.sql
Install and patch
Oracle 12c
Preupgrade
Checks
Prepare
Environment
Restore Entire
Database
Upgrade
Database
Post Upgrade
Actions
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 80
Oracle 10.2.0.5
RHEL4 32bit
Oracle 12.1.0.1
OEL6 64bit
1TB
Moves records to an interim temporary table
May require DV actions as well (see the documentation)
Edit new init.ora:
Install and patch
Oracle 12c
Preupgrade
Checks
Prepare
Environment
Restore Entire
Database
Upgrade
Database
Post Upgrade
Actions
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 81
Oracle 10.2.0.5
RHEL4 32bit
Oracle 12.1.0.1
OEL6 64bit
1TB
Create a new password file:
$> cd $ORACLE_HOME/dbs
$> orapwd file=orapwV102
password=<string> entries=15
format=12 force=yes
Install and patch
Oracle 12c
Preupgrade
Checks
Prepare
Environment
Restore Entire
Database
Upgrade
Database
Post Upgrade
Actions
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 82
Oracle 10.2.0.5
RHEL4 32bit
Oracle 12.1.0.1
OEL6 64bit
1TB
Enviroment:
Set the 12.1 environment
Set ORACLE_BASE, ORACLE_HOME,
ORACLE_SID, TNS_ADMIN, TMP and TMPDIR
Windows only:
Create a new Service:
oradim NEW -SID ORASID -SYSPWD passwrd
-STARTMODE a -PFILE initfile
Install and patch
Oracle 12c
Preupgrade
Checks
Prepare
Environment
Restore Entire
Database
Upgrade
Database
Post Upgrade
Actions
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 83
Oracle 10.2.0.5
RHEL4 32bit
Oracle 12.1.0.1
OEL6 64bit
1TB
-STARTMODE a -PFILE initfile
Listener configuration:
Install and patch
Oracle 12c
Preupgrade
Checks
Prepare
Environment
Restore Entire
Database
Upgrade
Database
Post Upgrade
Actions
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 84
Oracle 10.2.0.5
RHEL4 32bit
Oracle 12.1.0.1
OEL6 64bit
1TB
Be aware if clients <11g connect Be aware if clients <11g connect then you must set: then you must set:
SQLNET.ALLOWED_LOGON_VERSION_SERVER=10
in $ORACLE_HOME/network/admin/sqlnet.ora
Either restore and recover an RMAN Online Backup
Create a fresh TEMP tablespace
Or copy all relevant files to the new server
Data files, redo logs, control files.
RMAN> run { SET ARCHIVELOG DESTINATION TO '/tmp/tmprest';
RESTORE DATABASE;
RECOVER DATABASE; }
Install and patch
Oracle 12c
Preupgrade
Checks
Prepare
Environment
Restore Entire
Database
Upgrade
Database
Post Upgrade
Actions
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 85
Network throughput is important!
Oracle 10.2.0.5
RHEL4 32bit
Oracle 12.1.0.1
OEL6 64bit
1TB
Changing to the same OS platform, but from 32bit 64bit
Change will be handled automatically as part of the upgrade
Special case: Keep the database version (not an upgrade!)

OLAP must be reloaded with xumuts.plb see MOS Note:352306.1


In the source environment:
startup upgrade;
@?/rdbms/admin/utlirp.sql
shutdown immediate
In the source environment:
startup upgrade;
@?/rdbms/admin/utlirp.sql
shutdown immediate
In the destination environment:
startup upgrade
@?/rdbms/admin/utlrp.sql
In the destination environment:
startup upgrade
@?/rdbms/admin/utlrp.sql
Install and patch
Oracle 12c
Preupgrade
Checks
Prepare
Environment
Restore Entire
Database
Upgrade
Database
Post Upgrade
Actions
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 86
Oracle 10.2.0.5
RHEL4 32bit
Oracle 12.1.0.1
OEL6 64bit
1TB
OLAP must be reloaded with xumuts.plb see MOS Note:352306.1
Start the database in STARTUP UPGRADE mode:
Install and patch
Oracle 12c
Preupgrade
Checks
Prepare
Environment
Restore Entire
Database
Upgrade
Database
Post Upgrade
Actions
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 87
Oracle 10.2.0.5
RHEL4 32bit
Oracle 12.1.0.1
OEL6 64bit
1TB
What happens during STARTUP UPGRADE mode?
Suppresses more than 20 expected error messages such as ORA-942
Snippet taken from the alert.log during STARTUP UPGRADE:
ALTER SYSTEM enable restricted session;
ALTER SYSTEM SET _system_trig_enabled=FALSE SCOPE=MEMORY;
Autotune of undo retention is turned off.
ALTER SYSTEM SET _undo_autotune=FALSE SCOPE=MEMORY;
ALTER SYSTEM SET undo_retention=900 SCOPE=MEMORY;
ALTER SYSTEM SET aq_tm_processes=0 SCOPE=MEMORY;
ALTER SYSTEM SET enable_ddl_logging=FALSE SCOPE=MEMORY;
Resource Manager disabled during database migration: plan
Install and patch
Oracle 12c
Preupgrade
Checks
Prepare
Environment
Restore Entire
Database
Upgrade
Database
Post Upgrade
Actions
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 88
Oracle 10.2.0.5
RHEL4 32bit
Oracle 12.1.0.1
OEL6 64bit
1TB
Resource Manager disabled during database migration: plan
'' not set
ALTER SYSTEM SET resource_manager_plan= SCOPE=MEMORY;
ALTER SYSTEM SET recyclebin='OFF' DEFERRED SCOPE=MEMORY;
Resource Manager disabled during database migration
replication_dependency_tracking turned off (no async
multimaster replication found)
AQ Processes can not start in restrict mode
Completed: ALTER DATABASE OPEN MIGRATE
New parallel upgrade script
Default feature in Oracle Database
SERVER component upgrade scripts get executed in parallel,
where possible
Other non-dependent components are run in parallel
Overall time to upgrade is reduced
between 20% and 40%
catctl.pl catctl.pl catctl.pl
Install and patch
Oracle 12c
Preupgrade
Checks
Prepare
Environment
Restore Entire
Database
Upgrade
Database
Post Upgrade
Actions
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 89
between 20% and 40%
Parallel upgrade is driven by a
PERL script
catctl.pl catctl.pl
script3.sql script3.sql script2.sql script2.sql script1.sql script1.sql
script4.sql script4.sql
script5.sql script5.sql
script6.sql script6.sql
script6.sql script6.sql
script7.sql script7.sql
script8.sql script8.sql
script9.sql script9.sql
script10.sql script10.sql
script11.sql script11.sql
catctl.pl
script3.sql script2.sql script1.sql
script4.sql
script5.sql
script6.sql
script6.sql
script7.sql
script8.sql
script9.sql
script10.sql
script11.sql
Parallel Upgrade Customer Examples
Telco System, Japan
Test upgrade from Oracle 9.2.0.8 to Oracle 11.2.0.3
Serial/Default
Install and patch
Oracle 12c
Preupgrade
Checks
Prepare
Environment
Restore Entire
Database
Upgrade
Database
Post Upgrade
Actions
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 90
0 500 1000 1500
ORACLE SERVER
Component Upgrade
669 669
1046 1046
Serial/Default
Parallel
36% faster 36% faster
seconds
Parallel Upgrade Customer Examples
Payback GmbH, Germany
Upgrade from Oracle 11.1.0.7 to Oracle 11.2.0.3 on
Exadata X2-2
Serial/Default
Install and patch
Oracle 12c
Preupgrade
Checks
Prepare
Environment
Restore Entire
Database
Upgrade
Database
Post Upgrade
Actions
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 91
seconds
0 200 400 600
ORACLE SERVER
Component Upgrade
338 338
539 539
Serial/Default
Parallel
seconds
37% faster 37% faster
Upgrade duration to Oracle 12c mainly depends on:
Number of installed components and database options
Number of objects in the database due to high amount of new
dictionary tables, and restructuring of some base system tables
CPU Speed
Component HH:MM:SS
Oracle Server 00:16:17
Install and patch
Oracle 12c
Preupgrade
Checks
Prepare
Environment
Restore Entire
Database
Upgrade
Database
Post Upgrade
Actions
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 92
JServer JAVA Virtual Machine 00:05:19
Oracle Workspace Manager 00:01:01
Oracle Enterprise Manager 00:10:13
Oracle XDK 00:00:48
Oracle Text 00:00:58
Oracle XML Database 00:04:09
Oracle Database Java Packages 00:00:33
Oracle Multimedia 00:07:43
Oracle Expression Filter 00:00:18
Oracle Rule Manager 00:00:12
Gathering Statistics 00:04:53
Total Upgrade Time: 00:52:31
Component HH:MM:SS
Oracle Server 00:16:17
JServer JAVA Virtual Machine 00:05:19
Oracle XDK 00:00:48
Oracle Text 00:00:58
Oracle XML Database 00:04:09
Oracle Database Java Packages 00:00:33
Gathering Statistics 00:02:43
Total Upgrade Time: 00:30:47
Speed up the upgrade
Create fresh dictionary statistics the night before the upgrade
SQL>
Create statistics for a specific XDB table if XDB is in use
SQL>
Install and patch
Oracle 12c
Preupgrade
Checks
Prepare
Environment
Restore Entire
Database
Upgrade
Database
Post Upgrade
Actions
exec DBMS_STATS.GATHER_DICTIONARY_STATS;
exec DBMS_STATS.GATHER_TABLE_STATS(ownname=>'XDB',
tabname=>'XDB$RESOURCE', estimate_percent=>NULL);
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 93
Preprocess missing entries in AUD$ if auditing was/is on
MOS Note: 1329590.1 offers a script to populate missing entries
If auditing was/is on by accident:
SQL>
If Oracle APEX is used consider to upgrade it separately
See MOS Note:1088970.1: Master Note for Oracle APEX Upgrades
truncate table SYS.AUD$ | SYSTEM.AUD$;
Start the upgrade on the Shell with catctl.pl in parallel:
catctl.pl is the PERL driver
Will execute the upgrade scripts in
parallel where possible
Executes catuppst.sql and
catbundle.sql as well
Install and patch
Oracle 12c
Preupgrade
Checks
Prepare
Environment
Restore Entire
Database
Upgrade
Database
Post Upgrade
Actions
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 94
Oracle 10.2.0.5
RHEL4 32bit
Oracle 12.1.0.1
OEL6 64bit
1TB
catbundle.sql as well
-n y determines the parallel degree
Maximum of 8 parallel threads
Progress monitoring while catctl.pl is running:
Install and patch
Oracle 12c
Preupgrade
Checks
Prepare
Environment
Restore Entire
Database
Upgrade
Database
Post Upgrade
Actions
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 95
Oracle 10.2.0.5
RHEL4 32bit
Oracle 12.1.0.1
OEL6 64bit
1TB
Default location for catctl.pl log files:
Current working directory
Hint: use l parameter to specify location
One log file for each parallel thread
Install and patch
Oracle 12c
Preupgrade
Checks
Prepare
Environment
Restore Entire
Database
Upgrade
Database
Post Upgrade
Actions
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 96
Oracle 10.2.0.5
RHEL4 32bit
Oracle 12.1.0.1
OEL6 64bit
1TB
Restart the database in normal mode
Create an spfile from the startup init.ora now
Install and patch
Oracle 12c
Preupgrade
Checks
Prepare
Environment
Restore Entire
Database
Upgrade
Database
Post Upgrade
Actions
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 97
Oracle 10.2.0.5
RHEL4 32bit
Oracle 12.1.0.1
OEL6 64bit
1TB
Recompilation with utlrp.sql
SQL> @utlprp n can be called directly to customize CPU usage
Most efficient value for n is 2x number of CPU cores
Gathering fixed objects stats may speed up recompilation

Install and patch


Oracle 12c
Preupgrade
Checks
Prepare
Environment
Restore Entire
Database
Upgrade
Database
Post Upgrade
Actions
SQL> exec DBMS_STATS.GATHER_FIXED_OBJECTS_STATS;
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 98
Oracle 10.2.0.5
RHEL4 32bit
Oracle 12.1.0.1
OEL6 64bit
1TB
Monitoring while utlrp.sql is running:
1. Objects requiring compilation:
SELECT COUNT(*) FROM obj$
WHERE status IN (4, 5, 6);
2. Objects compiled already:
SELECT COUNT(*) FROM UTL_RECOMP_COMPILED;
3. Parallel jobs created by UTL_RECOMP:
SELECT job_name FROM dba_scheduler_jobs
WHERE job_name like 'UTL_RECOMP_SLAVE_%';
Install and patch
Oracle 12c
Preupgrade
Checks
Prepare
Environment
Restore Entire
Database
Upgrade
Database
Post Upgrade
Actions
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 99
Oracle 10.2.0.5
RHEL4 32bit
Oracle 12.1.0.1
OEL6 64bit
1TB
WHERE job_name like 'UTL_RECOMP_SLAVE_%';
4. Parallel jobs still running:
SELECT job_name FROM dba_scheduler_running_jobs
WHERE job_name like 'UTL_RECOMP_SLAVE_%';
New status in DBA_REGISTRY for the SERVER component
in case of any error before recompilation:
Check REGISTRY$ERROR for error details
COMP_ID COMP_NAME VERSION STATUS
-------- ----------------------------------- ----------- ----------
CATALOG Oracle Database Catalog Views 12.1.0.1.0 INVALID
CATPROC Oracle Database Packages and Types 12.1.0.1.0 INVALID
JAVAVM JServer JAVA Virtual Machine 12.1.0.1.0 VALID
CATJAVA Oracle Database Java Packages 12.1.0.1.0 VALID
...
Install and patch
Oracle 12c
Preupgrade
Checks
Prepare
Environment
Restore Entire
Database
Upgrade
Database
Post Upgrade
Actions
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 100
Check REGISTRY$ERROR for error details
After recompiliation the status remains the same compared to
previous releases
Execute postupgrade_fixups.sql:
Install and patch
Oracle 12c
Preupgrade
Checks
Prepare
Environment
Restore Entire
Database
Upgrade
Database
Post Upgrade
Actions
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 101
Oracle 10.2.0.5
RHEL4 32bit
Oracle 12.1.0.1
OEL6 64bit
1TB
1509653.1
Run upgrade status check: utlu121s.sql:
Install and patch
Oracle 12c
Preupgrade
Checks
Prepare
Environment
Restore Entire
Database
Upgrade
Database
Post Upgrade
Actions
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 102
Oracle 10.2.0.5
RHEL4 32bit
Oracle 12.1.0.1
OEL6 64bit
1TB
Run invalid objects check: utluiobj.sql
Check also DBA_INVALID_OBJECTS
Install and patch
Oracle 12c
Preupgrade
Checks
Prepare
Environment
Restore Entire
Database
Upgrade
Database
Post Upgrade
Actions
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 103
Oracle 10.2.0.5
RHEL4 32bit
Oracle 12.1.0.1
OEL6 64bit
1TB
SQL> select OWNER, OBJECT_NAME,
OBJECT_TYPE from DBA_INVALID_OBJECTS
order by 1,2;
Time zone adjustment
Time zone conversion should be done post upgrade
Required if datatype TIMESTAMP WITH TIME ZONE is used
Rule: TZ
Destination
TZ
Source
Time zone definitions in: $ORACLE_HOME/oracore/zoneinfo
Oracle Database Release Default Time Zone Vers.
Install and patch
Oracle 12c
Preupgrade
Checks
Prepare
Environment
Restore Entire
Database
Upgrade
Database
Post Upgrade
Actions
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 104
10.2.0.3 10.2.0.5 DST V4
11.1.0.6 11.1.0.7 DST V4
11.2.0.1 DST V11
11.2.0.2 11.2.0.3 DST V14
12.1.0.1 DST V18
Most recent interim patch:
See MOS Note:412160.1
DST V20
Time zone adjustment Why is this important?
Real World Example from 2012:
Install and patch
Oracle 12c
Preupgrade
Checks
Prepare
Environment
Restore Entire
Database
Upgrade
Database
Post Upgrade
Actions
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 105
Why is the flight 1 hour shorter on Saturday?
Neither a faster jet nor better winds are the reason ... it's DST!!!
The USA moves to daylight savings time at 2:00 on 11-MAR-2012
Germany does not change until 25-MAR-2012
In 2013 it works better
Time zone adjustment:
Use the scripts from MOS Note:1509653.1
(or MOS Note:977512.1: Updating the RDBMS DST version in 11.2)
Install and patch
Oracle 12c
Preupgrade
Checks
Prepare
Environment
Restore Entire
Database
Upgrade
Database
Post Upgrade
Actions
Database will
be restarted!
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 106
Oracle 10.2.0.5
RHEL4 32bit
Oracle 12.1.0.1
OEL6 64bit
1TB
be restarted!
Case 1: Summary
Database upgrade including migration to a new server
Oracle 10.2.0.5 Oracle 12.1.0.1
1TB 1TB
24 hrs
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 107
Oracle 10.2.0.5
RHEL4 32bit
Oracle 12.1.0.1
OEL6 64bit
Install and
patch
Oracle 12c
Preupgrade
Checks
Prepare
Environment
Restore
Entire
Database
Upgrade
Database
Post
Upgrade
Actions
General Preparation Steps
Upgrade & Migration Cases
Fallback Strategies
Introduction & Overview
RAC Upgrade + ASM RAC Upgrade + ASM
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 108
Performance Management
Wrap Up
Fallback Strategies
New Features in Oracle 12c
Case 2: Upgrade RAC and move to ASM
RAC Database migration to a new cluster including upgrade
Example Facts & Description
1. Hardware migration to a new cluster
2. Database upgrade from Oracle 10.2.0.5 Linux 32bit to Oracle 11.2.0.3 Linux 64bit
3. Migration from OCFS into Oracle ASM
4. Maximum tolerated downtime: 4 hours
5. Database size: 5TB
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 109
5. Database size: 5TB
Oracle 10.2.0.5
RHEL4 32bit
4 hrs
5TB 5TB
Oracle 11.2.0.3
OEL5.8 64bit
Case 2: Upgrade RAC and move to ASM
RAC Database migration to a new cluster including upgrade
Install and patch:
GI and DB
11.2.0.3
DB 10.2.0.5
Preupgrade
Checks
Prepare
Environment
and ASM
Restore
Online
Backup for
Standby
Activate
and
Upgrade
Post
Upgrade
Actions
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 110
Oracle 10.2.0.5
RHEL4 32bit
4 hrs
5TB 5TB
Oracle 11.2.0.3
OEL5.8 64bit
Oracle 10.2.0.5
PHYSICAL STANDBY PHYSICAL STANDBY
Physical Standby Migration
Using a physical standby database to move to new
hardware with minimal downtime
Fast and simple to setup and maintain
The entire process can be tested over and over again
With minimal impact on production
It would even work cross platform in some cases:
For supported combinations see: Note:413484.1
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 111
For supported combinations see: Note:413484.1
HP-PA 11.23 HP-IA64 in Oracle 10.2.0.2
See: Note:395982.1
MS Windows Linux from Oracle 11g
Solaris x86 Linux x86 from Oracle 11g
But currently no cross-Endianness combinations possible
RMAN Mixed Platform Support
RMAN duplicate/restore/recovery Mixed Platform Support
Note:1079563.1
Mixed platforms are only supported for:
Active Database DUPLICATE
Backup-based DUPLICATE using image copies or backup sets
RESTORE and RECOVER using image copies or backup sets
The following platform combinations are supported (in both directions):
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 112
Oracle 10.2 and above:
Solaris x64 Linux x64
HP PA RISC HP Itanium
Windows IA64 Windows 64-bit for AMD / Windows (x86-64)
Oracle 11.1 and above (COMPATIBLE 11.1):
Linux Windows
If there's a bit change involved (3264) then utlirp.sql has to be run
to invalidate all PL/SQL and stored code
Migration to ASM
Option with downtime:
Restore database with RMAN into Oracle ASM
Option with less than 1 minute downtime:
Restore database for Standby with RMAN into Oracle ASM
If no database upgrade is required:
Simple role exchange: Switchover
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 113
If a subsequent database upgrade is required:
Activate the standby database
Upgrade the activated database
In case of failure the source database remains unchanged
Always install (or later: upgrade) Oracle Clusterware first!
Install it into a new Grid Infrastructure home
The grid infrastructure version must be greater than or equal to the
version of the resources it manages e.g. ASM, RDBMS
Parts of Grid Infrastructure home are owned by 'root
Make sure to check Note:948456.1 for known issues
Install and patch:
GI and DB 11.2.0.3
DB 10.2.0.5
Preupgrade Checks
Prepare Environment
and ASM
Restore Online
Backup for Standby
Activate and
Upgrade
Post Upgrade
Actions
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 114
Oracle 10.2.0.5
RHEL4 32bit
5TB
Oracle 11.2.0.3
OEL5.8 64bit
Oracle Home/Base
ORACLE_BASE for GI should be different than the ORACLE_BASE
for Oracle Database
Each installation user should have its own Oracle Base
Grid Infrastructure Installation
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 115
RAC Best Practice and Starter Kit
The goal of the Oracle Real Application Clusters (RAC) Best Practice and Starter Kit
is to provide you with the latest information on generic and platform specific best
practices for implementing an Oracle RAC cluster
Always start with the Generic note, and then refer to platform specific notes
MOS Note: 810394.1 - RAC and Oracle Clusterware Best Practices and Starter Kit (Generic)
MOS Note: 811306.1 - RAC and Oracle Clusterware Best Practices and Starter Kit (Linux)
MOS Note: 811271.1 - RAC and Oracle Clusterware Best Practices and Starter Kit (Windows)
GI Upgrade Planning, Prep and Prereqs
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 116
MOS Note: 811271.1 - RAC and Oracle Clusterware Best Practices and Starter Kit (Windows)
MOS Note: 811293.1 - RAC and Oracle Clusterware Best Practices and Starter Kit (AIX)
MOS Note: 811303.1 - RAC and Oracle Clusterware Best Practices and Starter Kit (HP-UX)
MOS Note: 811280.1 - RAC and Oracle Clusterware Best Practices and Starter Kit (Solaris)
Plus additional VERY useful notes:
MOS Note: 1096952.1 - Master Note for RAC, Clusterware and Grid Infrastructure
MOS Note: 1053147.1 - 11.2 Clusterware and Grid Home What you need to know!
RAC Check
RACcheck 2.2.2 has been released June 18, 2013
RACcheck is a RAC configuration audit tool for RAC, CRS, ASM,GI
Checks for:
OS kernel parameters, OS packages, OS settings etc
CRS/Grid Infrastructure, RDBMS, ASM, Database parameters
11.2.0.3 Upgrade Readiness assessment
RACcheck 11.2.0.3 Upgrade Readiness Assessment
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 117
RACcheck 11.2.0.3 Upgrade Readiness Assessment
MOS Note:1457357.1
RACcheck Users Guide
https://support.oracle.com/epmos/main/downloadattachmentprocessor?attachid=1268927.1:RACCHECKUSERSGUIDE&clickstream=no
Available for download via MOS Note:1268927.1
GI Home: Planning, Prep and Prereqs
11.2 Grid Infrastructure Home cannot reside on a shared cluster file
system e.g. ocfs2, Veritas CFS
NFS based shared storage is supported
Installer will allow move from 10.2 on CFS to 11.2 on non-CFS
All cluster nodes must be up and running
Remove any down nodes, or start them if possible
Unset environment variables ORACLE_HOME, ORACLE_BASE and
ORA_CRS_HOME for the installing user - the install scripts handle these
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 118
ORA_CRS_HOME for the installing user - the install scripts handle these
Avoid OUI AttachHome issues
Set the following parameter in the SSH daemon configuration file
/etc/ssh/sshd_config on all cluster nodes before running OUI
LoginGraceTime 0
Restart sshd
Provision network resources for Single Client Access Name (SCAN)
Oracle Database 11.2 Clients connect to the database using SCAN
VIPs
The SCAN is associated with the entire cluster rather than an
individual node
Resolves to up to 3 IP Addresses in DNS or GNS
IP addresses returned in a round-robin manner
SCAN listeners run under the Grid Infrastructure Home
SCAN: Planning, Prep and Prereqs
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 119
SCAN listeners run under the Grid Infrastructure Home
Provides load balancing and failover for client connections
Check this white paper for more details:
Oracle Real Application Clusters 11g Release 2 Overview of SCAN (PDF)
http://www.oracle.com/technetwork/database/clustering/overview/scan-129069.pdf
SCAN VIPs - Network Requirement
A single client access name (SCAN) configured in DNS
[root@cluster1 oracle]# nslookup
mycluster-scan1
Server: 120.20.190.70
Address: 120.20.190.70#53
Name: mycluster -scan1.mydomain.com
Address: 10.148.46. 79
Name: mycluster -scan1.mydomain.com
[root@cluster1 oracle]# nslookup
mycluster-scan1
Server: 120.20.190.70
Address: 120.20.190.70#53
Name: mycluster -scan1.mydomain.com
Address: 10.148.46. 79
Name: mycluster -scan1.mydomain.com
SCAN: Planning, Prep and Prereqs
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 120
Name: mycluster -scan1.mydomain.com
Address: 10.148.46. 77
Name: mycluster -scan1.mydomain.com
Address: 10.148.46. 78
Name: mycluster -scan1.mydomain.com
Address: 10.148.46. 77
Name: mycluster -scan1.mydomain.com
Address: 10.148.46. 78
Top Level Flow:
Verify the hardware/software environment
Install the software
Configure the software
Finalize the upgrade
Completing the Upgrade
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 121
Top Level Flow:
Verify the hardware/software environment
Secure Shell
We recommend using OUI to set up ssh
Old ssh setup not always considered valid by 11.2 OUI, due to tighter restrictions, but OUI will correct it
OUI will validate ssh before allowing you to continue
Watch out for stty commands or profile messages that may cause the automatic setup of ssh to fail
Completing the Upgrade
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 122
Cluster Verification Utility
Integrated into OUI but recommended to run before an install/upgrade
Has fixup scripts to correct certain failures (e.g. kernel parameters)
The most recent version is available from OTN
http://www.oracle.com/technetwork/products/clustering/overview/index.html
Install the software
Configure the software
Finalize the upgrade
Top Level Flow:
Verify the hardware/software environment
Install the software
Oracle Universal Installer ./runInstaller
Should find existing Oracle Clusterware and suggest upgrade to Grid
Infrastructure
Must run installer as the previous version's software owner
Completing the Upgrade
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 123
Must run installer as the previous version's software owner
If you need to collect debug tracing (request from support)
./runInstaller -debug
Output is written to stdout by default
Use script command to capture the output
Configure the software
Finalize the upgrade
Additional information: Pinning nodes [from documentation]
In order to change the node pin behavior the appropriate command is the /crsctl
pin/unpin css/ command, to pin or unpin any specific node. Pinning a node means that
the association of a node name with a node number is fixed. If a node is not pinned,
its node number may change if the lease expires while it is down. The lease of a
pinned node never expires. Deleting a node with the /crsctl delete node/ command
implicitly unpins the node.
During upgrade of Oracle Clusterware, all servers are pinned, whereas after a
fresh installation of Oracle Clusterware 11/g /release 2 (11.2), all servers you add to
the cluster are unpinned.
Grid Infrastructure 11.2
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 124
the cluster are unpinned.
You cannot unpin a server that has an instance of Oracle RAC that is older
than Oracle Clusterware 11/g/ release 2 (11.2) if you installed Oracle Clusterware
11/g/ release 2 (11.2) on that server.
Pinning a node is required for rolling upgrade to Oracle Clusterware 11.2 and will be
done automatically. We have seen cases where customer perform a manual upgrade
and this would fail due to unpinned nodes.
Grid Infrastructure Installation 11.2
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 125
Grid Infrastructure Installation 11.2
Node Selection and SSH
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 126
Make sure that BASE and SW location
are different subdirectories the slide
has it the wrong way!!!
Make sure that BASE and SW location
are different subdirectories the slide
has it the wrong way!!!
Grid Infrastructure Installation 11.2
Grid Home
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 127
Grid Infrastructure Installation 11.2
Setup ASM Roles
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 128
Grid Infrastructure Installation 11.2
Cluster Verification
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 129
Grid Infrastructure Installation 11.2
Cluster Verification
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 130
root> /tmp/CVU_11.2.0.1.0_grid/runfixup.sh
Response file being used is :/tmp/CVU_11.2.0.1.0_grid/fixup.response
Enable file being used is :/tmp/CVU_11.2.0.1.0_grid/fixup.enable
Log file location: /tmp/CVU_11.2.0.1.0_grid/orarun.log
Setting Kernel Parameters...
fs.file-max = 327679
root> /tmp/CVU_11.2.0.1.0_grid/runfixup.sh
Response file being used is :/tmp/CVU_11.2.0.1.0_grid/fixup.response
Enable file being used is :/tmp/CVU_11.2.0.1.0_grid/fixup.enable
Log file location: /tmp/CVU_11.2.0.1.0_grid/orarun.log
Setting Kernel Parameters...
fs.file-max = 327679
Grid Infrastructure Installation 11.2
Cluster Verification
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 131
fs.file-max = 327679
fs.file-max = 6815744
net.ipv4.ip_local_port_range = 9000 65500
net.core.wmem_max = 262144
net.core.wmem_max = 1048576
uid=501(grid)gid=502(oinstall)groups=502(oinstall),
503(asmadmin),504(asmdba)
fs.file-max = 327679
fs.file-max = 6815744
net.ipv4.ip_local_port_range = 9000 65500
net.core.wmem_max = 262144
net.core.wmem_max = 1048576
uid=501(grid)gid=502(oinstall)groups=502(oinstall),
503(asmadmin),504(asmdba)
Grid Infrastructure Installation 11.2
Cluster Verification
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 132
Grid Infrastructure Installation 12c
Management Repository
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 133
Grid Infrastructure Installation 12c
Management Repository
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 134
Clusterware - ASM - DB Compatibility
Note:
337737.1
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 135
a) The Matrix is valid after the (rolling) upgrade has been completed.
During the upgrade you may use an older ASM version.
b) The ASM version needs to be at least 10.1.0.3
Oracle Clusterware & ASM Upgrade
Documentation:
Oracle Clusterware Administration and Deployment Guide 11g
http://download.oracle.com/docs/cd/E11882_01/rac.112/e16794/toc.htm
Grid Infrastructure Upgrade Known Issues:
Note: 948456.1: Pre 11.2 Database Issues in 11gR2 Grid Infrastructure
Oracle Clusterware rolling upgrade:
Note: 338706.1: Oracle Clusterware Rolling Upgrades
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 136
RAC Best Practices Starter Kit:
Note:810394.1: RAC Assurance Support Team: RAC and Oracle Clusterware Starter
Kit and Best Practices (Generic)
Also see platform-specific notes linked from the generic starter kit
Upgrading an ASM instance with OUI within Oracle Clusterware
upgrade: OUI or asmca upgrade
http://docs.oracle.com/cd/E11882_01/server.112/e16102/asminst.htm#CHDGFHDC
Oracle Grid Infrastructure Patch Sets
Oracle Grid Infrastructure Patch Set 11.2.0.3:
Patch set is a bit misleading: its a full release!
Installation is out-of-place only into a separate home
To upgrade from GI 11.2.0.1 to GI 11.2.0.2 or later:
Apply PSU 11.2.0.1.2 (or newer) in-place
Rolling upgrade ASM issue for 11.2.0.1=>11.2.0.2 (bug 9329767)
Rolling upgrade ASM issue for 11.2.0.2=>11.2.0.3 (bug12539000)
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 137
RAC/Grid Infrastructure Upgrade Note:
Note:810394.1: RAC Assurance Support Team: RAC and Oracle Clusterware
Starter Kit and Best Practices (Generic)
Also see platform-specific notes linked from the generic starter kit
VERY IMPORTANT:
Follow all instructions in Note:1212703.1
Make sure MULTICAST is setup correctly Note:1054902.1 section D
Make sure to check Oracle Database Readme 11g Release 2 Section 1.37 - "Open Bugs
Then upgrade GI within OUI
Oracle EXADATA 11.2.0.3 Patching
11.2.0.1/11.2.0.2 to 11.2.0.3 Database Upgrade on
Exadata Database Machine in Note:1373255.1
MULTICAST is already setup correctly on a Database Machine V2
For certification, recommendations, issues, current
patches etc. see Note:888828.1
Database Machine and Exadata Storage Server 11.2 Supported Versions
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 138
Database software installation:
Oracle Database 11.2.0.3
Oracle Database 10.2.0.1 plus patch set 10.2.0.5
Install and patch:
GI and DB 11.2.0.3
DB 10.2.0.5
Preupgrade Checks
Prepare Environment
and ASM
Restore Online
Backup for Standby
Activate and
Upgrade
Post Upgrade
Actions
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 139
Oracle 10.2.0.5
RHEL4 32bit
5TB
Oracle 11.2.0.3
OEL5.8 64bit
Oracle 10.2.0.5
PHYSICAL STANDBY PHYSICAL STANDBY
Download preupgrade check script utlu112i.sql
See MOS Note:884522.1
Run utlu112i.sql in the source database
Without script execution the upgrade won't proceed
Install and patch:
GI and DB 11.2.0.3
DB 10.2.0.5
Preupgrade Checks
Prepare Environment
and ASM
Restore Online
Backup for Standby
Activate and
Upgrade
Post Upgrade
Actions
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 140
Oracle 10.2.0.5
RHEL4 32bit
5TB
Oracle 11.2.0.3
OEL5.8 64bit
Copy utlu112i.sql
or download it 884522.1
Note 452924.1 - How to Prepare Storage for ASM
Raw disk
Logical unit numbers (LUNs)
Raw logical volumes (LVM)
LVM configurations are not recommended
NFS files
Suitable for testing only
Install and patch:
GI and DB 11.2.0.3
DB 10.2.0.5
Preupgrade Checks
Prepare Environment
and ASM
Restore Online
Backup for Standby
Activate and
Upgrade
Post Upgrade
Actions
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 141
Suitable for testing only
Oracle 10.2.0.5
RHEL4 32bit
5TB
Oracle 11.2.0.3
OEL5.8 64bit
Configuring ASM with ASMCA
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 142
Configuring ASM with ASMCA
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 143
Configuring ASM with ASMCA
DB0
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 144
Configuring ASM with ASMCA
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 145
Case 2: Upgrade RAC and move to ASM
RAC Database migration to a new cluster including upgrade
Install and patch:
GI and DB
11.2.0.3
DB 10.2.0.5
Preupgrade
Checks
Prepare
Environment
and ASM
Restore
Online
Backup for
Standby
Activate
and
Upgrade
Post
Upgrade
Actions
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 146
Oracle 10.2.0.5
RHEL4 32bit
4 hrs
5TB
Oracle 11.2.0.3
OEL5.8 64bit
Oracle 10.2.0.5
PHYSICAL STANDBY PHYSICAL STANDBY
Install and patch:
GI and DB 11.2.0.3
DB 10.2.0.5
Preupgrade Checks
Prepare Environment
and ASM
Restore Online
Backup for Standby
Activate and
Upgrade
Post Upgrade
Actions
Source Destination
Make sure archive logging is on
Switch on Force Logging Create identical trace file structure
Copy Online Backup to DESTINATION Create a password file with identical PW
Adjust init.ora Adjust init.ora
Adjust tnsnames.ora Adjust listener.ora and tnsnames.ora
Restore backup into ASM
Adjust controlfile names
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 147
Oracle 10.2.0.5
RHEL4 32bit
5TB
Oracle 11.2.0.3
OEL5.8 64bit
5TB
Oracle 10.2.0.5
PHYSICAL STANDBY PHYSICAL STANDBY
Adjust controlfile names
Switch on log transport Switch on managed recovery mode
Restore backup
Restore Backup into ASM
Make sure the backup is available on DESTINATION
rman target /
connected to target database (not started)
RMAN> startup nomount
RMAN> restore spfile to pfile "$ORACLE_HOME/dbs/initSTY.ora"
from "$ORACLE_BKD/my.spfile";
Modify init.ora:
*.db_create_file_dest=+DG1
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 148
*.db_create_file_dest=+DG1
*.db_recovery_file_dest=+FRA1
Connect again with RMAN to restore the backup into ASM
rman target sys/password@source auxiliary /
RMAN> startup auxiliary nomount;
RMAN> duplicate target database for standby dorecover;
Move OCR and Voting Disk from ASM to raw
Rename controlfiles and switch on log transport and recovery
Stop on production
Final synchronisation and activate standby
Upgrade
SQL> @?/rdbms/admin/catupgrd.sql
SQL> @?/rdbms/admin/catuppst.sql
SQL> @?/rdbms/admin/utlrp.sql
Install and patch:
GI and DB 11.2.0.3
DB 10.2.0.5
Preupgrade Checks
Prepare Environment
and ASM
Restore Online
Backup for Standby
Activate and
Upgrade
Post Upgrade
Actions
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 149
Oracle 10.2.0.5
RHEL4 32bit
5TB
Oracle 11.2.0.3
OEL5.8 64bit
5TB
Oracle 10.2.0.5
PHYSICAL STANDBY PHYSICAL STANDBY
Synch and Activate Standby
Stop the application on SOURCE
Get the last changes written into logfiles on all nodes
SQL> alter system archive log current;
Stop the production database on SOURCE
$> srvctl stop database -d PROD
Check if logfile got shipped and applied
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 150
Stop managed recovery for the standby on DESTINATION
SQL> alter database recover managed standby database cancel;
SQL> shutdown immediate;
Bring the standby back in mount and initiate the activation:
SQL> alter database recover managed standby database finish
skip standby logfile;
SQL> alter database commit to switchover to primary:
Create temporary tablespaces
Register the database and its instances to Clusterware
$> srvctl add database -d PROD -o
/oracle/base/product/11.2.0/dbhome -p '+DG1/prodspfile.ora'
$> srvctl add instance -d PROD -i PROD1 -n mynode1
If you upgrade without moving to new hardware you'll execute:
$> srvctl upgrade database d <SID> -o <new$OH>
Install and patch:
GI and DB 11.2.0.3
DB 10.2.0.5
Preupgrade Checks
Prepare Environment
and ASM
Restore Online
Backup for Standby
Activate and
Upgrade
Post Upgrade
Actions
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 151
Oracle 10.2.0.5
RHEL4 32bit
5TB
Oracle 11.2.0.3
OEL5.8 64bit
5TB
Advance ASM diskgroup compatibility
ASMCA> alter diskgroup data set attribute 'compatible.asm'='11.2';
ASMCA> alter diskgroup data set attribute 'compatible.rdbms'='11.2';
Move OCR and Voting into ASM
$> ocrconfig -add +data
$> ocrconfig -delete /dev/raw/raw1
$> crsctl replace votedisk +VOTING
Set CLUSTER_DATABASE to TRUE and start the instances on all nodes
Install and patch:
GI and DB 11.2.0.3
DB 10.2.0.5
Preupgrade Checks
Prepare Environment
and ASM
Restore Online
Backup for Standby
Activate and
Upgrade
Post Upgrade
Actions
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 152
Set CLUSTER_DATABASE to TRUE and start the instances on all nodes
Oracle 10.2.0.5
RHEL4 32bit
5TB
Oracle 11.2.0.3
OEL5.8 64bit
5TB
Important Notes and White Papers
TWP: Migration to Oracle ASM
http://www.oracle.com/technetwork/database/features/availability/maa-wp-10gr2-
asmmigrationwithdg-133513.pdf
Note 452924.1 - How to Prepare Storage for ASM
Note 265633.1 - ASM Technical Best Practices
Note 249992.1 - New Feature on ASM (Automatic Storage Manager)
Note 345180.1 - How to duplicate a controlfile when ASM is involved
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 153
Note 252219.1 - Steps To Migrate/Move a Database From Non-ASM to ASM And Vice-
Versa
Note: 787793.1 - Creating a physical standby from ASM primary
Note:1079563.1 - RMAN duplicate support for mixed platform
Note: 430278.1 - Can you restore RMAN backups taken on 32-bit Oracle with 64-bit
Oracle?
Case 2: Summary
RAC Database migration to a new cluster including upgrade
Oracle 10.2.0.5
RHEL4 32bit
4 hrs
5TB 5TB
Oracle 11.2.0.3
OEL5.8 64bit
Oracle 10.2.0.5
PHYSICAL STANDBY PHYSICAL STANDBY
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 154
RHEL4 32bit OEL5.8 64bit
Install and patch:
GI and DB
11.2.0.3
DB 10.2.0.5
Preupgrade
Checks
Prepare
Environment
and ASM
Restore
Online
Backup for
Standby
Activate
and
Upgrade
Post
Upgrade
Actions
PHYSICAL STANDBY PHYSICAL STANDBY
Real World Checkpoint
The Customer:
Interhyp AG
HQ in Munich, Germany
Bank for residential and
development financing
Offering banking service to other German key
banks as well
Customer
Project
Constraints
Preparation
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 155
banks as well
100% subsidiary of Dutch ING Bank
Upgrade
Success?
Remarks
Preparation
Real World Checkpoint
Project scope:
Upgrade 6x 2-node-RAC systems all on
Oracle 10.1.0.5 on RH Linux 32bit
Target:
Oracle RAC 11.2.0.2 with ASM
RH Linux 64bit
Hardware exchange for key systems
Customer
Project
Constraints
Preparation
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 156
Hardware exchange for key systems
= 4-node cluster
Upgrade
Success?
Remarks
Preparation
Real World Checkpoint
Constraints:
Downtime window limited to 4 hrs per database
Migrations to be done serially, not in parallel
Not the fastest network connection
LOBs in the source database
First tests with Data Pump on NETWORK_LINK
didn't fit into the downtime requirements
Customer
Project
Constraints
Preparation
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 157
didn't fit into the downtime requirements
Upgrade
Success?
Remarks
Preparation
Real World Checkpoint
Prepare new cluster
Install Oracle Grid Infrastructure 11.2 and patch it
Decrease upgrade duration to ~30 minutes
Remove unused components from production
database
Customer
Project
Constraints
Preparation
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 158
Upgrade
Success?
Remarks
Preparation
Real World Checkpoint
Build up a physical standby database on the
new cluster
Oracle 10.1.0.5 = Oracle 10.1.0.5 within 11.2 ASM
Note: This is officially not supported but will work
Goal: Activate and upgrade the standby database
Advantage: This can be tested many times
without impacting the production system
Customer
Project
Constraints
Preparation
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 159
without impacting the production system
Upgrade
Success?
Remarks
Preparation
Real World Checkpoint
Upgrade
Activate standby and start in STARTUP UPGRADE
Invalidate and compile all packages/code (32bit
= 64bit!)
Register database to Clusterware and move
OCR/Voting to ASM
Customer
Project
Constraints
Preparation
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 160
Upgrade
Success?
Remarks
Preparation
Real World Checkpoint
Live? And alive?
Yes!!! Go Live: 27-NOV-2010
Total downtime: ~2 hours
Database upgrade time:
24 minutes + 5 minutes recompilation
Very robust using the entire Oracle software stack
Customer
Project
Constraints
Preparation
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 161
Upgrade
Success?
Remarks
Preparation
Real World Checkpoint
Well ... the optimizer ...
We found some optimizer issues
Reports were affected
Remedy: Hints, rewrite and patches plus SQL
Profiles
Customer
Project
Constraints
Preparation
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 162
Upgrade
Success?
Remarks
Preparation
General Preparation Steps
Upgrade & Migration Cases
Fallback Strategies
Introduction & Overview
Endianness Migration Endianness Migration
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 163
Performance Management
Wrap Up
Fallback Strategies
New Features in Oracle 12c
Case 3: Cross Endianness Migration
Migration of a single instance database to Exadata
Example Facts & Description
1. Hardware migration to an Exadata Database Machine
2. Cross Endianness database migration from Oracle 9.2.0.8 to Oracle 11.2.0.3
3. Maximum tolerated downtime: 24 hours
4. Database size: 8TB
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 164
Oracle Oracle 9.2.0.8 9.2.0.8
HP HP- -UX UX
Oracle 11.2.0.3 Oracle 11.2.0.3
OEL5.8 64bit OEL5.8 64bit
8TB 8TB
24 hrs
Case 3: Cross Endianness Migration
Options with Oracle 9i:
exp and imp
Import of all versions Oracle V5 possible
exp is not supported for general use since Oracle 11g
But the utility is still there and can be used
imp is still supported for importing older dumpfiles
Neither fast nor reliable nor comfortable
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 165
Neither fast nor reliable nor comfortable
Oracle 9.2.0.8 Oracle 9.2.0.8
HP HP- -UX UX
24 hrs
8TB
Oracle 11.2.0.3 Oracle 11.2.0.3
OEL5.8 64bit OEL5.8 64bit
8TB
Case 3: Cross Endianness Migration
Options since Oracle 10g:
Data Pump expdp and impdp
Usally the first option as it is easy and powerful
Cross platform Transportable Tablespaces (TTS)
More complicated, more manual steps than Data Pump
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 166
Oracle 9.2.0.8 Oracle 9.2.0.8
HP HP- -UX UX
24 hrs
8TB
Oracle 11.2.0.3 Oracle 11.2.0.3
OEL5.8 64bit OEL5.8 64bit
8TB
Oracle 11.2.0.3 Oracle 11.2.0.3
HP HP- -UX UX
8TB
SWING
Case 3: Cross Endianness Migration
Migration of a single instance database to Exadata
Prepare a
new database
on EXADATA
Restore online
backup to
SWING
Upgrade
database on
SWING
Full database
import via
NETWORK_LINK
Post Migration
Actions
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 167
Oracle 9.2.0.8 Oracle 9.2.0.8
HP HP- -UX UX
24 hrs
8TB
Oracle 11.2.0.3 Oracle 11.2.0.3
OEL5.8 64bit OEL5.8 64bit
8TB
Oracle 11.2.0.3 Oracle 11.2.0.3
HP HP- -UX UX
8TB
SWING
Data Pump Overview
The new faster export-import
Available starting with Oracle 10.1
Powerful concept:
Restartable via job interface
Command line and API (DBMS_DATAPUMP)
PARALLEL export and import of data (single-threaded for metadata)
EXCLUDE & INCLUDE (For examples see MOS Note:341733.1)
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 168
EXCLUDE & INCLUDE (For examples see MOS Note:341733.1)
COMPRESS=ALL starting in Oracle 11.1
(requires Advanced Compression Option)
NETWORK_LINK for direct import via a database link
Master Note for Data Pump: MOS Note:1264715.1
For Compatibility and version changes: MOS Note:553337.1
Data Pump Overview
Limitations
Not compatible with "old" exp/imp
"Old" par files can be used since Oracle 11.2 with the legacy interface,
but will not take advantage of new features such as parallelism
Old exp dump files cannot be imported by Data Pump
Restrictions:
For Oracle 10.2, handles everything except for XMLSCHEMA types
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 169
For Oracle 10.2, handles everything except for XMLSCHEMA types
As of Oracle 11.1, handles all data types
Known Issues: Master Note for Data Pump: MOS Note:1264715.1
LONG and LOB data
Generally slow because of the data type implementation
STRONG RECOMMENDATION to migrate to SecureFiles
Data Pump can work in parallel on SecureFiles type
New in Oracle 12c: TRANSFORM=LOB_STORAGE:SECURE_FILE
Data Pump Best Practices
For full exports the role EXP_FULL_DATABASE is required
For export consistency use:
FLASHBACK_TIME=SYSTIMESTAMP
This will increase UNDO requirements for the duration of the export
Always set parameters:
EXCLUDE=STATISTICS
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 170
METRICS=YES
Speed up Data Pump:
PARALLEL=n
Typically n = 2x <number of CPU cores>
EXCLUDE=INDEXES on import
1. Initial impdp with EXCLUDE=INDEXES
2. Second impdp with INCLUDE=INDEXES SQLFILE=indexes.sql
3. Split indexes.sql into multiple SQL files and run in multiple sessions
Data Pump Best Practices
Direct import from source to target over a database link
Parameter: NETWORK_LINK
Run only impdp on the target system - no expdp necessary
No dump file written, no disk I/O, no file transfer needed
Restrictions of database links apply:
Does not work with LONG/LONG RAW and certain object types
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 171
Performance depends on network bandwidth and target
system's CPU capacity
$ expdp ...
Data Pump Best Practices
NETWORK_LINK Customer Example from OOW 2011
Kaiser Permanente, Medicare (USA)
impdp on NETWORK_LINK with 8 vs 16 CPU cores
A 10GBit connection could be leveraged up to 8 Gbit
Copied a Terabyte table in 15+ minutes = 4 TB/hour
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 172
Data Pump Filtering
Filtering is very powerful
If using EXCLUDE parameter, everything else is included
If using INCLUDE parameter, everything else is excluded
Cant use exclude and include in the same Data Pump job
Specify complete path or partial path
Objects matching the specified path will be excluded/included
Query to find exclude/include object types:
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 173
Query to find exclude/include object types:
select unique seq_num, full_path
from sys.datapump_paths
where het_type = 'DATABASE_EXPORT'
order by seq_num;
Job_type: het_type:
FULL DATABASE_EXPORT
SCHEMA SCHEMA_EXPORT
TABLE TABLE_EXPORT
TRANSPORTABLE TRANSPORTABLE_EXPORT
Data Pump Filtering
EXCLUDE example
expdp system/manager schema=hr exclude=statistics
vs
expdp system/manager schema=hr
exclude=SCHEMA_EXPORT/TABLE/STATISTICS
select unique SEQ_NUM, FULL_PATH
from SYS.DATAPUMP_PATHS
where HET_TYPE = 'SCHEMA_EXPORT' AND
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 174
where HET_TYPE = 'SCHEMA_EXPORT' AND
FULL_PATH like '%STATISTICS% order by SEQ_NUM;
77 SCHEMA_EXPORT/TABLE/INDEX/STATISTICS
78 SCHEMA_EXPORT/TABLE/INDEX/STATISTICS/INDEX_STATISTICS
221 SCHEMA_EXPORT/TABLE/INDEX/STATISTICS
222 SCHEMA_EXPORT/TABLE/INDEX/STATISTICS/FUNCTIONAL_AND_BITMAP
223 SCHEMA_EXPORT/TABLE/INDEX/STATISTICS/FUNCTIONAL_AND_BITMAP/INDEX_STATISTICS
225 SCHEMA_EXPORT/TABLE/STATISTICS
226 SCHEMA_EXPORT/TABLE/STATISTICS/TABLE_STATISTICS
227 SCHEMA_EXPORT/TABLE/STATISTICS/USER_PREF_STATISTICS
Data Pump Filtering
INCLUDE example
Same results
Includes all objects that have table in the path
impdp system/manager tables=hr.employees
vs
impdp system/manager schemas=hr
include=table:\"= \'EMPLOYEES\'\"
vs
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 175
Only includes the table definition
Some of the TABLE object paths
vs
impdp system/manager schemas=hr
include=table/table:\"= \'EMPLOYEES\'\
SCHEMA_EXPORT/TABLE/TABLE
SCHEMA_EXPORT/TABLE/TABLE_DATA
SCHEMA_EXPORT/TABLE/GRANT
Data Pump News in Oracle 12c
Full transportable export/import for an entire database
Support for multitenant container databases and pluggable
databases
New VIEWS_AS_TABLES parameter
Lets you export the contents of a view as a table
New TRANSFORM options
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 176
New TRANSFORM options
TRANSFORM=DISABLE_ARCHIVE_LOGGING:Y
Will disable archive logging during import for tables and/or indexes
TRANSFORM=LOB_STORAGE:SECURE_FILE
TRANSFORM=STORAGE:N
TRANSFORM=TABLE_COMPRESSION:<compression_clause>
New LOGTIME=[ NONE | STATUS | LOGFILE | ALL ] option
Will write timestamps on status and/or logfile messages
Data Pump News in Oracle 12c
TRANSFORM option to enable Advanced/HCC Compression
Example:
TRANSFORM=TABLE_COMPRESSION:"compress for query high"
But: Granularity only on the entire import
Workarounds:
Precreate objects
Downside: Will slow down import!!!
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 177
Downside: Will slow down import!!!
or:
Precreate the tablespace with COMPRESS option
create tablespace ARCHIGH datafile 'archigh.ora' size 100G
default compress for archive high;
Then run Data Pump with
TRANSFORM=TABLE_COMPRESSION:N
This will drop all embedded compression attributes associated with the tables
Now tablespace compression option will be used for all newly created tables
Real World Checkpoint
The Customer:
Payback GmbH
Belongs to Loyalty Partner GmbH
which belongs to American Express
HQ in Munich, Germany
Develops and operates professional customer
loyalty programs based on customized IT
Customer
Project
Constraints
Preparation
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 178
loyalty programs based on customized IT
solutions
Provider for Payback, Europe's largest bonus
program
Upgrade
Success?
Remarks
Preparation
Real World Checkpoint
Project scope:
Migrate 7 TB and 1.5 TB from HP-UX to Exadata
V1
Cross platform, cross Endianness, cross version
Oracle 9.2.0.7 on HP-UX to Oracle 11.1.0.7 on
OEL
4 months planning and migration phase
Customer
Project
Constraints
Preparation
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 179
4 months planning and migration phase
August to November 2009
Proposed go-live date
15-NOV-2009
Upgrade
Success?
Remarks
Preparation
Real World Checkpoint
Constraints:
Move everything in less than 24 hrs
Network bottleneck
Customer installed InfiniBand hardware into source
system
= ~ 3GB/sec throughput!
Customer
Project
Constraints
Preparation
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 180
Upgrade
Success?
Remarks
Preparation
Real World Checkpoint
Setup:
Customer
Project
Constraints
Preparation
Restore
+
Upgrade
PROD
SWING
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 181
Upgrade
Success?
Remarks
Preparation
Upgrade
HP-UX PA-RISC
HP-UX PA-RISC
OEL 64bit
Prod Load
Real World Checkpoint
3x test migrations:
Customer
Project
Constraints
Preparation
PROD
Data Pump on
NETWORK_LINK
SWING
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 182
Upgrade
Success?
Remarks
Preparation
HP-UX PA-RISC
OEL 64bit
INSERT APPEND
on database links
for tables >100 GB
HP-UX PA-RISC
Prod Load
Real World Checkpoint
Parallel live loads:
Performance tests
Customer
Project
Constraints
Preparation
PROD
SWING
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 183
Upgrade
Success?
Remarks
Preparation
HP-UX PA-RISC
OEL 64bit
HP-UX PA-RISC
Redirect the production load by apps servers
Prod Load
Real World Checkpoint
Live upgrade/migration
Customer
Project
Constraints
Preparation
PROD
SWING
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 184
Upgrade
Success?
Remarks
Preparation
HP-UX PA-RISC
OEL 64bit
HP-UX PA-RISC
Prod Load
Real World Checkpoint
Live? And alive?
Yes! Go-live in early November 2009
Two weeks earlier than proposed
Total upgrade and migration time: ~20 hours
~ 8 hours: Restore and recovery
~ 1 hour: Database upgrade to Oracle 11.1.0.7
~10 hours: Data migration to Exadata V1
Customer
Project
Constraints
Preparation
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 185
~10 hours: Data migration to Exadata V1
~ 1 hour: Smoke testing and final verification
Dramatic performance improvements
Job runtimes decreased by 80%
User complaints about too fast performance really!!
Upgrade
Success?
Remarks
Preparation
Real World Checkpoint
Example: Job runtime from 30 hrs to < 2hrs
And not a single piece of SQL changed!!!
Customer
Project
Constraints
Preparation
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 186
Upgrade
Success?
Remarks
Preparation
Real World Checkpoint
Same customer again
Payback GmbH
Customer
Project
Constraints
Preparation
And the story continues
as Payback ordered a
new Exadata X2-2 in
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 187
Upgrade
Success?
Remarks
Preparation
new Exadata X2-2 in
May 2012
Real World Checkpoint
Project scope:
Migrate 14TB from Exadata V1 to Exadata X2-2
2 months planning and migration phase
June to July 2012
Proposed go-live date
22-JUL-2012
Customer
Project
Constraints
Preparation
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 188
MOS Note: 1055938.1
Migrating from HP Oracle Database Machine to
Sun Oracle Database Machine 11.2 using Data
Guard
Upgrade
Success?
Remarks
Preparation
Real World Checkpoint
New Constraints:
Database has grown from 7TB to 14TB
Move everything in less than 8 hrs
Network "bottleneck"
Customer installed extra IB cables to connect V1
and X2-2
Customer
Project
Constraints
Preparation
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 189
Upgrade
Success?
Remarks
Preparation
Real World Checkpoint
Restoring 14TB with RMAN
For STANDBY from ACTIVE DATABASE 64x parallel
Removed unused components from the database
Customer
Project
Constraints
Preparation
RMAN Restore
64
parallel channels
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 190
Upgrade
Success?
Remarks
Preparation
InfiniBand cabled
connection between
V1 and X2-2
Oracle
11.1.0.7
Oracle
11.1.0.7
Real World Checkpoint
Live migration
RMAN Restore and Recovery: <3 hours
64 parallel RMAN channels allocated: >4TB/hour
Customer
Project
Constraints
Preparation
RMAN Restore
64
parallel channels
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 191
Upgrade
Success?
Remarks
Preparation
InfiniBand cabled
connection between
V1 and X2-2
Oracle
11.1.0.7
Oracle
11.1.0.7
Real World Checkpoint
Subsequent database upgrade
Using the new PARALLEL UPGRADE
*
scripts
25% speedup for the Oracle Server upgrade
Total database upgrade time including recompilation
and time zone change: 20 mins
Customer
Project
Constraints
Preparation
catupgrd.sql
PARALLEL=8
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 192
Upgrade
Success?
Remarks
Preparation
PARALLEL=8
* The Parallel Upgrade Feature is only available for Oracle Database 11.2.0.3 upgrades
under supervision of Oracle's Upgrade Development Team for selected reference customers.
Oracle
11.1.0.7
Oracle
11.2.0.3
Real World Checkpoint
Live? And alive?
Yes! Go-live on 3-JUL-2012
Almost three weeks earlier than proposed
Total migration and upgrade time: ~4 hours
< 3 hours: Restore for Standby and recovery
< 20 mins: Database upgrade to Oracle 11.2.0.3
~ 40 mins: Extra tasks (crsctl etc.)
Customer
Project
Constraints
Preparation
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 193
~ 40 mins: Extra tasks (crsctl etc.)
Significant performance improvements
Job runtimes decreased again by 30-60%
The Database Team did a great job and went live
earlier again with half of the proposed downtime!!!
Upgrade
Success?
Remarks
Preparation
Real World Checkpoint
A few plans did change but we were
prepared
Had captured all plans from AWR into an SQL Tuning Set
Remedied failing plans with SQL Plan Management
Customer
Project
Constraints
Preparation
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 194
Upgrade
Success?
Remarks
Preparation
General Preparation Steps
Upgrade & Migration Cases
Fallback Strategies
Introduction & Overview
xTTS to Exadata xTTS to Exadata
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 195
Performance Management
Wrap Up
Fallback Strategies
New Features in Oracle 12c
Case 4: Cross Endianness Migration xTTS
Migration cross platform with Transportable Tablespaces
Example Facts & Description
1. Hardware migration to an Exadata Database Machine
2. Cross Endianness database migration from Oracle 10.2.0.4 to Oracle 11.2.0.3
3. Maximum tolerated downtime: 48 hours
4. Database size: 75TB
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 196
Oracle 10.2.0.4
IBM AIX
48 hrs
75TB
Oracle 11.2.0.3
OEL5.8 64bit
75TB
Case 4: Cross Endianness Migration xTTS
Migration cross platform with Transportable Tablespaces
Set all data
tablespaces
Read-Only
Export Meta
Information
Generate
Recreation
Scripts
Restore
and
Convert
Datafile
Backups
Precreate
Users in a
new
Database
Import Meta
Information
Plug in
Datafiles
Recreate
Source
Objects
with
Recreation
Scripts
Set all data
tablespaces
Read-Write
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 197
Oracle 10.2.0.4
IBM AIX
48 hrs
75TB
Oracle 11.2.0.3
OEL5.8 64bit
75TB
Concept Transportable Tablespaces
Plug all tablespaces into a new
database on target platform
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 198
Oracle 10.2.0.4
IBM AIX
75TB
Oracle 11.2.0.3
OEL5.8 64bit
75TB
Transportable Tablespaces
Simple Concept:
Create an "empty" database in the new environment
Plug in all data tablespaces from source to target database
Works cross-platform and cross-Endianness since Oracle
Database 10g
Performance Potential
"Possibly" very fast upgrade
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 199
"Possibly" very fast upgrade
Physical file copy can be much faster than exporting/importing
data
Complexity could be constraining
SYSTEM+SYSAUX tablespaces can't be transported
Additional steps necessary to move views, synonyms etc.
Concept Transportable Tablespaces
expdp "'"sys/sys as sysdba"'"
TRANSPORT_TABLESPACES=TS1,TS2
impdp impdp "'"sys/sys as "'"sys/sys as sysdba sysdba"'" "'"
TRANSPORT_DATAFILES= TRANSPORT_DATAFILES=
TTS feature available
since Oracle 8i
Cross platform support
since Oracle 10g
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 200
Oracle 10.2.0.4
IBM AIX
Oracle 11.2.0.3
OEL5.8 64bit
Self Contained?
Read Only
Read Write
Concept Transportable Tablespaces xTTS
LITTLE ENDIAN PLATFORMS
BIG ENDIAN PLATFORMS
Cross platform support
V$TRANSPORTABLE_PLATFORM
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 201
HP Open VMS
HP Tru64 UNIX
Linux IA (32-bit)
Linux IA (64-bit)
Linux 64-bit for AMD
Microsoft Windows IA (64-bit)
Microsoft Windows 64-bit for AMD
Microsoft Windows IA (32-bit)
Solaris Operating System (x86)
BIG ENDIAN PLATFORMS
Apple Mac OS
HP-UX (64-bit)
HP-UX IA (64-bit)
AIX-Based Systems (64-bit)
IBM zSeries Based Linux
IBM Power Based Linux
Solaris[tm] OE (32-bit)
Solaris[tm] OE (64-bit)
FILE
COPY
FILE
COPY
RMAN RMAN
CONVERT CONVERT
Concept Transportable Tablespaces xTTS
TTS cross platform
RMAN creates a file copy
Can be done on source or target system
Use the faster storage
Takes approximately the same amount of time as a backup
Multiple channels can be used
Example:
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 202
Example:
RMAN> CONVERT TABLESPACE users,example
TO PLATFORM 'Linux IA (32-bit)'
FORMAT='/tmp/transport_linux/%U';
Example Transportable Tablespaces
DESTINATION Database 11.2.0.3
Move meta information
(views, synonyms, trigger, roles etc)
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 203
SOURCE Database 10.2.0.4
DESTINATION Database 11.2.0.3
SYSTEM
SYSAUX
UNDO
TEMP
SYSTEM
SYSAUX
UNDO
TEMP
APP
HUGO
USERS
VIEWS VIEWS
CODE CODE
PRIVS PRIVS
APP
HUGO
VIEWS VIEWS
CODE CODE
PRIVS PRIVS
Possible options
Moving meta information - 3 possible options
The "brutal" approach
expdp/impdp CONTENT=METADATA_ONLY
The "smart" approach
Generate scripts
String concatenation with || ...
DBMS_METADATA
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 204
DBMS_METADATA
The "very smart" way
RMAN clone (DUPLICATE) with SKIP TABLESPACES option
But: Does not work for platform changes
In any case: Take extra care on sequence's start values!!
Transportable Tablespaces
TTS might not be a good solution if ...
Too many meta objects have to be rebuilt
Simple is better for fast TTS!!!
Too many objects in the tablespaces slow down the meta export
and import
Partitions and subpartitions
Avoid physical file copies when possible
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 205
Avoid physical file copies when possible
Use a physical standby as transport system
Reuse the existing files without moving them
Tablespaces can be mounted read-only from two databases
With read-write it will exist in the destination only
Time zone versions must be equal prior to transport
Otherwise Data Pump will block the meta import
Speed Up Transportable Tablespaces
Usually the biggest pain points with TTS
Downtime ranges from tablespace read-only on source to
tablespace read-write on destination
Duration to copy a very large amount of data
Duration to convert many tablespaces cross Endianness
New technique:
Avoid the copy & convert phase
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 206
Avoid the copy & convert phase
RMAN has learned to convert backups cross platform
Incremental backups will be used to bring source and
destination into close sync
Available since Oracle 11.2.0.3 for Exadata only
Available generally with Oracle 11.2.0.4 and Oracle 12c
See MOS Note:1389592.1 for a detailed description
New Turbo xTTS
Turbo xTTS Turbo xTTS Conventional xTTS Conventional xTTS
Tablespaces Tablespaces read read- -only only
Export meta Export meta i information nformation
Copy Copy datafiles datafiles
Generate scripts Generate scripts for non for non- -
segmented objects segmented objects
Copy Copy datafiles with RMAN datafiles with RMAN
Convert Convert datafiles datafiles
Create Create, copy, convert & apply , copy, convert & apply
incremental backups incremental backups
Tablespaces Tablespaces read read- -only only
Create Create, copy, convert & apply , copy, convert & apply
final final incremental backup incremental backup
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 207
Convert Convert datafiles datafiles
Import Meta Information Import Meta Information
Execute scripts for non Execute scripts for non- -
segmented objects segmented objects
Create user Create user
Tablespaces Tablespaces read read- -write write
Export meta Export meta i information nformation
Generate scripts for non Generate scripts for non- -
segmented objects segmented objects
Import Meta Information Import Meta Information
Execute scripts for non Execute scripts for non- -
segmented objects segmented objects
Create user Create user
Tablespaces Tablespaces read read- -write write
final final incremental backup incremental backup
Down Down
time time
Documentation and Information
Transportable Tablespaces Information
MOS Note:1166564.1 Master Note for Transportable Tablespaces
Common Questions and Issues
MOS Note:1454872.1 Transportable Tablespace Restrictions and
Limitations: Details, Reference, and Version Where Applicable
For TTS White Papers see the MAA webpage:
http://www.oracle.com/technetwork/database/features/availability/oracle-database-
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 208
http://www.oracle.com/technetwork/database/features/availability/oracle-database-
maa-best-practices-155386.html
Database Upgrades using TTS:
http://www.oracle.com/technetwork/database/features/availability/maa-wp-11g-
upgradetts-132620.pdf
Platform Migration using Transportable Database (RMAN):
http://www.oracle.com/technetwork/database/features/availability/maa-wp-10gr2-
platformmigrationtdb-131164.pdf
Customer example: Amadeus Customer Case
http://www.oracle.com/technetwork/database/features/availability/s281209
-amadeus-130978.pdf
Real World Checkpoint
The Customer:
One of the largest financial institutions in North
America
Businesses include consumer banking, credit
cards, asset management, business finance,
investment banking
Over $2 trillion in assets, more than $100 Billion in
Customer
Project
Constraints
Preparation
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 209
Over $2 trillion in assets, more than $100 Billion in
annual revenue
240,000 employees in 60 countries
Migration
Preparation
Remarks
Success?
Real World Checkpoint
Project scope: 70+ TB to migrate + upgrade
Customer
Project
Constraints
Preparation
Current
Configuration
New New Configuration
CPUs 16 single-core 4 x 8-core
Operating System
Endian
Big Little
File System Veritas CFS, SFRAC 4.1 Veritas CFS, SFRAC 5.1
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 210
Migration
Preparation
Disk Group 1 per DB 3-4 per DB
Database size 70+ TB 70+TB
Database Version Oracle 10.2.0.4 Oracle 11.2.0.2
Remarks
Success?
Real World Checkpoint
Constraints:
Endian conversion
Both OS- and Database-level endian conversions
needed
Data synchronization
Up to the minute before conversion
Conversion Window
Customer
Project
Constraints
Preparation
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 211
Conversion Window
Migration and smoke testing must be completed
within 48 hours
Size & Scale of data
70+ TB, millions of sub-partitions, extremely active
system
Migration
Preparation
Remarks
Success?
Real World Checkpoint
Explore Data Movement Options
Copying 70TB over the 10Gb network = ~20 hours
And it doesnt include DB cross-endian conversion!
Customer decision:
Use already licensed Veritas Portable Data Containers
Explore Database Conversion Options
Many options evaluated
Customer
Project
Constraints
Preparation
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 212
Many options evaluated
Customer decision:
Cross-Platform Transportable Tablespaces
Works cross-platform, cross-endian
Migration
Preparation
Remarks
Success?
Real World Checkpoint
Migration Weekend: Met plan almost exactly!
Customer
Project
Constraints
Preparation
Duration Action
3 hours Graceful application shutdown, backup
6 hours Instantiate and validate DB on swing server
6 hours Data Pump metadata export
1 hours OS-level endian conversion
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 213
Migration
Preparation
20 hours RMAN CONVERT processing
8 hours Data Pump metadata import
5 hours Post-migration tasks (TNSNAMES, re-create dblinks, etc.)
2 hours Post-migration validation & smoke testing
35 hours Migrate 70+ TB cross-endian!!!
51 hours Total time
Remarks
Success?
Real World Checkpoint
YES ...just a couple of post-upgrade tweaks:
Wrong job_queue_processes setting blocked
parallel recompilation
Remedy: Set it to a value greater than 0 starting in 11.2
High MUTEX contention after upgrade
Remedy: Apply newest PSU it had all the fixes!!!
Customer
Project
Constraints
Preparation
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 214
Migration
Remarks
Success?
Preparation
Real World Checkpoint
Expect the unexpected -- especially things
you dont control! In this case...
Windows security group decided to roll out new
security profiles on migration weekend
Upgrade weekend delayed by US debt ceiling
negotiations
what will happen during your big migration?
Customer
Project
Constraints
Preparation
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 215
what will happen during your big migration?
Does it really need to be said? Test!!!
Migration
Remarks
Success?
Preparation
General Preparation Steps
Upgrade & Migration Cases
Fallback Strategies
Introduction & Overview
Zero Downtime? Zero Downtime?
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 216
Performance Management
Wrap Up
Fallback Strategies
New Features in Oracle 12c
Case 5: Near-Zero Downtime
Platform migration with near-zero downtime
Example Facts & Description
1. Hardware migration to an Exadata Database Machine
2. Cross Endianness database migration from Oracle 10.2.0.3 to Oracle 11.2.0.3
3. Maximum tolerated downtime: 5 minutes
4. Database size: 10TB
5. High redo generation rate
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 217
5. High redo generation rate
Oracle 10.2.0.3
HP-UX Itanium
5 mins
10TB
Oracle 11.2.0.3
OEL5.8 64bit
10TB
Introduction
True ZERO Downtime is very hard to achieve
Only Oracle TimesTen In-Memory Database can do that
Replication technologies are easier to handle and setup
A limited downtime will occur to switch clients/application
Active/active scenarios are possible but will require extra work
Concept:
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 218
1. Start capturing changes on source
2. Create an upgraded copy on target
3. Start applying changes to target
4. Once in sync switch clients/application
Technologies:
Oracle Golden Gate
(NOTE: Oracle Streams was deprecated as of Oracle Database 12c)
Oracle Golden Gate
Paid option of the database
Migratable license for 1 year which includes Active Data Guard
Works with many Oracle database versions
Golden Gate 11.2 supports Oracle 10.2.0.4+, 11.1+, 11.2+
For earlier database versions (8i (DML only), 9i-11.1) use Golden Gate 10.4
Compared to Oracle Streams
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 219
Generally faster
Generally easier to setup and use
Fewer data type restrictions
Oracle GoldenGate Installation and Setup Guide
Also works with non-Oracle databases (DB2, Teradata )
GoldenGate OTN page:
http://www.oracle.com/technetwork/middleware/goldengate/overview/index.html
Difference Conventional vs GG Migration
Eliminate the "migration" downtime
Conventional Migration
Database Migration / Database Upgrade Tasks Database Migration / Database Upgrade Tasks
Downtime Downtime
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 220
Near-Zero Downtime Migration
Downtime Downtime
Synch Synch Synch Synch Database Migration / Database Upgrade Tasks Database Migration / Database Upgrade Tasks
Case 5: Near-Zero Downtime
Platform migration with near-zero downtime
Start Capture
Mechanism
Build Up Database Copy
with Data Pump or TTS
Start Apply
Mechanism
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 221
Oracle 10.2.0.3
HP-UX Itanium
5 mins
10TB
Oracle 11.2.0.3
OEL5.8 64bit
10TB
Start Capture Mechanism
Build Up Database Copy
with Data Pump or TTS
Start Apply Mechanism
Capture
Capture: committed transactions are captured (and can be
filtered) as they occur by reading the transaction logs
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 222
Oracle 10.2.0.3
HP-UX Itanium
10TB
Oracle 11.2.0.3
OEL5.8 64bit
10TB
Start Capture Mechanism
Build Up Database Copy
with Data Pump or TTS
Start Apply Mechanism
Capture
Trail: stages and queues data for routing
Trail
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 223
Oracle 10.2.0.3
HP-UX Itanium
10TB
Oracle 11.2.0.3
OEL5.8 64bit
10TB
Start Capture Mechanism
Build Up Database Copy
with Data Pump or TTS
Start Apply Mechanism
Capture Trail
Build up the target database using:
- Transportable Tablespaces x-Platform
- Export/Import with Data Pump
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 224
Oracle 10.2.0.3
HP-UX Itanium
10TB
Oracle 11.2.0.3
OEL5.8 64bit
10TB
Start Capture Mechanism
Build Up Database Copy
with Data Pump or TTS
Start Apply Mechanism
Capture Trail
Pump: distributes data for routing to target(s)
Pump
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 225
Oracle 10.2.0.3
HP-UX Itanium
10TB
Oracle 11.2.0.3
OEL5.8 64bit
10TB
Start Capture Mechanism
Build Up Database Copy
with Data Pump or TTS
Start Apply Mechanism
Route: data is compressed, encrypted for routing to target(s)
Capture Trail Pump Trail
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 226
Oracle 10.2.0.3
HP-UX Itanium
10TB
Oracle 11.2.0.3
OEL5.8 64bit
10TB
Start Capture Mechanism
Build Up Database Copy
with Data Pump or TTS
Start Apply Mechanism
Delivery: applies data with transaction
integrity, transforming the data as required
Capture Trail Pump Trail Delivery
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 227
Oracle 10.2.0.3
HP-UX Itanium
10TB
Oracle 11.2.0.3
OEL5.8 64bit
10TB
Start Capture Mechanism
Build Up Database Copy
with Data Pump or TTS
Start Apply Mechanism
Golden Gate works bidirectionally -
from higher to lower release as well!
Capture Trail Pump Trail Delivery
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 228
Oracle 10.2.0.3
HP-UX Itanium
10TB
Oracle 11.2.0.3
OEL5.8 64bit
10TB
Bi-directional
Minimal Downtime
Migration with
Oracle Golden Gate
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 229
Amadeus is a leading transaction processor
for the global travel and tourism industry
Customer
Project
Constraints
DISTRIBUTION
BUSINESS
IT SOLUTIONS
Real World Checkpoint
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 230
Migration
Success?
Remarks
Preparation
711 airlines
110,000+ hotel properties
30 car rental companies
50+ cruise and ferry lines
207 tour operators
24 insurance companies
95 railways
Inventory
Departure Control
e-Commerce
Airlines
Airports
Hotels
Rail
20,000+ tx/sec (peak)
< 0.3 sec response time
10 Petabytes of storage
3+ million net bookings/day
> 1 billion tx/day
Real World Checkpoint
Migrate Oracle 10g production databases to
Oracle 11g on new HW and/or OS platform.
Customer
Project
Constraints
Source Target
Oracle 10.2.0.3
Oracle 11.2.0.2/3
RAC
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 231
Migration
Success?
Remarks
Preparation
RAC
HP-UX v2
HPUX v3
Oracle 11.2.0.2/3
RAC
RHE Linux
Oracle 10.2.0.3
Single Instance
HP-UX v2
Oracle 11.2.0.2/3
RAC One
RHE Linux
Real World Checkpoint
Fixed quarterly outage windows
Maximum of 5 minutes database downtime
No service impact outside the outage window
Endian change: HP-UX = Linux (big=little endian)
Possibility of fallback during and after the outage
Customer
Project
Constraints
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 232
Possibility of fallback during and after the outage
High volume of DB changes
Redo of up to 20MB/sec
Large database sizes (up to 14TB)
Possibility for physical re-organization
- Fresh data dictionary
- Tablespace and partitioning redesign
Migration
Success?
Remarks
Preparation
Real World Checkpoint
Customer
Project
Constraints
In-depth proof of concept (supported by Oracle)
Focusing on functional aspects
Focusing on data volume
Standardized migration process model with
timeline
Home-made scripts and procedures to support
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 233
Migration
Success?
Remarks
Preparation
Home-made scripts and procedures to support
setup, monitoring, tuning and switch over
Training of in-house specialist supporting the
DBAs
Real World Checkpoint
Customer
Project
Constraints
Instantiation of new 11g database
Physical Standby and Data Pump
Installation, configuration, tuning of GG replication
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 234
Migration
Success?
Remarks
Preparation
Comparison of source/target DB content (Veridata)
Rehearsals of switch over and fallback
Switch over: Stop replication / Start reverse-replication
Real World Checkpoint
Databases successfully migrated
Switchover duration: 2 - 6 minutes
No fallback performed
Customer
Project
Constraints
Source Target Migrated
Oracle 10.2.0.3
Oracle 11.2.0.2/3
RAC
6
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 235
Migration
Success?
Remarks
Preparation
Oracle 10.2.0.3
RAC
HP-UX v2
RAC
HPUX v3
Oracle 11.2.0.2/3
RAC
RHE Linux
3
Oracle 10.2.0.3
Single Instance
HP-UX v2
Oracle 11.2.0.2/3
RAC One
RHE Linux
6
The concept proved to handle a smooth
and secure migration across different
DB versions and HW/OS platforms.
Customer
Project
Constraints
To be considered
Real World Checkpoint
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 236
Migration
Success?
Remarks
Preparation
To be considered
Instantiation of target database (incl. Plan Stability)
Customized GG setup per database
Handling of unsupported data types (e.g. ANYDATA)
Impact of supplemental logging on source DB
Effort of tuning GG for DBs with high DML rate
(e.g. parallel replicate processes)
General Preparation Steps
Upgrade & Migration Cases
Fallback Strategies
Introduction & Overview
Real Rolling Upgrade
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 237
Performance Management
Wrap Up
Fallback Strategies
New Features in Oracle 12c
Case 7: Real Rolling Upgrade
Rolling database upgrade with less than 5 min downtime
Example Facts & Description
1. Neither HW nor OS migration involved
2. Database rolling upgrade from Oracle 11.1.0.7 to Oracle 11.2.0.3
3. Maximum tolerated downtime: 5 minutes
4. Database size: 5TB
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 238
Oracle 11.1.0.7
OEL4 64bit
5 mins
5TB
Oracle 11.2.0.3
OEL5.8 64bit
5TB
Case 7: Real Rolling Upgrade
Rolling database upgrade with less than 5 min downtime
Create a
Physical
Standby
Convert =
Logical
Standby
Upgrade
Logical
Standby
Switchover
PROD=
Logical
Flashback
Logical
Convert =
Physical
Upgrade
via Redo
Apply
Switchover
PROD =
Physical
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 239
Oracle 11.1.0.7
OEL4 64bit
Oracle 11.2.0.3
OEL5.8 64bit
Oracle 11.1.0.7
PHYSICAL STANDBY PHYSICAL STANDBY
5 mins
5TB
5TB
Basic Facts and Information
Physical standby database (redo apply):
Block identical copy of the production database
Build up with RMAN
Since Oracle 11.1 semi-automatic via network
Switchover in less than 1 minute
Logical standby database (sql apply):
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 240
Logical copy of the production database
Build up via CONVERT from a physical standby
Switchover in seconds possible
Transient Logical Standby:
Convert a physical into a logical standby
Rolling upgrade
Convert back into a physical standby
Transient Logical Standby
Concept:
Build up a Physical Standby database
Convert the Physical Standby into a Logical Standby
Upgrade the Logical Standby database
Switchover Standby will be production system now
Then: Flashback the former production database
Convert it into a Physical Standby
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 241
Convert it into a Physical Standby
Upgrade just by log apply
Eventually: Switchover to the original setup
Works pretty straight forward with Oracle Database 11g
Will work with Oracle Database 10g as well but requires
more steps
PROD PSTBY
1
Transient Logical Standby - Workflow
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 242
t t
PSTBY
Guaranteed
Restore Point
OO
2
PROD
Transient Logical Standby - Workflow
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 243
t t
PSTBY
Guaranteed
Restore Point
Logminer
Build LSTBY
KEEP IDENTITY
synchronize
OO
OO
3
PROD
Transient Logical Standby - Workflow
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 244
t t
PROD
PSTBY
Guaranteed
Restore Point
Logminer
Build LSTBY
Upgrade
KEEP IDENTITY
synchronize
New $OracleHome
OO
4
PROD
Transient Logical Standby - Workflow
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 245
t t
PSTBY
Guaranteed
Restore Point
Logminer
Build LSTBY
Upgrade
KEEP IDENTITY
SWITCHOVER
LSTBY
synchronize
synchronize
New $OracleHome
OO
OO
5
PROD
PROD
Transient Logical Standby - Workflow
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 246
t t
PSTBY
Guaranteed
Restore Point
Logminer
Build LSTBY
Upgrade
KEEP IDENTITY
SWITCHOVER
Guaranteed
FLASHBACK
DATABASE TO:
LSTBY
synchronize
synchronize
New $OracleHome
OO
6
PROD
PROD
Transient Logical Standby - Workflow
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 247
t t
Guaranteed
Restore Point
PSTBY
Guaranteed
Restore Point
Logminer
Build LSTBY
Upgrade
KEEP IDENTITY
SWITCHOVER
Guaranteed
FLASHBACK
DATABASE TO:
LSTBY
synchronize
synchronize
New $OracleHome
7
PROD
PROD
Transient Logical Standby - Workflow
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 248
t t
Guaranteed
Restore Point
Switch to new $OracleHome
PSTBY CONVERT TO
PHYSICAL
OO
PSTBY
Guaranteed
Restore Point
Logminer
Build LSTBY
Upgrade
KEEP IDENTITY
SWITCHOVER
Guaranteed
FLASHBACK
DATABASE TO:
LSTBY
synchronize
synchronize
New $OracleHome
8
PROD
PROD
Transient Logical Standby - Workflow
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 249
t t
Guaranteed
Restore Point
Switch to new $OracleHome
PSTBY CONVERT TO
PHYSICAL
synchronize
Automatic Upgrade
during redo apply
OO
PSTBY
Guaranteed
Restore Point
Logminer
Build LSTBY
Upgrade
KEEP IDENTITY
SWITCHOVER
Guaranteed
FLASHBACK
DATABASE TO:
LSTBY
synchronize
synchronize
New $OracleHome
9
PROD
PROD
Transient Logical Standby - Workflow
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 250
t t
Guaranteed
Restore Point
Switch to new $OracleHome
PSTBY
PSTBY
CONVERT TO
PHYSICAL
SWITCHOVER
synchronize
Automatic Upgrade
during redo apply
OO OO
PROD
Transient Logical Standby White Paper
Transient Upgrade Concept:
http://www.oracle.com/technetwork/database/features/availability/
maa-wp-11g-transientlogicalrollingu-1-131927.pdf
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 251
Shell scripts in Note:949322.1 for automation:
http://www.oracle.com/technetwork/database/features/availability/
maa-wp-11g-upgrades-made-easy-131972.pdf
DBMS_ROLLING
Data Guard Simple Rolling Upgrade
Semi-automation of Transient Logical Standby Rolling Upgrade
Works with Data Guard Broker
Procedure DBMS_ROLLING
INIT_PLAN
DESTROY_PLAN
BUILD_PLAN
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 252
BUILD_PLAN
SET_PARAMETER
START_PLAN
SWITCHOVER
FINISH_PLAN
ROLLBACK_PLAN
Usable for maintenance tasks beginning with Oracle 12.1.0.1
Usable for upgrades beginning with the first patch set of Oracle 12c
DBMS_ROLLING usage will require a license for Active Data Guard
DBMS_ROLLING - Planning & Setup Phase
Generate an upgrade plan
Call DBMS_ROLLING.INIT_PLAN
Generates an upgrade plan with a configuration specific set of
instructions to guide the administrator through the upgrade process
Call DBMS_ROLLING.SET_PARAMETER
Modify parameters of the rolling upgrade
Prepare your changes to the database
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 253
Prepare your changes to the database
DBMS_ROLLING Execution Phase
Start the Execution Phase
Call DBMS_ROLLING.START_PLAN
Configures primary and standby databases participating in the upgrade
Make changes to the standby database
Upgrade time
Role exchange
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 254
Call DBMS_ROLLING.SWITCHOVER
Swaps roles between current primary and new primary with the
changes, switchover is only downtime required
Finish the Rolling Upgrade
Call DBMS_ROLLING.FINISH_PLAN
Completes upgrade of the old primary and bystanders and resynchronizes with
the new primary
Real World Checkpoint
Bielefeld University, Germany
Mid size university in Germany (founded 1969)
18,000 students
1,600 employees
Interdisciplinary
Initiative of Excellence
Customer
Project
Constraints
Preparation
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 255
Lead university for 33 German universities
Upgrade
Success?
Remarks
Preparation
Real World Checkpoint
Project scope:
Upgrade or migrate 10 key systems from Oracle
9.2 to Oracle 11g
Move from Single Instance to:
Oracle Real Application Clusters
Oracle ASM
Oracle Data Guard
Customer
Project
Constraints
Preparation
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 256
Oracle Data Guard
Use Transient Logical Standby for patch upgrades
to decrease downtime from 60 minutes to less than
5 minutes
Upgrade
Success?
Remarks
Preparation
Real World Checkpoint
Constraints:
Character set conversions
Outdated 3
rd
party software
Customer
Project
Constraints
Preparation
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 257
Upgrade
Success?
Remarks
Preparation
Real World Checkpoint
Test migrations and upgrades
Setup Oracle Grid Control
Performance monitoring and tuning with SQL
Tuning/Access Advisor and SQL Performance
Analyzer (SPA)
Customer
Project
Constraints
Preparation
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 258
Upgrade
Success?
Remarks
Preparation
Real World Checkpoint
Upgrade and migrations:
Completed in Sept/Oct 2008
Transient Standby Rolling Upgrade:
Oracle. 11.1.0.6 to Oracle 11.1.0.7
Friday February 13
th
, 2009
Customer
Project
Constraints
Preparation
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 259
Upgrade
Success?
Remarks
Preparation
Real World Checkpoint
YES!!!
OOW 2009 presentation
Customer
Project
Constraints
Preparation
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 260
Upgrade
Success?
Remarks
Preparation
Real World Checkpoint
During upgrade/migration:
One issue found with "Exceeding column
length" conversion
Solution: Convert to CLOB and change app
Transient Standby upgrade had some issues
due to INVALID components in
DBA_REGISTRY
Customer
Project
Constraints
Preparation
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 261
DBA_REGISTRY
Solution: Fix the component status
Lessons learned:
Never go onsite again on a Friday 13
th
!!!
Upgrade
Success?
Remarks
Preparation
General Preparation Steps
Upgrade & Migration Cases
Fallback Strategies
Introduction & Overview
Plug in a database
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 262
Performance Management
Wrap Up
Fallback Strategies
New Features in Oracle 12c
Case 8: Upgrade and Plug into a CDB
Consolidate an upgraded 12c database into a CDB
Example Facts & Description
1. Source database must already be upgraded to Oracle Database 12c
2. Plug in the source database as new PDB into an existing CDB
3. Maximum tolerated downtime: 15 minutes
4. Database size: 1TB
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 263
Oracle 12.1.0.1
Non-CDB
15 mins
1TB
Oracle 12.1.0.1
PDB in a CDB
1TB
Overview of Multitenant Environments
Introduction to Multitenant Environments
Roads to Pluggable Databases
Working with Pluggable Databases
Wrap Up
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 264
Wrap Up
Multitenant Environment The Concept!
Consolidation
Reduced maintenance load
Simplified and fast provisioning, cloning and migration
Option is called Oracle Multitenant
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 265
Some well-known concepts will change
Around 150 pages new documentation in the Administrators
Guide
Look Before You Leap!
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 266
You don't have to use pluggable databases ... yet
Oracle Database 12c non-CDB works as expected
But you can also use the new features and this will require
changing old habits
The earth is still a sphere
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 267
Multitenant container database => CDB
DBA administers on the CDB level
A CDB can contain zero, one, or many pluggable
databases (PDBs)
Applications will connect to the PDBs
Up to 253 PDBs in one CDB
Implementation
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 268
CDB CDB
PDB PDB PDB PDB PDB PDB PDB PDB
PDB$S
EED
PDB$S
EED
What's in a CDB?
PDBs
Pluggable databases
Contain data and code
CDB$ROOT
Schemas, objects etc. available to all PDBs
Components
CDB$ROOT CDB$ROOT
PDB$SEED PDB$SEED PDB PDB PDB PDB PDB PDB PDB PDB
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 269
Information about all PDBs in the CDB's data dictionary
There can be only ONE
PDB$SEED
Template from which to create PDBs
PDB, CDB$ROOT and PDB$SEED all are called containers
One SGA, one set of background processes, and one spfile
Benefit due to resource sharing
Applications connect to a PDB
Behind the scenes
Redo Control Flashback
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 270
CDB$ROOT CDB$ROOT
PDB$SEED PDB$SEED PDB PDB PDB PDB PDB PDB PDB PDB
spfile
COMPATIBLE 12.0.0
Note: There's no difference between 12.0.0 and 12.1.0
ENABLE_PLUGGABLE_DATABASE=TRUE
Default: FALSE
It can only be set during creation of a container database
setting it afterwards inside an Oracle 12c database won't work
During creation with DBCA it will be set TRUE once the option
Prerequisites to work with CDBs/PDBs
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 271
During creation with DBCA it will be set TRUE once the option
CREATE CONTAINER DATABASE is chosen
Two options:
DBCA
Highly recommended
Creation of a CDB
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 272
Command line CREATE DATABASE
Not recommend as all options will have to be created
CREATE DATABASE cdb12
[...]
ENABLE PLUGGABLE DATABASE
SEED FILE_NAME_CONVERT=('/oradata/cdb12/','/oradata/pdbseed/')
SYSTEM DATAFILES SIZE 125M AUTOEXTEND ON NEXT 10M MAXSIZE []
Scripts have to be started via catcon.pl:
catdb.sql will run all scripts for all options
Most useful catcon.pl options:
-u Username and optionally password
Command Line Creation of a CDB
$> perl catcon.pl -u SYS -d $ORACLE_HOME/rdbms/admin -e
-s -b catalog catdb.sql
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 273
-d Directory containing the script to execute (default: current directory)
-e Echo on
-s Spools the output of every script
-l Directory to write logfiles into (default: current directory)
-b Base name for logfiles (mandatory option)
Parameters of catcon.pl
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 274
Things to know when using catcon.pl
catcon.pl doesn't open MOUNTed PDBs
Recommendation:
Open all PDBs before executing scripts with catcon.pl
ALTER PLUGGABLE DATABASE ALL OPEN;
When PERL is not in your PATH then execute:
$> $ORACLE_HOME/perl/bin/perl catcon.pl ...
catcon.pl
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 275
$> $ORACLE_HOME/perl/bin/perl catcon.pl ...
Creation of a CDB with DBCA (recommended)
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 276
Creation of a CDB with DBCA (recommended)
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 277
Characterset of the CDB is mandatory for all PDBs
Up to 252 PDBs plus PDB$SEED can exist in a CDB:
CDB-PDB Limitations
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 278
After CDB creation:
Data dictionary
Common user
By default there's no user data in the root
CDB-PDB: Who's who?
PDB$SEED PDB$SEED
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 279
CDB$ROOT CDB$ROOT
PDB$SEED PDB$SEED
OBJ$ OBJ$ TAB$ TAB$ SOURCE$ SOURCE$
After plugging a PDB into a CDB:
Data resides in the PDB
References will get created in the CDB
In exchange access to dictionary objects from within the PDB
CDB-PDB: Who's who?
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 280
CDB$ROOT CDB$ROOT
PDB$SEED PDB$SEED
OBJ$ OBJ$ TAB$ TAB$ SOURCE$ SOURCE$
PDB PDB
EMP EMP DEPT
OBJ$ OBJ$ TAB$ TAB$ SOURCE$ SOURCE$
Common user
Exists in the CDB and every current and future PDBs
All Oracle supplied users are common users
User to plug/unplug/clone
CDB1> create user c##adm1 identified by a1;
CDB1> create user c##adm2 identified by a2 container=all;
Local user
CDB-PDB: Who's who?
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 281
Local user
Exists in one PDB only
CDB$ROOT CDB$ROOT
PDB$SEED PDB$SEED
PDB PDB
APP
HUGO
SYS
SYS
C##ADM
C##BOSS
C##ADM
C##BOSS
Switch to a PDB
SQL> ALTER SESSION SET CONTAINER=PDB1;
Switch to the CDB
SQL> ALTER SESSION SET CONTAINER=CDB$ROOT;
Where am I?
Switching between CDB and PDBs
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 282
Where am I?
SQL> SHOW CON_ID
SQL> SHOW CON_NAME
SQL> SHOW PDBS
This will tell you either to which PDB you are connected or list
all PDBs including the PDB$SEED if your are connected to the
CDB$ROOT
Example Create a user inside a PDB:
Example Create a new Common User in a CDB:
CDB/PDB User Creation: Details
PDB1> create user T1 identified by T1;
PDB1> create user U2 identified by U2 container=current;
PDB1> create user V3 identified by V3 container=all;
ORA-65096: invalid common user name or role
CDB1> create user T1 identified by T1;
Local
User
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 283
CDB1> create user T1 identified by T1;
ORA-65096: invalid common user name or role
CDB1> create user T1 identified by T1 container=all;
ORA-65096: invalid common user name or role
CDB1> create user T1 identified by T1 container=current;
ORA-65049: creation of local user or role is not allowed in CDB$ROOT
CDB1> create user c##T1 identified by T1 container=all;
CDB1> create user c##U2 identified by U2;
Common
User
Tablespaces
Global UNDO and TEMP in CDB$ROOT
PDBs can have their own TEMP
All PDBs will share CDB's UNDO
CDB-PDB: Who's who?
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 284
CDB$ROOT CDB$ROOT
PDB$SEED PDB$SEED
PDB PDB
SYSTEM
SYSAUX
SYSTEM
SYSAUX
SYSTEM
SYSAUX
DATA1
DATA2
TEMP_PDB
TEMP
UNDO
Overview of Multitenant Environments
Introduction to Multitenant Environments
Roads to Pluggable Databases
Creation of a new PDB
Cloning a PDB
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 285
Cloning a PDB
Upgrade and plugin as PDB
Full transportable export/import
Working with Pluggable Databases
Wrap Up
Fast provisioning with the seed:
Login to the CDB
Provisioning with the seed
Creation of a PDB
create pluggable database PDB128
admin user PDB128adm identified by mypasswd
roles = (DBA)
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 286
Parameter PDB_FILE_NAME_CONVERT is used to create the files in
the new location: PDB_FILE_NAME_CONVERT='strg1','strg2'
Import data from the source database if desired
Data Pump import for 10g and later releases (dumpfile or over
a NETWORK_LINK)
Original import for 9i and earlier releases
Transportable Tablespaces
Overview of Multitenant Environments
Introduction to Multitenant Environments
Roads to Pluggable Databases
Creation of a new PDB
Cloning a PDB
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 287
Cloning a PDB
Upgrade and plugin as PDB
Full transportable export/import
Working with Pluggable Databases
Wrap Up
Fast cloning within a CDB or remote cloning
Source PDB can remain online in READ ONLY mode
Locally:
Parameter PDB_FILE_NAME_CONVERT is used to create the files in the
new location
Cloning of a PDB
create pluggable database PDB7 from PDB4;
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 288
Can be set in the spfile (alter system) or in a session (alter
session)
Remote:
create pluggable database PDB8 from
PDB3@de.acme.cdb1;
Overview of Multitenant Environments
Introduction to Multitenant Environments
Roads to Pluggable Databases
Creation of a new PDB
Cloning a PDB
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 289
Cloning a PDB
Upgrade and plugin as PDB
Full transportable export/import
Working with Pluggable Databases
Wrap Up
Upgrade first, then plug in
To plug in a database into a multitenant environment it has
to be upgraded to Oracle Database 12c first
The upgrade steps are independent from the multitenant concept
Once upgraded:
1. Open the database
read-only
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 290
read-only
2. Generate an XML
description file
3. Plug the database into
the destination CDB
Step1:
Database Upgrade to Oracle 12c
Upgrade and Plugin into a CDB
Oracle 12.1.0.1
V102
Oracle 12.1.0.1
V102
Oracle 10.2.0.5
V102
Oracle 10.2.0.5
V102
Database
Upgrade
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 291
CDB$ROOT CDB$ROOT
PDB$SEED PDB$SEED
V102 V102
Step 2:
Database in read-only mode
Create XML file
Upgrade and Plugin into a CDB
Oracle 12.1.0.1
V102
Oracle 12.1.0.1
V102
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 292
CDB$ROOT CDB$ROOT
PDB$SEED PDB$SEED
V102 V102
XML
Step 3:
Stop database and plug it into the CDB
Upgrade and Plugin into a CDB
Oracle 12.1.0.1
V102
Oracle 12.1.0.1
V102
TEMPFILE REUSE;
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 293
CDB$ROOT CDB$ROOT
PDB$SEED PDB$SEED
V102 V102
XML
Oracle 12.1.0.1
PDB1
Oracle 12.1.0.1
PDB1
Step 4:
Define TNS alias and connect to the PDB via TNS:
sqlplus "sys/oracle@PDB1 as sysdba"
Start PDB:

Sanity with ?/rdbms/admin/noncdb_to_pdb.sql


Upgrade and Plugin into a CDB
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 294
Sanity with ?/rdbms/admin/noncdb_to_pdb.sql
CDB$ROOT CDB$ROOT
PDB$SEED PDB$SEED
Oracle 12.1.0.1
PDB1
Oracle 12.1.0.1
PDB1
Summary:
1. Database upgrade to Oracle 12c
2. Set database read-only
3. Generate XML description file
SQL> exec DBMS_PDB.DESCRIBE('/tmp/pdb1.xml');
4. Stop database
5. Plugin database as a new PDB into the CDB according to the
Upgrade and Plugin into a CDB
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 295
5. Plugin database as a new PDB into the CDB according to the
information in the XML description file
SQL> create pluggable database PDB1 using
'/tmp/pdb1.xml' nocopy tempfile reuse;
6. Connect to and start the new PDB
sqlplus "sys/oracle@PDB12 as sysdba"
SQL> startup
7. Sanity operations
SQL> @?/rdbms/admin/noncdb_to_pdb.sql
Overview of Multitenant Environments
Introduction to Multitenant Environments
Roads to Pluggable Databases
Creation of a new PDB
Cloning a PDB
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 296
Cloning a PDB
Upgrade and plugin as PDB
Full Transportable Export/Import
Working with Pluggable Databases
Wrap Up
Transport of an entire database cross version and cross
platform
Export since Oracle 11.2.0.3, import since Oracle 12c
3 phases:
Datafile migration with RMAN incremental backups online!
Transport via network import downtime!
Full Transportable
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 297
Transport via network import downtime!
Sanity work online!
Phase 1: Prep work
Example: 11.2.0.3 = == =12c PDB
Oracle 11.2.0.3
V112
Oracle 11.2.0.3
V112
RMAN
Level 0
RMAN
Level 0
RMAN
Level 1
RMAN
Level 1
RMAN
Level 1
RMAN
Level 1
DB Link DB Link
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 298
CDB$ROOT CDB$ROOT
PDB$SEED PDB$SEED
Oracle 12.1.0.1
PDB - Clone
Oracle 12.1.0.1
PDB - Clone
Phase 2: Transport Downtime!
Example: 11.2.0.3 = == =12c PDB
Oracle 11.2.0.3
V112
Oracle 11.2.0.3
V112
RMAN
Level 0
RMAN
Level 0
RMAN
Level 1
RMAN
Level 1
RMAN
Level 1
RMAN
Level 1
RMAN
Level 1
RMAN
Level 1
DB Link DB Link
Tablespaes Tablespaes
Read Read- -Only Only
Tablespaes Tablespaes
Read Read- -Only Only
impdp oow/passwd@PDB12
NETWORK_LINK=db11 VERSION=12 FULL=Y
TRANSPORTABLE=ALWAYS METRICS=Y
LOGFILE=oow_dir:src112fullimp.log
TRANSPORT_DATAFILE='/fra/d/ts1.dbf'
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 299
CDB$ROOT CDB$ROOT
PDB$SEED PDB$SEED
Oracle 12.1.0.1
PDB12
Oracle 12.1.0.1
PDB12
Backup Backup
must be must be
accessible accessible
Phase 3: Clean up
Example: 11.2.0.3 = == =12c PDB
Oracle 11.2.0.3
V112
Oracle 11.2.0.3
V112
DB Link DB Link
Tablespaes Tablespaes
Read Read- -Write Write
Tablespaes Tablespaes
Read Read- -Write Write
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 300
CDB$ROOT CDB$ROOT
PDB$SEED PDB$SEED
Oracle 12.1.0.1
PDB12
Oracle 12.1.0.1
PDB12
Overview of Multitenant Environments
Introduction to Multitenant Environments
Roads to Pluggable Databases
Working with Pluggable Databases
Wrap Up
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 301
Wrap Up
PDB Management with DBCA
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 302
PDB Management with DBCA
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 303
Common User can access information from the CDB and
all PDBs
Dependency shown via column CON_ID in DBA_ views:
Hirarchies
CDB$ROOT CDB$ROOT
PDB$SEED PDB$SEED
OBJ$ OBJ$ TAB$ TAB$ SOURCE$ SOURCE$
PDB PDB
EMP EMP DEPT
OBJ$ OBJ$ TAB$ TAB$ SOURCE$ SOURCE$
CON_ID:
Object belongs to:
0 Entire CDB
1 Root
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 304
In a non-CDB CON_ID is always 0
2 Seed
3 - 254 PDB 1 - 252
List init parameters which can be changed on PDB level:
select NAME from V$PARAMETER
where ISPDB_MODIFIABLE = 'TRUE' order by NAME;
List parameters set in a particular PDB:
select NAME from V$SYSTEM_PARAMETER
CON_ID
Change init Parameters
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 305
where CON_ID = 3 order by NAME;
New dictionary view family: {USER|ALL|DBA|CDB}_VIEWS
The most important changes in an overview:
Dictionary Views
View
Meaning
{CDB|DBA}_PDBS
Information and status of PDBs being plugged into the current CDB
CDB_PROPERTIES
Permamnent properties of containers in a CDB
{CDB|DBA}_PDP_HISTORY
"History" of a PDB OPERATION column is important
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 306
{CDB|DBA}_OBJECTS
New SHARING columns displays if objects are linked
{CDB|DBA}_TABLES
New CONTAINER_DATA columns shows if it is a container object
{CDB|DBA}_USERS
New COMMON columns shows if a user is COMMON or LOCAL
V$CONTAINERS
Infos about containers associated with this CDB
V$PDBS
Information about all associated PDBs incl. Open Status
V$DATABASE
New column CDB either YES or NO
PDB_PLUG_IN_VIOLATIONS
Shows the plugin violations during plugin as PDB into a CDB
PDBs in my CDB?
show pdbs
CON_ID CON_NAME OPEN MODE RESTRICTED
------ -------------------------- ---------- ---------
2 PDB$SEED READ ONLY NO
3 PDB1 READ WRITE NO
Open Mode of the PDBs?
Important Queries
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 307
Open Mode of the PDBs?
select NAME, OPEN_MODE, RESTRICTED, OPEN_TIME from V$PDBS;
NAME OPEN_MODE RESTRICTED OPEN_TIME
--------------- ---------- ---------- ------------------------------
PDB$SEED READ ONLY NO 21-MAY-12 12.19.54.465 PM
HRPDB READ WRITE NO 21-MAY-12 12.34.05.078 PM
SALESPDB MOUNTED NO 22-MAY-12 10.37.20.534 AM
Backup and Recovery
Recovery of a single PDB?
Yes, possible without affecting the other PDBs and the CDB
Commands:
ALTER PLUGGABLE DATABASE ... CLOSE IMMEDIATE;
RESTORE PLUGGABLE DATABASE;
Done in RMAN connected as common user to the CDB
RECOVER PLUGGABLE DATABASE;
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 308
RECOVER PLUGGABLE DATABASE;
Done in RMAN connected as common user to the CDB
Annotation: Each PDB has its own datafiles!
ALTER PLUGGABLE DATABASE ... OPEN;
Set resource consumption for:
CPU
Session
Parallel servers
Policy definition for shares and limits
Example:
Resource Manager and CDBs/PDBs
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 309
PDB Shares Guaranteed CPU Limit Maximum CPU
A 2 2/4 = 50% 100%
B 1 1/4 = 25% 50% 50%
C 1 1/4 = 25% 100%
Overview of Multitenant Environments
Introduction to Pluggable Database
Roads to Pluggable Database
Working with Pluggable Database
Wrap Up
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 310
Wrap Up
Can I move from a 12c PDB back to a non-CDB?
Data Pump export/import, transportable tablespaces, or full
transportable export/import will work from a PDB
Original Export (exp) will not work!
How will upgrade work for PDBs and CDB?
Upgrade a CDB and all its PDBs in one operation
Plug a version n PDB into a version n+1 CDB and upgrade
Possible Questions ...
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 311
Plug a version n PDB into a version n+1 CDB and upgrade
Unplug and plugin with different patches installed?
Anything not yet supported? Check the README!
Continuous Query Notification (CQN)
Client Side Cache
Flashback Data Archive (FDA)
Flashback Transaction Query
Flashback Transaction Backout
Heat map
Automatic Data Optimization
CDB References
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 312
Automatic Data Optimization
Oracle Streams
Database Migration Assistant for Unicode (DMU)
White paper:
http://www.oracle.com/technetwork/database/multitenant-wp-12c-1949736.pdf
General Preparation Steps
Upgrade & Migration Cases
Fallback Strategies
Introduction & Overview
Full Transportable
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 313
Performance Management
Wrap Up
Fallback Strategies
New Features in Oracle 12c
Full Transportable Export/Import
Transport an entire database in a single operation
Cross version and cross platform
Can include the database upgrade
Combination of TTS for data tablespaces and Data Pump for
administrative tablespaces (SYSTEM, SYSAUX ...)
Supports information from database components such as Spatial,
Text, Multimedia, OLAP, etc.
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 314
Text, Multimedia, OLAP, etc.
Full transportable export supported since Oracle 11.2.0.3
Full transportable import supported since Oracle 12.1.0.1
Full Transportable Export/Import
Parameters:
FULL=Y and TRANSPORTABLE=ALWAYS
VERSION=12 for full transportable export in Oracle 11.2.0.3/4
Restrictions:
Target character set must be same as, or binary super-set of
source character set (eg WE8DEC = AL32UTF8 does not work)
See Oracle Database Globalization Support Guide for list of
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 315
See Oracle Database Globalization Support Guide for list of
binary subset/supersets
XDB and AWR repositories are currently not supported
Use awrextr.sql and awrload.sql to migrate AWR
In network mode, tables with LONG or LONG RAW in administrative
tablespaces (SYSTEM etc) are not supported
Full Transportable Export/Import
SOURCE Database 11.2.0.3 DESTINATION Database 12.1.0.1
Set data tablespaces
READ ONLY and
copy to destination
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 316
SOURCE Database 11.2.0.3 DESTINATION Database 12.1.0.1
SYSTEM
SYSAUX
UNDO
TEMP
SYSTEM
SYSAUX
UNDO
TEMP
VIEWS VIEWS
CODE CODE
PRIVS PRIVS
APP
HUGO
APP
HUGO
VIEWS VIEWS
CODE CODE
PRIVS PRIVS
Data Pump
USERS
3 Phases
1. Pre-transport data file migration
Easiest: copy datafiles after setting tablespaces READ ONLY
OR:
Less Downtime: apply incrementally-updated RMAN level 0 and
level 1 backups
2. Transport using network import
Data Pump over database link to migrate all the metadata
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 317
Data Pump over database link to migrate all the metadata
Downtime here because tablespaces have to be read-only
3. Post-transport cleanup
Case 8: Full Transportable Exp/Imp
Migration with full transportable export/import
Example Facts & Description
1. Hardware migration
2. Cross Endianness database migration from Oracle 11.2.0.3 to Oracle 12.1.0.1
3. Maximum tolerated downtime: 8 hours
4. Database size: 15TB
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 318
Oracle 11.2.0.3
HP-UX Itanium
8 hrs
15TB
Oracle 12.1.0.1
OEL5.8 64bit
15TB
Case 8: Full Transportable Exp/Imp
Migration with full transportable export/import
Phase 1A:
Backups and
datafile migration
Phase 1B:
Preparation on
target host
Phase 2A:
Tablespaces
R/O + Final Bck
Phase 2B:
Transportable
import
Phase 3:
Final
Actions
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 319
Oracle 11.2.0.3
HP-UX Itanium
8 hrs
15TB
Oracle 12.1.0.1
OEL5.8 64bit
15TB
Phase 1A:
Archivelog mode
Fast Recovery Area
ALTER DATABASE ARCHIVELOG;
ALTER DATABASE OPEN;
ALTER SYSTEM SET DB_RECOVERY_FILE_DEST_SIZE=4G;
ALTER SYSTEM SET DB_RECOVERY_FILE=DEST='/tmp/fra';
Phase 1A:
Backups & datafile migration
Phase 1B:
Prep on on target host
Phase 2A:
Tablespaces r/o & Final Bck
Phase 2B:
Transportable import
Phase 3:
Final Actions
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 320
Oracle 11.2.0.3
HP-UX Itanium
Oracle 12.1.0.1
OEL5.8 64bit
ALTER SYSTEM SET DB_RECOVERY_FILE=DEST='/tmp/fra';
15TB
Phase 1A:
Block Change Tracking
This will speed up RMAN level 1 backups
ALTER DATABASE ENABLE BLOCK CHANGE TRACKING
USING FILE '<name>' REUSE;
Phase 1A:
Backups & datafile migration
Phase 1B:
Prep on on target host
Phase 2A:
Tablespaces r/o & Final Bck
Phase 2B:
Transportable import
Phase 3:
Final Actions
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 321
Oracle 11.2.0.3
HP-UX Itanium
Oracle 12.1.0.1
OEL5.8 64bit
15TB
Phase 1A:
Make Fast Recovery Area accessible to target system
E.g. via NFS Mount
This will avoid the need to copy all backups to target host
Phase 1A:
Backups & datafile migration
Phase 1B:
Prep on on target host
Phase 2A:
Tablespaces r/o & Final Bck
Phase 2B:
Transportable import
Phase 3:
Final Actions
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 322
Oracle 11.2.0.3
HP-UX Itanium
Oracle 12.1.0.1
OEL5.8 64bit
NFS MOUNT NFS MOUNT
15TB
Phase 1A:
Incremental level 0+1 backups
First run will create a level 0 copy of all datafiles
Subsequent runs will backup and merge only changed blocks
RMAN TAGRET /
RMAN> RECOVER COPY OF DATABASE WITH TAG 'ftei';
RMAN> BACKUP INCREMENTAL LEVEL 1
FOR RECOVER OF COPY
Phase 1A:
Backups & datafile migration
Phase 1B:
Prep on on target host
Phase 2A:
Tablespaces r/o & Final Bck
Phase 2B:
Transportable import
Phase 3:
Final Actions
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 323
NFS MOUNT NFS MOUNT
Oracle 11.2.0.3
HP-UX Itanium
Oracle 12.1.0.1
OEL5.8 64bit
FOR RECOVER OF COPY
WITH TAG 'ftei' DATABASE;
15TB
Phase 1A optional: OS change
Backup conversion:
RMAN TARGET /
RMAN> CONVERT DATAFILE
'/fra/data/tbs1.f', '/fra/data/tbs2.f',
'/fra/data/tbs3.f'
TO PLATFORM="Linux IA (64-bit)"
Optional in
file system
Phase 1A:
Backups & datafile migration
Phase 1B:
Prep on on target host
Phase 2A:
Tablespaces r/o & Final Bck
Phase 2B:
Transportable import
Phase 3:
Final Actions
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 324
NFS MOUNT NFS MOUNT
Oracle 11.2.0.3
HP-UX Itanium
Oracle 12.1.0.1
OEL5.8 64bit
FROM PLATFORM="HP-UX IA (64-bit)"
DB_FILE_NAME_CONVERT='/fra/data/',
'/fra/x/' PARALLELISM=4;
15TB
file system
Phase 1B:
Create a fresh empty database
or
Provide a fresh empty PDB
Create a new (or use an existing) container database
Clone an empty PDB using the PDB_FILE_NAME_CONVERT parameter
CREATE PLUGGABLE DATABASE pdb1 ADMIN USER adm
Phase 1A:
Backups & datafile migration
Phase 1B:
Prep on on target host
Phase 2A:
Tablespaces r/o & Final Bck
Phase 2B:
Transportable import
Phase 3:
Final Actions
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 325
NFS MOUNT NFS MOUNT
CREATE PLUGGABLE DATABASE pdb1 ADMIN USER adm
IDENTIFIED BY <password>;
Oracle 11.2.0.3
HP-UX Itanium
Oracle 12.1.0.1
OEL5.8 64bit
15TB
Phase 1B:
Prepare database link and directory
Make sure user who will run target import exists on source with role
DATAPUMP_EXP_FULL_DATABASE
CREATE PUBLIC DATABASE LINK sourcedb
USING 'V112';
CREATE DIRECTORY mydir AS '/tmp/dp';
Phase 1A:
Backups & datafile migration
Phase 1B:
Prep on on target host
Phase 2A:
Tablespaces r/o & Final Bck
Phase 2B:
Transportable import
Phase 3:
Final Actions
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 326
NFS MOUNT NFS MOUNT
Oracle 11.2.0.3
HP-UX Itanium
Oracle 12.1.0.1
OEL5.8 64bit
15TB
CREATE DIRECTORY mydir AS '/tmp/dp';
GRANT READ, WRITE ON DIRECTORY mydir
TO system;
Database Link
Phase 2A:
All data tablespaces have to be in read-only mode
Final incremental backup and merge
ALTER TABLESPACE tbs1 read only;
RMAN TARGET /
RMAN> BACKUP INCREMENTAL LEVEL 1
FOR RECOVER OF COPY
Phase 1A:
Backups & datafile migration
Phase 1B:
Prep on on target host
Phase 2A:
Tablespaces r/o & Final Bck
Phase 2B:
Transportable import
Phase 3:
Final Actions
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 327
NFS MOUNT NFS MOUNT
Oracle 11.2.0.3
HP-UX Itanium
Oracle 12.1.0.1
OEL5.8 64bit
FOR RECOVER OF COPY
WITH TAG 'ftei' DATABASE;
Database Link
15TB
Phase 2A alternative:
All data files belonging to data tablespaces need to be copied to the
target destination
This would work with NOARCHIVELOG databases as well
ALTER TABLESPACE tbs1 read only;
Phase 1A:
Backups & datafile migration
Phase 1B:
Prep on on target host
Phase 2A:
Tablespaces r/o & Final Bck
Phase 2B:
Transportable import
Phase 3:
Final Actions
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 328
NFS MOUNT NFS MOUNT
Oracle 11.2.0.3
HP-UX Itanium
Oracle 12.1.0.1
OEL5.8 64bit
$ cp <all datafiles for tbs1>
Database Link
15TB
Phase 2B:
Run full import from target with the user having the role
DATAPUMP_EXP_FULL_DATABASE
impdp system/<pwd>@PDB1
NETWORK_LINK=sourcedb VERSION=12
FULL=Y TRANSPORTABLE=ALWAYS
METRICS=Y EXCLUDE=STATISTICS
Phase 1A:
Backups & datafile migration
Phase 1B:
Prep on on target host
Phase 2A:
Tablespaces r/o & Final Bck
Phase 2B:
Transportable import
Phase 3:
Final Actions
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 329
NFS MOUNT NFS MOUNT
Oracle 11.2.0.3
HP-UX Itanium
Oracle 12.1.0.1
OEL5.8 64bit
15TB
METRICS=Y EXCLUDE=STATISTICS
LOGFILE=mydir:impdp_pdb1.log
TRANSPORT_DATAFILES='/fra/data/tbs1.f'
TRANSPORT_DATAFILES='/fra/data/tbs2.f'
TRANSPORT_DATAFILES='/fra/data/tbs3.f'
Database Link
15TB
Phase 2B ALTERNATIVE: Dump File Based Commands
On source (V112):
expdp system/<pwd>@V112 DIRECTORY=mydir
DUMPFILE=V112full.dmp VERSION=12 FULL=Y
TRANSPORTABLE=ALWAYS METRICS=Y LOGFILE=fullexp.log
On target (PDB1):
impdp system/<pwd>@PDB1 DIRECTORY=mydir
DUMPFILE=V112full.dmp METRICS=Y LOGFILE=fi.lo
Phase 1A:
Backups & datafile migration
Phase 1B:
Prep on on target host
Phase 2A:
Tablespaces r/o & Final Bck
Phase 2B:
Transportable import
Phase 3:
Final Actions
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 330
NFS MOUNT NFS MOUNT
DUMPFILE=V112full.dmp METRICS=Y LOGFILE=fi.lo
EXCLUDE=STATISTICS TRANSPORT_DATAFILES='/fra/data/tbs1.f'
Oracle 11.2.0.3
HP-UX Itanium
Oracle 12.1.0.1
OEL5.8 64bit
15TB
Database Link
15TB
Phase 3:
Review import log
Resolve any issues
Validate contents of target against source
Optionally bring back all tablespaces on source into read-write
Tablespaces in target are automatically read-write after import
Done!
Phase 1A:
Backups & datafile migration
Phase 1B:
Prep on on target host
Phase 2A:
Tablespaces r/o & Final Bck
Phase 2B:
Transportable import
Phase 3:
Final Actions
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 331
NFS MOUNT NFS MOUNT
Done!
Oracle 11.2.0.3
HP-UX Itanium
Oracle 12.1.0.1
OEL5.8 64bit
15TB
Database Link
15TB
General Preparation Steps
Upgrade & Migration Cases
Fallback Strategies
Introduction & Overview
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 332
Performance Management
Wrap Up
Fallback Strategies
New Features in Oracle 12c
Fallback Strategy Strategy
Never start an upgrade or migration without evaluating and
testing your options for going back ...
Complete RMAN Online Backup is always a must
Clarify:
Fallback requirements in minutes/hours/days
How to deal with issues happening during the upgrade
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 333
How to deal with issues hours/days after the upgrade
Will you get additional downtime to change COMPATIBLE?
Parameter COMPATIBLE
Minimum COMPATIBLE in Oracle Database 12c: 11.0.0
11.0.0 and 11.1.0 are equivalent
Recommendation:
Change COMPATIBLE 7-10 days after upgrade
But: Changing COMPATIBLE will require a database restart
SQL>
COMPATIBLE can't be turned back
alter system set compatible='12.1.0' scope=spfile;
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 334
COMPATIBLE can't be turned back
COMPATIBLE must be increased to 11.0.0
Downgrade possible
COMPATIBLE can remain on 11.x.y
Fallback Strategy - Issues during upgrade
ALWAYS take a complete ONLINE backup with RMAN
Set all data tablespaces into READ
ONLY mode and take an OFFLINE
backup of SYSTEM, SYSAUX,
UNDO, TEMP, redologs + controlfiles
11.0
Create a guaranteed
restore point for
Flashback Database
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 335
No Yes
Change COMPATIBLE parameter?
Restore and
recover
online backup
Flashback to
the guaranteed
restore point
Shutdown, restore the offline
backup files and startup
in source environment
Yes
Fallback: Online Backup
Restore a backup
Complete online backup (RMAN)
Please verify:
Where is your backup located? Tapes, HD, off site...
Does the restore work?
How long will the restore take?
How long will the recovery take?
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 336
How long will the recovery take?
Recommendation:
Have a valid online backup in any case
Fallback: Offline Backup
Restore a partial offline backup
Put all data tablespaces in read-only mode
That's downtime!
Shutdown the database IMMEDIATE
Copy SYSTEM, UNDO, TOOLS, SYSAUX, XDB, DRSYS and
ODM data files plus control files and redologs
Be aware of potentially existing AQ objects in user tablespaces
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 337
Be aware of potentially existing AQ objects in user tablespaces
In case of failure:
Shutdown and copy all partial backup files back
Startup in the old environment and recreate TEMP
Advantages:
Fast and simple, even COMPATIBLE can be changed
Recommendation: Use this technique for very large databases
or when you don't have enough space for a complete backup
Fallback: Restore Point
Flashback to a guaranteed restore point
COMPATIBLE can't be changed
Pre Upgrade Environment Post Upgrade Environment
CREATE RESTORE POINT grpt
GUARANTEE FLASHBACK DATABASE;
SHUTDOWN IMMEDIATE
UPGRADE UPGRADE
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 338
STARTUP MOUNT;
FLASHBACK DATABASE TO RESTORE
POINT grpt;
SHUTDOWN IMMEDIATE
STARTUP MOUNT;
ALTER DATABASE OPEN
RESETLOGS;
DROP RESTORE POINT grpt;
Fallback Strategy Issues after upgrade
AGAIN take a complete ONLINE backup with RMAN after the upgrade
No Yes
Change COMPATIBLE parameter?
10.2
Yes
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 339
No Yes
Use Oracle Golden Gate
for a capture/apply
of data changes back to
the source release
Downgrade with
the catdwgrd.sql and
the catrelod.sql
scripts back to the
source release
Use Data Pump to import
data back into an empty
database in source env
Yes
Fallback: Data Pump
Downgrade with expdp/impdp to 10.x
MOS Note:553337.1
Prepare an empty database for the import just in case you'll have
to step back
Then:
Run expdp from the 12.1 database home with the
VERSION parameter equal to the target database
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 340
VERSION parameter equal to the target database
COMPATIBLE setting
Import using impdp from the target database home
NETWORK_LINK can be used for downgrades as well

Fallback: Golden Gate


Downgrade with Oracle Golden Gate
Version independent
Source
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 341
1
2
Downgrade
Upgraded
destination
database
Fallback: Downgrade
Downgrade with catdwgrd.sql
MOS Note:883335.1 and MOS Note:443890.1
Downgrade possible to:
Oracle 11.1.0.7
Oracle 11.2.0.x
Do not change COMPATIBLE
Some notes:
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 342
Some notes:
In a RAC/ASM environment Grid Infrastructure must not necessarily be downgraded
depending on certification
If XML Database was not present before upgrade it will be removed during downgrade
EM Database Control repository is removed during upgrade, and so cannot be downgraded
If Label Security and/or Database Vault is present olspredowngrade.sql must be
executed before starting the downgrade
Time zone cannot be downgraded therefore the higher TZ version must be installed into
the source database environment prior to the downgrade
For further steps please see the Upgrade Guide, Chapter 6.4
Fallback: Downgrade
Downgrade with catdwgrd.sql
In Oracle Database 12c environment:
In Oracle Database 11g environment:
SQL> SPOOL /tmp/downgrade.log
SQL> STARTUP DOWNGRADE
SQL> @catdwgrd.sql
SQL> SPOOL OFF
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 343
In Oracle Database 11g environment:
SQL> STARTUP UPGRADE
SQL> SPOOL /tmp/reload.log
SQL> @catrelod.sql
-- The catrelod.sql script reloads the appropriate version of
-- all of the database components in the downgraded database.
SQL> SPOOL OFF
General Preparation Steps
Upgrade & Migration Cases
Fallback Strategies
Introduction & Overview
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 344
Performance Management
Wrap Up
Fallback Strategies
New Features in Oracle 12c
Oracle Database 12c
Over 5 years in development
Over 500 new features
Over 2,500 person years of development
Over 3,000 systems used in testing
Development Effort
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 345
Over 3,000 systems used in testing
Over 1 million feature tests run daily
Over 1.2 million hours of stress tests
Big Data Big Data
Consolidation Consolidation
Data Data Optimization Optimization
Application Development Application Development
Data Warehousing Data Warehousing
Plug into the Cloud
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 346
Security & Compliance Security & Compliance
High Availability High Availability
In In- -Memory Memory
Performance & Scalability Performance & Scalability
Data Warehousing Data Warehousing
New
Features
ILM & Compression
Extreme Availability
Hundreds of Enhancements
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 347
ILM: Hot/Cold Data Classification
Enhanced Insight into Data Usage: heat map
ACTIVE ACTIVE
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 348
Recently inserted,
actively updated
Infrequently updated,
Frequently Queried
Retained for long term analytics and
compliance with corporate policies
and regulations
FREQUENT
ACCESS
DORMANT
Row and Segment level statistics on
last Read and last Update
Heat Map
What it tracks
Active
Frequent
Access
A Heat Map of the Database
Database level Heat Map
shows which tables and partitions are being used
Block level Heat Map
shows last modification at the block level
Comprehensive
Segment level shows both reads and writes
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 349
Occasional
Access
Dormant
Segment level shows both reads and writes
Distinguishes index lookups from full scans
Automatically excludes stats gathering, DDLs or table
redefinitions
SQL> alter system set parameter heat_map='ON';
Heat Map for Tables/Partitions or Blocks
segment level tracking
O
R
D
E
R
S
O
R
D
E
R
S
row level tracking
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 350
Heat Map
Future Enterprise Manager screens - WIP
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 351
ILM: Automatic Compression & Tiering
Usage based and custom compression and tiering
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 352
ALTER TABLE orders
ILM ADD CompressionPolicy
COMPRESS Partitions for Query
AFTER 90 days from creation;
ALTER TABLE sales
ILM ADD MovePolicy
TIER Partitions TO Archive_TBS
ON OrdersClosedPolicy;
New
Features
ILM & Compression
Extreme Availability
Hundreds of Enhancements
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 353
Extreme Availability
Active Data Guard Far Sync
Other Data Guard Enhancements
RMAN Enhancements
ASM and RAC
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 354
ASM and RAC
Zero Data Loss Challenge
Trade-off between Zero Data Loss and Performance
Commit Ack
Network Ack
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 355
The longer the distance, the larger the performance impact
Primary Standby
Commit
Network Send
Active Data Guard Far Sync
Complete Data Protection Without Compromise
Primary
Remote
Standby
Far Sync
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 356
Far Sync is very light-weight
Standby control file, redo log files, archived redo log files
No user data files, no media recovery, no Oracle Database license required
Deployed at a distance that SLAs can tolerate synchronous replication
To the primary, a Far Sync Instance looks like any other Data Guard
destination
Active Data Guard Far Sync
How Does Redo Transport Work?
Remote
Standby
ASYNC
SYNC
Far Sync
Primary
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 357
Far Sync receives redo synchronously from primary
Far Sync forwards redo asynchronously to a remote standby
Supports up to 29 remote destinations
Can also perform network compression (Advanced Compression Option)
Several options to implement HA for Far Sync
Far Sync instance can be Oracle RAC, or a second Far Sync instance can be
alternate destination, or the remote standby can be alternate destination (not shown)
Active Data Guard Far Sync
What Happens Should the Primary Fail?
Remote
Standby
ASYNC
Primary
Far Sync
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 358
Far Sync has redo for all committed transactions
Remote standby database receives all redo from the Far Sync instance
Active Data Guard 12c Far Sync
How Do Role Transitions Work?
New
Primary
Single-Step Role Transition
Primary
Far Sync
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 359
Single-step, zero data loss failover to remote standby
Far Sync confirms that the configuration is in zero data loss state
Remote Standby becomes primary - manual or automatic using Fast-Start
Failover
Same failover command as for any Data Guard configuration
Switchover is also transparent - same command used for any
configuration
ADG Far Sync Creation
Create a control file using a mounted primary
Copy the server parameter file (SPFILE) used by the primary
Several initialization parameters must also modified for Far Sync
Copy the control file to the Far Sync instance
Create standby redo log files
Simple and Lightweight
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 360
Start Far Sync
ADG Far Sync
Example, New York London
Standby
London
ASYNC
(compressed)
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 361
Primary
New York
London
Far Sync
Instance
SYNC
Zero data loss failover
ADG Far Sync Post Failover
Example, London New York
Primary
London
Far Sync
Instance
SYNC
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 362
Standby
New York
London
ASYNC
(compressed)
Zero data loss failover
Extreme Availability
Data Guard Far Sync
Other Data Guard Enhancements
RMAN Enhancements
ASM and RAC
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 363
ASM and RAC
Data Guard Real-Time Cascading
Primary
Standby 1
Standby 2
SYNC or ASYNC ASYNC
Purpose: Eliminating propagation delay
In Oracle 11.2
Standby 1 waits until log switch before forwarding redo from
archived logs to Standby 2
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 364
In Oracle 12.1
Standby 1 forwards redo to Standby 2 in real-time, as it is
received: no propagation delay for a log switch
Standby 2 is up-to-date for offloading read-only queries/reports
Data Guard Fast Sync
Reduced impact on production for Maximum Availability
Primary Standby
Redo
Logs
Standby
Redo
Logs
Commit
Commit
Acknowledge
For SYNC Mode: remote site
acknowledges received redo before
writing it to standby redo logs
Reduces latency of commit on
primary
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 365
Commit
Commit
Acknowledge
Primary Standby
Redo
Logs
Standby
Redo
Logs
LOG_ARCHIVE_DEST_3='SERVICE=
stby1 SYNC NOAFFIRM'
Acknowledge
returned on receipt
Extreme Availability
Data Guard Far Sync
Other Data Guard Enhancements
RMAN Enhancements
ASM and RAC
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 366
ASM and RAC
1 0 1
0 1 0 1 0
1 1 1 0 1 0 0 1
Fine-grained Table Recovery From
Backup
Simple RECOVER TABLE command to
recover one or more tables (most
recent or older version) from an
RMAN backup
Eliminates time and complexity
associated with manual restore,
recover & export
Enables fine-grained point-in-time
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 367
1 1 1 0 1 0 0 1
1 0 1 1 0 1 1 1 1 0
0 0 1 0 1 0 0 0 0
1 0 0 1 1 0 1
1 0 1 0
0 1
Enables fine-grained point-in-time
recovery of individual tables instead of
the contents of the entire tablespace
Restores the recovered table to an
Oracle Data Pump dump file
Optionally imports the dump file and
renames the table in the target
database
RMAN
Backups
Cross-Platform Backup & Restore
Simplified Platform Migration
Uses Data Pump for metadata, backup sets for data files
Source Database (AIX) Destination Database (Linux)
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 368
Simplifies procedure for platform migration
Minimize read-only impact with multiple incremental backups
Restore Backup
(optional endian
conversion,
metadata import)

1
1
1
0
1

1
0
1
1
0
1
1
1
1
0
1

0
0
1
0
1
0
0
0
0
1

1
0
0
1



1
1
1
0
1

1
0
1
1
0
1
1
1
1
0
1

0
0
1
0
1
0
0
0
0
1

1
0
0
1


Backup
to Disk/Tape
(data files, optional
endian conversion,
metadata export)
Extreme Availability
Data Guard Far Sync
Other Data Guard Enhancements
RMAN Enhancements
ASM and RAC
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 369
ASM and RAC
ASM Overview
Oracle Database 11.2 or earlier
Node2 Node3 Node5 Node4
One to One
Mapping of ASM
Instances to
Servers
Node1
ASM Instance
Database Instance
RAC Cluster
DB
A
DB
A
DB
B
DB
B
DB
C
DB
B
ASM ASM ASM ASM ASM ASM ASM ASM
ASM ASM
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 370
ASM Cluster Pool of Storage
Disk Group B Disk Group A
Shared Disk
Groups
Wide File Striping
ASM Disk
Oracle ASM 12c Overview
Oracle ASM 12c Standard Deployment
One to One
Mapping of ASM
Instances to
Servers
ASM Instance
Database Instance
RAC Cluster
Node4 Node3 Node2 Node1 Node5
ASM ASM ASM ASM ASM ASM ASM ASM
ASM ASM
ASM Instance
Database Instance
DB
A
DB
A
DB
A
DB
A
DB
C
DB
C
DB
B
DB
B
DB
B
DB
B
DB
B
DB
B
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 371
ASM Cluster Pool of Storage
Disk Group B Disk Group A
Shared Disk
Groups
Wide File Striping
ASM Disk
Introducing Oracle Flex ASM
Removal of One to One Mapping and HA
Databases share
ASM instances
ASM Instance
Database Instance
RAC Cluster
Node5 Node4 Node3 Node2 Node1
Node5 Node1 Node1
Node2
ASM ASM ASM ASM ASM ASM
ASM Instance
DB
A
DB
A
DB
A
DB
A
DB
C
DB
C
DB
B
DB
B
DB
B
DB
B
DB
B
DB
B
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 372
ASM Cluster Pool of Storage
Disk Group B Disk Group A
Shared Disk
Groups
Wide File Striping
ASM Disk
Node5
runs as
ASM
Client to
Node4
Node1
runs as
ASM
Client to
Node2
Node1
runs as
ASM
Client to
Node4
Node2
runs as
ASM
Client to
Node3
Flex ASM
Remote Access
In previous versions, ASM clients use OS-authentication to connect
to ASM
This works because ASM clients and servers are always on the
same server
With Oracle Database 12c:
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 373
With Oracle Database 12c:
ASM clients and ASM servers can be on different servers
A default configuration is created when the ASM cluster is
configured
Supporting Pre-Oracle 12c Databases
Pre-Oracle 12c Databases require a local ASM instance
Databases share
ASM instances
ASM Instance
Database Instance
RAC Cluster
Node5 Node4 Node3 Node2 Node1
ASM ASM ASM ASM ASM ASM
DB
A
DB
A
DB
A
DB
A
DB
C
DB
C
ASM ASM ASM ASM
11g
DB
11g
DB
DB
B
DB
B
DB
B
DB
B
DB
B
DB
B
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 374
ASM Cluster Pool of Storage
Disk Group B Disk Group A
Shared Disk
Groups
Wide File Striping
ASM Disk
Flex ASM
Other Flex ASM features
Increase maximum number of Disk Groups to 511 (previous: 63)
Command for renaming ASM Disk
ASM instance Patch-level verification
Patch level verification is disabled during rolling patches
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 375
Oracle Flex Cluster
A new Oracle Clusterware based
High Availability clustering topology
Utilizing two types of cluster nodes:
Hub nodes
Traditional nodes, tightly coupled via network and
storage, used for running IO intensive workload
Leaf nodes
Oracle Flex Cluster
Better HA clustering for any application
Leaf Nodes
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 376
Leaf nodes
A new type of node that runs a lighter weight stack
Maintain their own failure and heartbeat settings
Do not require direct shared storage connectivity
Used for processing oriented (application) workload
Hub Nodes
New
Features
ILM & Compression
Extreme Availability
Hundreds of Enhancements
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 377
Hundreds of Enhancements
32K Varchar, NVARCHAR, RAW types
Cross-platform RMAN Backup and Restore
Move Data File Online
Application Continuity
Transaction Guard
Oracle Spatial and Graph 3D Streaming
Data Pump Export View as Table
IDENTITY Columns
Data Redaction
Invisible Columns
Database Entitlement Analytics
Database Vault Persistent Protections
Flex Clusters
Clonedb Thin Provisioning
Major New Features in Many Areas
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 378
Data Pump Export View as Table
Advanced Index Compression
Real-Time Database Operations Monitoring
Query Filter Cache
Concurrent Statistics Gathering
In-Database MapReduce
Global Data Services
Adaptive Execution Plans
Temporal Database
Clonedb Thin Provisioning
Online Move of Datafiles
Rename or relocate datafiles online
Move from one type of storage to another, or into ASM
Examples:
Rename:
Relocate:
ALTER DATABASE MOVE DATAFILE '/data/user1.dbf' TO
'/data/user001.dbf';
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 379
Copy:
Move into ASM:
ALTER DATABASE MOVE DATAFILE '/data/user1.dbf' TO
'/test/user1.dbf';
ALTER DATABASE MOVE DATAFILE '/data/user1.dbf' TO
'/test/user1.dbf' KEEP;
ALTER DATABASE MOVE DATAFILE '/data/user1.dbf' TO
'+DATA/data/datafile/user1.dbf';
New Roles - Least Privileges
SYSDBA still keeps all privileges
New roles depending on tasks
RMAN
SYSBACKUP
Data Guard
SYSDG
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 380
Wallet administration for TDE
SYSKM
IDENTITY
Example:
CREATE TABLE t1
(id NUMBER GENERATED AS IDENTITY,
first_name varchar2(30));
INSERT INTO t1(first_name) values ('Hugo');
ID FIRST_NAME
Create a table where the id column is always populated by Oracle
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 381
ID FIRST_NAME
----- ------------
1 Hugo
CREATE TABLE t2
(id NUMBER GENERATED BY DEFAULT AS IDENTITY
(START WITH 100 INCREMENT BY 10),
first_name varchar2(30));
Create a table where the id column is populated by Oracle when not provided
Row Limit
Example:
SELECT employee_id, last_name
FROM employees
ORDER BY employee_id
FETCH FIRST 5 ROWS ONLY;
Select only the first 5 rows
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 382
SELECT employee_id, last_name, salary
FROM employees
ORDER BY salary
FETCH FIRST 5 PERCENT ROWS WITH TIES;
Select the first 5% of rows and those whose salary ties with the lowest of the 5%
32K VARCHAR2 / NVARCHAR2
Example:
ALTER SYSTEM set MAX_STRING_SIZE=EXTENDED scope=SPFILE;
Enable 32k support in the Oracle Database 12c
Create table with 32k varchar2
SHUTDOWN IMMEDIATE
STARTUP UPGRADE
@?/rdbms/admin/utl32k.sql
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 383
CREATE TABLE Applicants
(id NUMBER GENERATED AS IDENTITY,
first_name varchar2(30),
last_name varchar2(30),
application date,
CV varchar2(32767)
);
Create table with 32k varchar2
Enterprise Manager Express

Menus
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 384
This tab requires
Diagnostic & Tuning
Pack licenses
Enterprise Manager Express
Manual configuration of the HTTP port for EM Express
In init.ora/spfile (default setting):
dispatchers=(PROTOCOL=TCP)(SERVICE=sample XDB)
Check on which port EM Express is configured:
SQL> select DBMS_XDB_CONFIG.getHTTPport() from dual;
SQL> select DBMS_XDB_CONFIG.getHTTPSport() from dual;
Set a new port:
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 385
Set a new port:
SQL> exec DBMS_XDB.setHTTPport(5500);
SQL> exec DBMS_XDB.setHTTPSport(8080);
Now access the EM Express homepage in the browser:
http://database-hostname:port/em
http://localhost:5500/em
The configuration will have to be done for the CDB and every single
PDB on different ports
Enterprise Manager Cloud Control 12c
Plug-in "Enterprise Manager For Oracle Database (DB)
12.1.0.3" already released via EM Self-Update
Supports Oracle Database 12.1.0.1
Discovers CDBs and PDBs
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 386
Enterprise Manager Cloud Control 12c
Discovered Oracle Database 12c targets:
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 387
Policy
enforced
redaction of
sensitive data
Redacting Sensitive Data
Mask Application Data Dynamically
Call Center
Operator
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 388
Soc. Sec. #
115-69-3428
DOB
11/06/71
PIN
5623
sensitive data
Payroll
Processing
052-51-2147
XXX-XX-2147
Redaction
Supported Transformations
Stored Data
Redacted Results
10/09/1992 Full
Partial
01/01/2001
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 389
052-51-2147
tim.lee@acme.com [hidden]@acme.com
4451-2172-9841-4368
4943-6344-0547-0110
RegExp
Random
Redaction
Policy based with conditional enforcement
DBMS_REDACT.ADD_POLICY(
policy_name => 'Redact Customer PII',
object_schema => 'CALLCENTER',
object_name => 'CUSTOMERS',
column_name => 'DOB',
expression =>
'SYS_CONTEXT(''USERENV'',''CLIENT_IDENTIFIER'')
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 390
'SYS_CONTEXT(''USERENV'',''CLIENT_IDENTIFIER'')
!=''SUPERVISOR04''',
function_type => DBMS_REDACT.FULL);
Redaction decisions can be based on runtime conditions
Database environment User, role, session, client IP, auth type
Context from applications App user, app role, app identifier, APEX V() and NV() functions
Context from Label Security User session label
Redaction
Application transparency
Supports commonly used Oracle Database data types
Maintains the data type and optionally the formatting
Does not alter the data in database caches, buffers, or
storage
Redacts only for display
Works with views and does not alter the query plan
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 391
Works with views and does not alter the query plan
Typically requires zero application code or configuration
changes
General Preparation Steps
Upgrade & Migration Cases
Fallback Strategies
Introduction & Overview
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 392
Performance Management
Wrap Up
Fallback Strategies
New Features in Oracle 12c
Performance Checklist
Prepare
Plan Stability
O Adjust maintenance windows
O Configure statistics retention
O Configure incremental statistics
O Adjust memory and optimizer parameters
O Configure AWR, ASH and ADDM
O Preserve and transport execution plans
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 393
Test Performance
Optimize
Performance
O General test guidelines
O Real Application Testing
O Performance New Features
Enable Features
O System Statistics
O Automatic Tuning Advisor
Things to do right after upgrade
Adjust default maintenance windows
SQL> select CLIENT_NAME, STATUS from DBA_AUTOTASK_CLIENT;
Default weekday windows run from 10pm to 2am (4 hours)
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 394
Default weekday windows run from 10pm to 2am (4 hours)
Default weekend windows run from 6am to 2am (20 hours)
Resource Manager is active
Adjust windows to fit your business needs
SQL> exec DBMS_SCHEDULER.SET_ATTRIBUTE(
'MONDAY_WINDOW','REPEAT_INTERVAL',
'freq=daily;byday=MON;byhour=05;byminute=0; bysecond=0');
SQL> exec DBMS_SCHEDULER.SET_ATTRIBUTE(
'MONDAY_WINDOW','DURATION',numtodsinterval(2,'hour'));
SQL> exec DBMS_SCHEDULER.SET_ATTRIBUTE(
'MONDAY_WINDOW','REPEAT_INTERVAL',
'freq=daily;byday=MON;byhour=05;byminute=0; bysecond=0');
SQL> exec DBMS_SCHEDULER.SET_ATTRIBUTE(
'MONDAY_WINDOW','DURATION',numtodsinterval(2,'hour'));
Things to do right after upgrade
Configure statistics retention period
By default object statistics will be kept for 31 days
Data gets stored in SYSAUX tablespace
Check the current space consumption:
SQL> select SPACE_USAGE_KBYTES/1024 MB from
V$SYSAUX_OCCUPANTS where OCCUPANT_NAME='SM/OPTSTAT';
Check the current setting:
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 395
Check the current setting:
SQL> select DBMS_STATS.GET_STATS_HISTORY_RETENTION
from DUAL;
Adjust the current setting (here: 10 days):
SQL> exec
DBMS_STATS.ALTER_STATS_HISTORY_RETENTION(10);
Things to do right after upgrade
Configure incremental statistics collection
Valid and useful for selected partitioned tables
Set it for selected tables only:
SQL>
Gather statistics for touched partition(s) ONLY
Stats for that table must be gathered with GRANULARITY
exec DBMS_STATS.
SET_TABLE_PREFS('SH','SALES','INCREMENTAL','TRUE');
exec DBMS_STATS.
SET_TABLE_PREFS('SH','SALES','INCREMENTAL','TRUE');
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 396
Stats for that table must be gathered with GRANULARITY
parameter set to AUTO
Result: Faster runtime for stats collection on partitioned tables
Global setting:
SQL>
exec DBMS_STATS.SET_GLOBAL_PREFS('INCREMENTAL','TRUE'); exec DBMS_STATS.SET_GLOBAL_PREFS('INCREMENTAL','TRUE');
Things to do right after upgrade
Incremental stats
Sales Table Sales Table
May 18 May 18
th th
2008 2008
May 19 May 19
th th
2008 2008
May 20 May 20
th th
2008 2008
Sales Table Sales Table Sales Table Sales Table
May 18 May 18
th th
2008 2008
May 19 May 19
th th
2008 2008
May 20 May 20
th th
2008 2008
Partition level stats are
gathered & synopsis created
O
Global stats generated by
aggregating partition level
statistics and synopsis
O
O
Global stats generated by
aggregating the original partition
synopsis with the new one
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 397
Sysaux Tablespace
May 22 May 22
nd nd
2008 2008
May 23 May 23
rd rd
2008 2008
May 21 May 21
st st
2008 2008
May 22 May 22
nd nd
2008 2008
May 23 May 23
rd rd
2008 2008
May 21 May 21
st st
2008 2008
May 24
th
2008
A new partition is
added to the table
& data is Loaded
O
Gather partition statistics for new partition
O
O
Retrieve synopsis for each of the
other partitions from SYSAUX
Things to do right after upgrade
Configure Automatic Shared Memory Management
Especially important if Pluggable Database will be used
SGA_TARGET
In addition DB_CACHE_SIZE, SHARED_POOL_SIZE etc will
define minimum values which won't be underrun
If resize operations (done by MMAN) happen to frequent
"_MEMORY_BROKER_STAT_INTERVAL"=900 should be set
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 398
"_MEMORY_BROKER_STAT_INTERVAL"=900 should be set
default is 30 (seconds)
PGA_AGGREGATE_TARGET
MEMORY_TARGET should only
be used only for ASM and in
smaller environments with
very constant load
Parameter Information Oracle 12c
PGA_AGGREGATE_LIMIT
Values: integer [ K | M | G ]
Default: >2GB and 200% of PGA_AGGREGATE_TARGET and 3MB x
PROCESSES it will not exceed 120% of physical memory SGA
size. Setting it to 0 will mean "no limit"
Example:
SGA_TARGET=20G
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 399
SGA_TARGET=20G
PGA_AGGREGATE_TARGET=20G
PROCESSES=1200
Physical memory: 64G
Verification/calculation:
Min Limit: >2GB? Yes
3MB x PROCESSES = 3.6G
200% of PGA_AGGREGATE_TARGET = 40G
g 120% of physical memory SGA size = 76.8G 20G = 56.8G? Yes
Parameter Information Oracle 11.2/12c
_MEMORY_IMM_MODE_WITHOUT_AUTOSGA
Values: TRUE | FALSE
Purpose:
Switching this parameter to FALSE will prevent the SGA from doing
resize operations even though neither SGA_TARGET nor
MEMORY_TARGET are set.
Explanation:
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 400
A generic enhancement in 11.2.0.1 was made to allow IMMEDIATE
mode requests even when SGA_TARGET (or MEMORY_TARGET) is not
set. This enhancement has been introduced to prevent ORA-4031
errors due to shared pool pressure.
Feature can be turned off:
alter system set "_memory_imm_mode_without_autosga"=FALSE;
Further information: Note:1269139.1
Parameter Information Oracle 11.2/12c
OPTIMIZER_MODE
Values: ALL_ROWS | FIRST_ROWS |
FIRST_ROWS_[1|10|100|1000]
Note:
Obsolete settings (will be ignored):
optimizer_mode=choose
optimizer_mode=rule
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 401
optimizer_mode=rule
Only the /*+RULE */ hint will still work
Parameter Information Oracle 11.2/12c
OPTIMIZER_DYNAMIC_SAMPLING
If statistics are not available it controls whether dynamic stats will
be gathered, and the sample size
Default: 2
Values: 0-11
0: Switches off dynamic sampling
2: Check at max the first 64 blocks to generate stats on the fly
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 402
2: Check at max the first 64 blocks to generate stats on the fly
11: NEW SETTING
Use dynamic statistics automatically when the Optimizer deems it
Verifies cardinality and implements a time limit for the estimate
Results persist as Shareable Statistics
Parameter Information Oracle 11.2/12c
OPTIMIZER_DYNAMIC_SAMPLING

O
r
a
c
l
e

D
a
t
a
b
a
s
e

1
2
c
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 403
P
a
g
e

2
4
8

S
Q
L

T
u
n
i
n
g

G
u
i
d
e

Parameter Information Oracle 11.2/12c


OPTIMIZER_USE_PENDING_STATISTICS
Values: FALSE | TRUE
Mitigate the risk of newly created object statistics
Object statistics persist through an upgrade
Temporarily switch on Pending Statistics:
SQL> exec
DBMS_STATS.SET_GLOBAL_PREFS('PENDING','TRUE');
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 404
DBMS_STATS.SET_GLOBAL_PREFS('PENDING','TRUE');
Afterwards gather new Oracle 12c statistics as "pending":
SQL> DBMS_STATS.GATHER_SCHEMA_STATS('SH');
Verify your critical statements with pending statistics:
SQL> alter session set
optimizer_use_pending_statistics=TRUE;
Once everything is good publish them:
SQL> exec DBMS_STATS.PUBLISH_PENDING_STATS();
Parameter Information Oracle 11.2/12c
STATISTICS_LEVEL
Values: TYPICAL | ALL | BASIC
Note:
TYPICAL (recommended setting) will enable:
Automatic SGA Tuning (SGA_TARGET)
Automatic Statistics Collection
Active Session History (ASH)
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 405
Active Session History (ASH)
DML Monitoring
This parameter is the basis for most diagnostics features
Parameter Information Oracle 11.2/12c
CONTROL_MANAGEMENT_PACK_ACCESS
Values: DIAGNOSTIC+TUNING | DIAGNOSTIC | NONE
Note:
NONE will switch off statistics collection for AWR, ASH etc
Should be set when Diagnostic Pack is not licensed for an instance
STATSPACK can still be used but has very limited functionality
STATSPACK Guide : MOS Note:394937.1
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 406
STATSPACK Guide : MOS Note:394937.1
Turn of AWR/ASH in case you'll use STATSPACK
Configure AWR, ASH & ADDM
MMON
In-memory
statistics
AWR
SGA
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 407
Snapshots
ADDM
ADDM
results
Alerts
Reactive
Proactive
DBA
Configure AWR, ASH & ADDM
Automatic Workload Repository (AWR)
Data collected by MMON
Default: Snapshot every 60 minutes kept for 8 days
Recommendation:
SQL> exec
DBMS_WORKLOAD_REPOSITORY.MODIFY_SNAPSHOT_SETTINGS(44640,30)
-- 31 days (=4460min), every 30 minutes
Data stored in tablespace purged automatically
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 408
Data stored in SYSAUX tablespace purged automatically
Important scripts:
Size and trend: SQL> @?/rdbms/admin/awrinfo.sql
AWR report SI: SQL> @?/rdbms/admin/awrrpt.sql
AWR report RAC: SQL> @?/rdbms/admin/awrrpti.sql
AWR report SQLID: SQL> @?/rdbms/admin/awrsqrpt.sql
AWR diff report: SQL> @?/rdbms/admin/awrgrrpt.sql
AWR extract: SQL> @?/rdbms/admin/awrextr.sql
AWR load: SQL> @?/rdbms/admin/awrload.sql
Configure AWR, ASH & ADDM
Active Session History (ASH)
Key to database diagnostics
Data collected by MMNL
View: V$ACTIVE_SESSION_HISTORY
Space and time usage:
Fixed size, circular buffer:
2MB x #CPUs (max. 5% SGA or <30MB)
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 409
2MB x #CPUs (max. 5% SGA or <30MB)
Designed to hold ~1 hour of statistics,
but may flush or fill sooner
Further info: Note:243132.1
Important scripts:
ASH report SI:
SQL> @?/rdbms/admin/ashrpt.sql
ASH report RAC:
SQL> @?/rdbms/admin/ashrpti.sql
Configure AWR, ASH & ADDM
Real-Time ADDM
MMON obtains performance stats every 3 sec without lock/latch
MMON triggers a real-time ADDM analysis when:
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 410
MMON slave process creates report and stores it in AWR
See the DBA_HIST_REPORTS view
Performance Checklist
Prepare
Plan Stability
- Adjust maintenance windows
- Configure statistics retention
- Configure incremental statistics
- Adjust memory and optimizer parameters
- Configure AWR, ASH and ADDM
O Preserve and transport execution plans
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 411
Test Performance
Optimize
Performance
O General Test Guidelines
O Real Application Testing
O Performance New Features
Enable Features
O System Statistics
O Automatic Tuning Advisor
Typical situation after a change
Challenging to "freeze" execution plans and statistics
Difficulty:
Statement has been parsed and a plan got created
Verification happens during execution:
HJ
GB
Parse Execute Plan acceptable
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 412
Now some conditions get changed (statistics, upgrade, parameters)
A new plan will be created - is it better or worse???
HJ
NL
NL
GB
Parse Execute
Plan possibly
not acceptable
Strategies to enforce Plan Stability
Rule Based Optimizer?
Desupported since ages! If you don't believe it, see Note:189702.1
Stored Outlines?
Deprecated since Oracle 11g
Rewrite statements, reparameterization, hints ...?
Plenty of work and neither predictable nor stable
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 413
Use SQL Plan Management
Free EE feature to ensure plan stability
Stores verified plans in a SQL Plan Baseline for reuse
Package: DBMS_SPM
SQL Plan Management
Phase 1 Baseline Capture
Schematically - OPTIMIZER_CAPTURE_SQL_PLAN_BASELINES=TRUE
If OPTIMIZER_CAPTURE_SQL_PLAN_BASELINES=TRUE
then all found plans will be put into the baseline
Parse
HJ
HJ
GB
Execute
Plan acceptable
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 414
Plan History
HJ
HJ
GB
Plan Baseline
Initial plan
will be accepted
if repeated and
will be added to the
SQL Plan Baseline
SQL MANAGEMENT BASE
Residing in SYSAUX TS.
Will occupy max. 10% of SYSAUX.
Weekly job will delete plans
not used since 53 weeks [default].
SQL Profiles
SQL Plan Management
Phase 2 - Selection
Same statement parsed again but a different plan will be created
OPTIMIZER_CAPTURE_SQL_PLAN_BASELINES=FALSE
is set to its default
Annotation:
If OPTIMIZER_CAPTURE_SQL_PLAN_BASELINES=TRUE then
this plan would have been added to the baseline
Parse
NL
NL
GB
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 415
Plan History
Plan Baseline
HJ
HJ
GB
New plan will be
added to the Plan
History but it won't
be used unless it
has been verified
GB
NL
NL
Plan History
Plan Baseline
Plan History
Plan Baseline
SQL Plan Management
Phase 3 - Evolution
Schematically:
GB
GB
GB
NL
NL
GB
NL
GB
Worse plan will
be kept in the
Plan History
GB
NL
NL
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 416
GB
NL
NL
HJ
HJ
GB NL
DBA
Optimizer
NL
HJ
HJ
Equal or better plans
can be added to the SQL
Plan Baseline
DBA schedules
verification DBMS_SPM.EVOLVE_SQL_PLAN_BASELINE
Configure SQL Plan Management
Change the retention period for plans in the SQL
Management Base in SYSAUX tablespace
SQL> exec
DBMS_SPM.CONFIGURE('plan_retention_weeks',5);
The default is 53 weeks
But: plans will be stored in LOB segments and can't shrink
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 417
Sources for SQL Plan Management can be:
Cursor Cursor
Cache Cache
Stage table
Load plans
from a SQL
Tuning Set
Load plans
from the
Cursor Cache
Load plans
from Stored
Outlines
Load plans
from a staging
table
SQL Plan Management Upgrade/OFE
Upgrade scenario 1
STS
Plan History
Repeatable plans will be added
to the Plan Baseline upon 2nd
execution
Now: Different
plans created
with OFE=11
O O
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 418
Plan History
Plan Baseline
GB
NL
NL
GB
HJ
HJ
GB
NL
NL
GB
NL
NL
will be added to
the Plan History
for later verification
SQL Plan Management Upgrade/OFE
Upgrade scenario 1
Even though this scenario might look promising in the real world it
won't generate purely Oracle 10g plans. Setting OFE to a different
value as the actual database release will only parameterize the
optimizer according to OFE setting but it will already use the
Oracle 12c code paths and therefore generate different plans than in
Oracle 10g
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 419
This approach is not recommended
SQL Plan Management Upgrade/Outlines
Upgrade scenario 2
STS
exp imp
...
SS
O
O
Exp/imp outlines to
New system
Transfer query plans
into the Plan Baseline with
DBMS_SPM.MIGRATE_STORED_OUTLINE
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 420
Plan History
Plan Baseline
GB
NL
NL
GB
HJ
HJ
GB
NL
NL
Capture query outlines on
the production system
DBMS_SPM.MIGRATE_STORED_OUTLINE
SQL Plan Management Upgrade/Outlines
Upgrade scenario 2
In Oracle 9i/10g:
GRANT CREATE ANY OUTLINE TO APPUSER;
ALTER SYSTEM set CREATE_STORED_OUTLINES=MYPLANS;
Now run the statements you'd like to capture
ALTER SYSTEM set CREATE_STORED_OUTLINES=false;
Check the category (should be ):
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 421
202 Oracle Corporation 421
Check the category (should be MYPLANS):
SELECT name, sql_text, category FROM
user_outlines;
Upgrade to Oracle 12c
variable repo clob;
exec :repo:=DBMS_SPM.MIGRATE_STORED_OUTLINE(
attribute_name=>'CATEGORY',
attribute_value=>'MYPLANS');
SQL Plan Management - Upgrade
Upgrade scenario 3
Staging
Table 1
STS
exp imp
expdp impdp
DB-Link ...
STS
O O
Staging
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 422
Plan History
Plan Baseline
GB
NL
NL
GB
HJ
HJ
GB
NL
NL
10.2 plans will be added
to the SQL Plan Baseline
GB
NL
NL
Every new and better plan
will be stored in the Plan History
Table 2
SQL Profiles
DBMS_SPM.LOAD_PLANS_FROM_SQLSET
SQL Plan Management - Upgrade
Upgrade scenario 3: Capturing from Cursor Cache

BEGIN
SYS.DBMS_SQLTUNE.CREATE_SQLSET(
sqlset_name=>'SPM_STS',description=>'10.2 plans');
END;
/
DECLARE
stscur dbms_sqltune.sqlset_cursor;
BEGIN
BEGIN
SYS.DBMS_SQLTUNE.CREATE_SQLSET(
sqlset_name=>'SPM_STS',description=>'10.2 plans');
END;
/
DECLARE
stscur dbms_sqltune.sqlset_cursor;
BEGIN
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 423
BEGIN
OPEN stscur FOR
SELECT VALUE(P) FROM TABLE(dbms_sqltune.select_cursor_cache(
'parsing_schema_name<>''SYS''',null,null,null,null,1,null,'ALL')) P;
-->> Populate the SQL Tuning Set
dbms_sqltune.load_sqlset(sqlset_name=>'SPM_STS',populate_cursor=>stscur);
END;
/
SQL> variable cnt number
SQL> exec :cnt := DBMS_SPM.LOAD_PLANS_FROM_SQLSET(sqlset_name=>'SPM_STS');
BEGIN
OPEN stscur FOR
SELECT VALUE(P) FROM TABLE(dbms_sqltune.select_cursor_cache(
'parsing_schema_name<>''SYS''',null,null,null,null,1,null,'ALL')) P;
-->> Populate the SQL Tuning Set
dbms_sqltune.load_sqlset(sqlset_name=>'SPM_STS',populate_cursor=>stscur);
END;
/
SQL> variable cnt number
SQL> exec :cnt := DBMS_SPM.LOAD_PLANS_FROM_SQLSET(sqlset_name=>'SPM_STS');
SQL Plan Management - New Application
New application (module) gets delivered
exp imp
expdp impdp
O O
@Vendor
DBMS_SPM.CREATE_STGTAB_BASELINE
Staging
Table
@Customer
Staging
Table
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 424
Plan Baseline
GB
NL
NL
GB
HJ
HJ
GB
NL
NL
DBMS_SPM.PACK_STGTAB_BASELINE
DBMS_SPM.UNPACK_STGTAB_BASELINE
Plan Baseline
GB
NL
NL
GB
HJ
HJ
GB
NL
NL
SQL Plan Management - Transport
Transporting SQL Plan Management baselines between
test and production databases
@Test System:
Create a staging table using
DBMS_SPM.CREATE_STGTAB_BASELINE
Pack the required baselines into the staging table using
DBMS_SPM.PACK_STGTAB_BASELINE
Export the staging table into a dump file using Data Pump Export
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 425
Export the staging table into a dump file using Data Pump Export
and transport it to the destination system
@Production System:
Import the dump file into the destination database
Unpack the SQL Plan Baselines from the staging table into
the SQL Management Base of the target system
DBMS_SPM.UNPACK_STGTAB_BASELINE
SQL Plan Management
White Paper:
http://www.oracle.com/technetwork/database/focus-areas/bi-
datawarehousing/twp-sql-plan-management-11gr2-133099.pdf
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 426
MOS Notes:
Note:456518.1 SQL Plan Management Example
Note:789888.1 How to load plans from AWR into SPM
Note:801033.1 How to move 10.2 plans into 11g SPM
Performance Checklist
Prepare
Plan Stability
- Adjust maintenance windows
- Configure statistics retention
- Configure incremental statistics
- Adjust memory and optimizer parameters
- Configure AWR, ASH and ADDM
- Preserve and transport execution plans
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 427
Test Performance
Optimize
Performance
O General Test Guidelines
O Real Application Testing
O Performance New Features
Enable Features
O System Statistics
O Automatic Tuning Advisor
General Test Guidelines
1. Test the Upgrade
Is it successful?
How long does it take?
2. Test Post-Upgrade Functionality
Will your applications run correctly?
3. Test Post-Upgrade Performance
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 428
Time important queries, reports, and batch jobs
Managing Optimizer/CBO stats during upgrade: Note:465787.1
Tune your init.ora parameters, OS parameters
Use real life loads!
Real Application Testing
SQL Performance Analyzer
Database Replay
Real Application Testing
Goal:
Record and replay a real workload to see how a system performs
Platform independent
Find regressions and changing plans before the upgrade
Do consistent performance evaluations upon application changes
Licensable database pack "Real Application Testing"
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 429
= Available since Oracle Database 11.1.0.6
= Available also with patch sets Oracle Database 10.2.0.4/5
Consists of:
Database Replay
DBMS_WORKLOAD_CAPTURE and DBMS_WORKLOAD_REPLAY
SQL Performance Analyzer
DBMS_SPA
Replay actual production database workload in test environment
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
Database Replay
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 430
Move the captured workload to test system
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
Database Replay: Supported Changes
Changes
Unsupported
Changes Supported
Client Client

Client
Middle Tier
Use a tool such as Oracle
Application Testing Suite
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 431
Changes Supported
Database Upgrades, Patches
Schema, Parameters
RAC nodes, Interconnect
OS Platforms, OS Upgrades
CPU, Memory
Storage
Etc.
Storage
Recording of
External Client
Requests
Shared Server support from Oracle Database Release 11.2
Step 1: Workload Capture
Production System
File System
Client Client

Client
Middle Tier
All external client requests
captured in binary files
System background and internal
activity excluded
Minimal overhead
Avoids function call when possible
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 432
File 1
File 2
File n

Storage
Buffered I/O
Independent of client protocol
Can capture on 9.2.0.8 and replay
on 11g
Capture load for interesting time
period, e.g., peak workload,
month-end processing, etc.
Step 2: Process Workload Files
File 1
File 2

Test System
Setup test system
Application data should be same
as production 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.
File 1
File 2
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 433
File n

Metadata
Replay Files
platforms, etc.
Processing transforms captured
data into replayable format
Once processed, workload can be
replayed many times
For RAC copy all capture files to
single location for processing
File n

Capture Files
File 1
File 2
Replay Clients

Step 3: Replay Workload


Replay captured workload
Replayed operations see
the same data and
perform the same work
Preserve timing and
concurrency
characteristics
Same number of user
Timing Preservation Timing Preservation
Re-mapping
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 434
File 2

File N
Metadata
Replay Files
Server Server Server
Same number of user
connections
Replay Client
Multithreaded OCI Client
Drives multiple captured
processes
Scalable Architecture
Interprets capture into
sequence of OCI calls
Functional replay
Background
Commit Order Synchronization
Sequence Replay
Step 4: Analysis & Reporting
Error Divergence: For each call error divergence is reported
New: Error encountered during replay not seen during capture
Not Found: Error encountered during capture not seen during
replay
Mutated: Different error produced in replay than during capture
Data Divergence
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 435
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
Consolidated Database Replays
Allows workload
captured on
different databases
to be consolidated
for replay
Works for
Validating consolidation strategies
SALES
HR
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 436
Works for
manually
consolidated
databases or
Pluggable
Databases
ERP
CRM
SQL Performance Analyzer
Production
Test
Clients/
Middle Tier
Oracle
No clients/middle tier necessary
SQL Performance Analyzer - Overview
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 437
Capture SQLs
Oracle
Database
Transport SQLs
Re-execute SQLs
SPA in Enterprise Manager 12c
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 438
SPA for upgrades from 10g/11g
Setup
Upgrade
R2
10.2.0.3
11.2.0.3
STS
Evaluate, compare and tune
over and over again!
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 439
SQL Performance Analyzer
STS
Capture SQLs
into a STS
Load STS
over and over again!
Resulting Reports
Example: Report showing regressed statements and plans
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 440
Performance Checklist
Prepare
Plan Stability
- Adjust maintenance windows
- Configure statistics retention
- Configure incremental statistics
- Adjust memory and optimizer parameters
- Configure AWR, ASH and ADDM
- Preserve and transport execution plans
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 441
Test Performance
Optimize
Performance
- SQL Performance Analyzer
- Database Replay
O Performance New Features
Enable Features
O System Statistics
O Automatic Tuning Advisor
Gather Workload Statistics
Gather system statistics during a regular workload period
otherwise inappropriate values for the CBO will be used:
SQL> select pname NAME, pval1 VALUE, pval2 INFO
from aux_stats$;
SQL> select pname NAME, pval1 VALUE, pval2 INFO
from aux_stats$;
SQL> EXECUTE dbms_stats.gather_system_stats('start');
<< Run it for several hours on a workload does not generate overhead!!! >>
SQL> EXECUTE dbms_stats.gather_system_stats('stop');
SQL> EXECUTE dbms_stats.gather_system_stats('start');
<< Run it for several hours on a workload does not generate overhead!!! >>
SQL> EXECUTE dbms_stats.gather_system_stats('stop');
Best Practice

Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 442
from aux_stats$;
NAME VALUE INFO
-------------------- ---------- ------------------------------
STATUS COMPLETED
DSTART 04-03-2011 12:30
DSTOP 05-03-2011 12:30
FLAGS 1
CPUSPEEDNW 2498,65
IOSEEKTIM 11,405
IOTFRSPEED 25595,605
...
from aux_stats$;
NAME VALUE INFO
-------------------- ---------- ------------------------------
STATUS COMPLETED
DSTART 04-03-2011 12:30
DSTOP 05-03-2011 12:30
FLAGS 1
CPUSPEEDNW 2498,65
IOSEEKTIM 11,405
IOTFRSPEED 25595,605
...
Gather Workload Statistics
Calibrate I/O (Orion): Example
SET SERVEROUTPUT ON
DECLARE lat INTEGER;
iops INTEGER;
mbps INTEGER;
BEGIN
DBMS_RESOURCE_MANAGER.CALIBRATE_IO (28, 10, iops, mbps, lat);
DBMS_OUTPUT.PUT_LINE ('max_iops = ' || iops);
DBMS_OUTPUT.PUT_LINE ('latency = ' || lat);
DBMS_OUTPUT.PUT_LINE ('max_mbps = ' || mbps);
SET SERVEROUTPUT ON
DECLARE lat INTEGER;
iops INTEGER;
mbps INTEGER;
BEGIN
DBMS_RESOURCE_MANAGER.CALIBRATE_IO (28, 10, iops, mbps, lat);
DBMS_OUTPUT.PUT_LINE ('max_iops = ' || iops);
DBMS_OUTPUT.PUT_LINE ('latency = ' || lat);
DBMS_OUTPUT.PUT_LINE ('max_mbps = ' || mbps);
INFO INFO

Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 443
This is a requirement for AUTODOP (automatic degree of parallelism in 11.2.0.2) in
addition PARALLEL_DEGREE_POLICY must be set to AUTO
Delete system stats and revert to the default values:
end;
/
end;
/
SQL> EXECUTE dbms_stats.delete_system_stats; SQL> EXECUTE dbms_stats.delete_system_stats;
Workload Stats: Further Information
See the Performance Tuning Guide for all stats:
http://download.oracle.com/docs/cd/E11882_01/server.112/e16638/stats.htm#PFGRF94743
See also:
13.4.1.2 Multiblock Read Count
If you gather workload statistics, then the mbrc value gathered as part of the
workload statistics is used to estimate the cost of a full table scan. However,
during the gathering process of workload statistics, Oracle Database may
not gather the mbrc and mreadtim values if no table scans are performed
during serial workloads, as is often the case with OLTP systems. However,
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 444
during serial workloads, as is often the case with OLTP systems. However,
full table scans occur frequently on DSS systems but may run parallel and
bypass the buffer cache. In such cases, Oracle Database still gathers the
sreadtim value because the database performs index lookup using the
buffer cache.
If Oracle Database cannot gather or validate gathered mbrc or mreadtim
values, but has gathered sreadtim and cpuspeed values, then the
database uses only the sreadtim and cpuspeed values for costing. In this
case, the optimizer uses the value of the initialization parameter
DB_FILE_MULTIBLOCK_READ_COUNT to cost a full table scan.
However, if DB_FILE_MULTIBLOCK_READ_COUNT is not set or is set to 0
(zero), then the optimizer uses a value of 8 for costing.
Post Upgrade: Fixed Table Stats
Create fixed table statistics some days after the upgrade
has been completed:
Fixed objects (X$ tables) are usually undocumented and they are
not tagged by the Automatic Statistics Gathering job
Findings:
MMON may cause too much CPU load if fixed objects stats
Best Practice

SQL> exec DBMS_STATS.GATHER_FIXED_OBJECTS_STATS; SQL> exec DBMS_STATS.GATHER_FIXED_OBJECTS_STATS;


Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 445
MMON may cause too much CPU load if fixed objects stats
haven't been generated
Internal recursive queries perform better
Guidelines
Create fixed table statistics a week after upgrade
Gather fixed table statistics during a representative workload period
This task should be done only a few times per year
Parameter Information
OPTIMIZER_IGNORE_HINTS
Values: TRUE | FALSE
SQL hints that worked in one release may not work in another
Test all SQL statements with hints on the new release using the
parameter
Chances are high that SQL statements will perform better
without any hints
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 446
without any hints
Parameter Information
OPTIMIZER_USE_INVISIBLE_INDEXES
Values: TRUE | FALSE
Background:
With modern IO systems full table scans might be more efficient
than index lookups but dropping and recreating an index is
expensive. By making an index invisible to the optimizer the effect
on query performance can be detected before it affects production
users. This is extremely beneficial in an Exadata environment.
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 447
users. This is extremely beneficial in an Exadata environment.
Example:
ALTER INDEX idx_ename ON emp(ename)
INVISIBLE;
ALTER SESSION SET
OPTIMIZER_USE_INVISIBLE_INDEXES=TRUE;
ALTER INDEX idx_ename ON emp(ename)
INVISIBLE;
ALTER SESSION SET
OPTIMIZER_USE_INVISIBLE_INDEXES=TRUE;
Parameter Information
CELL_OFFLOAD_PLAN_DISPLAY
Values: TRUE | FALSE
Background:
Will display you potential savings with a cell storage
STORAGE indicates which parts of the query could be offloaded to
the storage cells using smart scan
Example:
------------------------------------------- -------------------------------------------
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 448
Example:
-------------------------------------------
| Id | Operation | Name |
-------------------------------------------
| 0 | SELECT STATEMENT | |
| *1 | HASH JOIN | |
| *2 | HASH JOIN | |
| *3 | TABLE ACCESS STORAGE FULL | SALES |
| *4 | TABLE ACCESS STORAGE FULL | SALES |
| *5 | TABLE ACCESS STORAGE FULL | SALES |
-------------------------------------------
| Id | Operation | Name |
-------------------------------------------
| 0 | SELECT STATEMENT | |
| *1 | HASH JOIN | |
| *2 | HASH JOIN | |
| *3 | TABLE ACCESS STORAGE FULL | SALES |
| *4 | TABLE ACCESS STORAGE FULL | SALES |
| *5 | TABLE ACCESS STORAGE FULL | SALES |
SQL Real-Time Monitoring
Dedicated statistics collected for a single execution of a
SQL statement when its execution becomes high-load
Target:
Parallel queries, parallel DML or parallel DDL
Execution that exceeds 5 sec of CPU or I/O time
Global SQL level statistics are collected: V$SQL_MONITOR
Plan level statistics are collected (#rows, memory, temp space,
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 449
Plan level statistics are collected (#rows, memory, temp space,
start/end date): V$SQL_PLAN_MONITOR
Statistics are updated quasi real-time while the query executes
Statistics for completed executions are retained for at least 5
minutes
Feature switched on by default
Part of Tuning Pack
Note:1229904.1: Real-Time SQL Monitoring in 11g
SQL Real-Time Monitoring Report
DBMS_SQLTUNE.REPORT_SQL_MONITOR() allows to
display monitoring information
Format: xml, text and html
Join with ASH data
SQL Real-time monitoring with GUI integrated since 11.1.0.7
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 450
O
O
O
SQL Real-Time Monitoring Example
DB Time signals a possible performance issue
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 451
SQL Real-Time Monitoring Example
TOP ACTIVITY page confirms a problem with highly
skewed DB Time by SQLID
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 452
SQL Real-Time Monitoring Example
SQLID shows parallel execution
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 453
SQL Real-Time Monitoring Example
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 454
Manual SQL Tuning Challenges
Complex - requires expertise in several domains
SQL optimization: adjust the execution plan
Access design: provide fast data access
SQL design: use appropriate SQL constructs
Application design: what is the application trying to do?
Time consuming
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 455
Time consuming
Each SQL statement is unique
Potentially large number of statements to tune
Never ending task
SQL workload always evolving
Plan changes due to data changes, system changes,
Manual vs Automatic SQL Tuning
Manual SQL Tuning is complex, time consuming and a
neverending task
SQL Tuning Advisor and SQL Access Advisor act like
tuning experts
Automatic SQL Tuning advisor even selects tuning
candidates
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 456
SQL Access and SQL Tuning Advisors
SQL Access Advisor:
Requires a workload (many statements)
Potential recommendations:
Indexes
Materialized Views
Indexes on Materialized Views
Partitioning Advisor
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 457
Partitioning Advisor
SQL Tuning Advisor
Can operate on a single SQL statement
Optimizer in Comprehensive Tuning Mode
Potential recommendations:
SQL Profiles
Indexes
SQL Tuning Advisor
Can be used in EM or on CLI (via DBMS_SQLTUNE)
Part of Tuning Pack since Oracle 10g
SQL Profiles contain information that lead to improved
execution plans without changing the application code
Use different optimizer settings
Correct wrong/missing statistics and wrong estimates
SQL Profiles dont change the original SQL statement
SQL Profiles are persistent
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 458
SQL Profiles are persistent
SQL Profiles can be transported within SQL Tuning Sets (STS)
See Note:751068.1 for an example
SQL Profiles can be tested and verified without any risk
SQL Tuning
Example: Results of SQL Tuning Advisor SQL Profile
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 459
O
O
SQL Tuning
Example: Compare original to new explain plan
O
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 460
O
SQL Tuning with DBMS_SQLTUNE
4 steps to get an SQL Profile
DBMS_SQLTUNE.CREATE_TUNING_TASK
DBMS_SQLTUNE.EXECUTE_TUNING_TASK
DBMS_SQLTUNE.REPORT_TUNING_TASK
DBMS_SQLTUNE.ACCEPT_SQL_PROFILE
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 461
SQL Tuning - DBMS_SQLTUNE
Tuning Task Management SQL Profile Management
o CANCEL_TUNING_TASK
o CREATE_TUNING_TASK
o DROP_TUNING_TASK
o EXECUTE_TUNING_TASK
o IMPLEMENT_TUNING_TASK
o INTERRUPT_TUNING_TASK
o REPORT_AUTO_TUNING_TASK
o REPORT_TUNING_TASK
o RESUME_TUNING_TASK
o SCRIPT_TUNING_TASK
o CANCEL_TUNING_TASK
o CREATE_TUNING_TASK
o DROP_TUNING_TASK
o EXECUTE_TUNING_TASK
o IMPLEMENT_TUNING_TASK
o INTERRUPT_TUNING_TASK
o REPORT_AUTO_TUNING_TASK
o REPORT_TUNING_TASK
o RESUME_TUNING_TASK
o SCRIPT_TUNING_TASK
o ACCEPT_SQL_PROFILE
o ALTER_SQL_PROFILE
o DROP_SQL_PROFILE
o ACCEPT_SQL_PROFILE
o ALTER_SQL_PROFILE
o DROP_SQL_PROFILE
o CAPTURE_CURSOR_CACHE_SQLSET
o SELECT_CURSOR_CACHE
o REPORT_SQL_MONITOR
o SELECT_WORKLOAD_REPOSITORY
o CAPTURE_CURSOR_CACHE_SQLSET
o SELECT_CURSOR_CACHE
o REPORT_SQL_MONITOR
o SELECT_WORKLOAD_REPOSITORY
Select SQL Statements
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 462
SQL Tuning Set Management
o SCRIPT_TUNING_TASK
o RESET_TUNING_TASK
o SET_TUNING_TASK_PARAMETER
o SCRIPT_TUNING_TASK
o RESET_TUNING_TASK
o SET_TUNING_TASK_PARAMETER
o ADD_SQLSET_REFERENCE
o CREATE_SQLSET
o DELETE_SQLSET
o DROP_SQLSET
o LOAD_SQLSET
o REMOVE_SQLSET_REFERENCE
o SELECT_SQLSET
o UPDATE_SQLSET
o ADD_SQLSET_REFERENCE
o CREATE_SQLSET
o DELETE_SQLSET
o DROP_SQLSET
o LOAD_SQLSET
o REMOVE_SQLSET_REFERENCE
o SELECT_SQLSET
o UPDATE_SQLSET
o SELECT_WORKLOAD_REPOSITORY
o SQLTEXT_TO_SIGNATURE
o SELECT_WORKLOAD_REPOSITORY
o SQLTEXT_TO_SIGNATURE
o CREATE_STGTAB_SQLPROF
o CREATE_STGTAB_SQLSET
o PACK_STGTAB_SQLPROF
o PACK_STGTAB_SQLSET
o REMAP_STGTAB_SQLPROF
o REMAP_STGTAB_SQLSET
o UNPACK_STGTAB_SQLPROF
o UNPACK_STGTAB_SQLSET
o CREATE_STGTAB_SQLPROF
o CREATE_STGTAB_SQLSET
o PACK_STGTAB_SQLPROF
o PACK_STGTAB_SQLSET
o REMAP_STGTAB_SQLPROF
o REMAP_STGTAB_SQLSET
o UNPACK_STGTAB_SQLPROF
o UNPACK_STGTAB_SQLSET
Staging Table Management
SQL Tuning Task Command Line Example
exec DBMS_SQLTUNE.DROP_TUNING_TASK('my_tuning_task');
DECLARE
my_task_name VARCHAR2(30);
my_sqltext CLOB;
BEGIN
my_sqltext := q'!<your SQL - concatenate lines with ||>!';
my_task_name := DBMS_SQLTUNE.CREATE_TUNING_TASK(sql_text => my_sqltext,
user_name => XY,scope => 'COMPREHENSIVE',time_limit => 60,
task_name => 'my_tuning_task', description => 'test');
END;
/
exec DBMS_SQLTUNE.DROP_TUNING_TASK('my_tuning_task');
DECLARE
my_task_name VARCHAR2(30);
my_sqltext CLOB;
BEGIN
my_sqltext := q'!<your SQL - concatenate lines with ||>!';
my_task_name := DBMS_SQLTUNE.CREATE_TUNING_TASK(sql_text => my_sqltext,
user_name => XY,scope => 'COMPREHENSIVE',time_limit => 60,
task_name => 'my_tuning_task', description => 'test');
END;
/
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 463
/
exec DBMS_SQLTUNE.EXECUTE_TUNING_TASK( task_name => 'my_tuning_task' );
SELECT sofar, totalwork FROM V$ADVISOR_PROGRESS WHERE task_id =
(SELECT task_id FROM USER_ADVISOR_TASKS WHERE task_name='my_tuning_task');
SET LONG 100000
SET LONGCHUNKSIZE 100000
SET LINESIZE 10000
SET PAGESIZE 10000
SELECT DBMS_SQLTUNE.REPORT_TUNING_TASK( 'my_tuning_task') FROM DUAL;
/
exec DBMS_SQLTUNE.EXECUTE_TUNING_TASK( task_name => 'my_tuning_task' );
SELECT sofar, totalwork FROM V$ADVISOR_PROGRESS WHERE task_id =
(SELECT task_id FROM USER_ADVISOR_TASKS WHERE task_name='my_tuning_task');
SET LONG 100000
SET LONGCHUNKSIZE 100000
SET LINESIZE 10000
SET PAGESIZE 10000
SELECT DBMS_SQLTUNE.REPORT_TUNING_TASK( 'my_tuning_task') FROM DUAL;
SQL Profile containing literals - not binds
SQL Profiles can handle statements containing literals
(instead of binds) as well:
Since 11.1.0.6 possible in EM:
In 10.2 only possible on command line:
exec exec
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 464
SQL> select name, status, force_matching, sql_text
from dba_sql_profiles;
NAME STATUS FOR SQL_TEXT
------- -------- ---- --------------------------------------------
MY_PROF ENABLED YES select /*+ use_nl(c) ordered */ count(*)
from sh.sales s, sh.customers c
where c.cust_id = s.cust_id
and CUST_FIRST_NAME = 'Mike'
exec
:p_name:=dbms_sqltune.accept_sql_profile
(task_name=>'XT',name=>'XT_PROFILE', FORCE_MATCH=>TRUE);
exec
:p_name:=dbms_sqltune.accept_sql_profile
(task_name=>'XT',name=>'XT_PROFILE', FORCE_MATCH=>TRUE);
SQL Profile - evaluation
SQL Profiles should be evaluated before making them
available to every user:
exec
:p_name:=dbms_sqltune.accept_sql_profile
task_name=>'XT',name=>'XT_PROFILE',
category=>'TEST_ENV', FORCE_MATCH=>TRUE)
exec
:p_name:=dbms_sqltune.accept_sql_profile
task_name=>'XT',name=>'XT_PROFILE',
category=>'TEST_ENV', FORCE_MATCH=>TRUE)
alter session set SQLTUNE_CATEGORY='TEST_ENV'; alter session set SQLTUNE_CATEGORY='TEST_ENV';
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 465
Now evaluate the statement's profile in a limited user context
If verification went fine, make it accessible to everybody
alter session set SQLTUNE_CATEGORY='TEST_ENV'; alter session set SQLTUNE_CATEGORY='TEST_ENV';
exec
dbms_sqltune.alter_sql_profile
(name=>'XT_PROFILE',
attribute_name=>'CATEGORY',value=>'DEFAULT')
exec
dbms_sqltune.alter_sql_profile
(name=>'XT_PROFILE',
attribute_name=>'CATEGORY',value=>'DEFAULT')
SQL Tuning Automation in 11g
Fully automatic SQL Tuning task
Runs automatically in the Maintenance Window
Identifies, ranks and tunes candidate SQL
Leverages SQL Tuning Advisor
Candidate high-load SQL automatically chosen by ADDM
Excluded: parallel queries, DML/DDL, recursive, ad-hoc (infrequent)
Tests and (optionally) implements SQL profiles
Only implements significantly improved plans (3x)
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 466
Only implements significantly improved plans (3x)
Time budgeted to avoid run-away plans
New PL/SQL Package: DBMS_AUTO_SQLTUNE
SQL Tuning Automation in 11g
Configure Automatic SQL Tuning
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 467
SQL Tuning Automation in 11g
Workload
Test SQL Profiles
Implement
SQL Profiles
Generate
Recommendations
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 468
Its Automatic!
Choose
Candidate
SQL
one
week
SQL Tuning
Candidates
AWR
DBA
View Reports /
Control
Process
Real World Checkpoint
The Customer:
Deutsche Messe AG
HQ in Hannover, Germany
Largest trade fair worldwide
Key trade fairs:
CeBIT
Hannover Messe
Customer
Project
Constraints
Preparation
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 469
Hannover Messe
~1,000,000 m exhibition space
Upgrade
Success?
Remarks
Preparation
Deutsche Messe
Project scope:
Upgrade of a 3-node Oracle 10.2.0.3 RAC Cluster
to Oracle 11.1.0.7
Move from raw devices to ASM
Use Snapshot Standby instead of RMAN to refresh
development databases
Tune third-party application with Automatic SQL
Customer
Project
Constraints
Preparation
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 470
Tune third-party application with Automatic SQL
Tuning
Sun Solaris 10
Initially 2 databases to upgrade (each ~350GB):
CeBIT system
Online ordering web application
Upgrade
Success?
Remarks
Preparation
Deutsche Messe
Constraints:
Keep the old hardware
The "worst" application ever ...
Customer
Project
Constraints
Preparation
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 471
Upgrade
Success?
Remarks
Preparation
Deutsche Messe
Performance:
AWR snapshots
Automatic SQL Tuning showed excellent results
Real Application Testing (Database Replay) done
during high-load phase during CeBIT 2009
Customer
Project
Constraints
Preparation
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 472
Upgrade
Success?
Remarks
Preparation
Deutsche Messe
Upgrade
Data Pump used for upgrade, consolidation and
reorganization
Everything went well ... until ...
Right at the end of impdp run the cluster node went
down and was restarted
Reason: EM Agent was going amok and requested all
Customer
Project
Constraints
Preparation
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 473
Reason: EM Agent was going amok and requested all
available RAM and swap until Clusterware cleaned up
the situation by a restart
Remedy: Upgrade the agents to the version
matching your Grid Control !!!
Upgrade
Success?
Remarks
Preparation
Deutsche Messe
Live? And alive?
Yes! Go-live in September and October 2009
But highest load to be expected in March 2010
(CeBIT!!)
Overall downtime: 4 hrs
Application is faster than ever
Customer kept 3 year old hardware
Customer
Project
Constraints
Preparation
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 474
Customer kept 3 year old hardware
All SAP systems recently upgraded to 11.2.0.2
More information: OOW 2010 presentation and Success Story
http://apex.oracle.com/pls/apex/f?p=202202:2:::::P2_SUCHWORT:messe
http://www.oracle.com/us/corporate/customers/deutsche-messe-1-db-
snapshot-367194.pdf
Upgrade
Success?
Remarks
Preparation
Deutsche Messe
"Heal" a terrible application
Customer
Project
Constraints
Preparation
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 475
Upgrade
Success?
Remarks
Preparation
Improvement factor:
~250,000x !!!
Improvement factor:
~250,000x !!!
Performance Checklist
Prepare
Plan Stability
- Adjust maintenance windows
- Configure statistics retention
- Configure incremental statistics
- Adjust memory and optimizer parameters
- Configure AWR, ASH and ADDM
- Preserve and transport execution plans
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 476
Test Performance
Optimize
Performance
- SQL Performance Analyzer
- Database Replay
O Performance New Features
Enable Features
- System Statistics
- Automatic Tuning Advisor
AUTODOP Degree of Parallelism
Feature Automatic Degree of Parallelism was introduced in
Oracle 11.2.0.2
Requires I/O calibration (Orion):
SET SERVEROUTPUT ON
DECLARE lat INTEGER;
iops INTEGER;
mbps INTEGER;
BEGIN
DBMS_RESOURCE_MANAGER.CALIBRATE_IO (84, 10, iops, mbps, lat);
SET SERVEROUTPUT ON
DECLARE lat INTEGER;
iops INTEGER;
mbps INTEGER;
BEGIN
DBMS_RESOURCE_MANAGER.CALIBRATE_IO (84, 10, iops, mbps, lat);
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 477
Enabled by setting init parameter:
DBMS_RESOURCE_MANAGER.CALIBRATE_IO (84, 10, iops, mbps, lat);
DBMS_OUTPUT.PUT_LINE ('max_iops = ' || iops);
DBMS_OUTPUT.PUT_LINE ('latency = ' || lat);
DBMS_OUTPUT.PUT_LINE ('max_mbps = ' || mbps);
end;
/
SELECT * FROM DBA_RSRC_IO_CALIBRATE;
DBMS_RESOURCE_MANAGER.CALIBRATE_IO (84, 10, iops, mbps, lat);
DBMS_OUTPUT.PUT_LINE ('max_iops = ' || iops);
DBMS_OUTPUT.PUT_LINE ('latency = ' || lat);
DBMS_OUTPUT.PUT_LINE ('max_mbps = ' || mbps);
end;
/
SELECT * FROM DBA_RSRC_IO_CALIBRATE;
SQL> ALTER SESSION SET PARALLEL_DEGREE_POLICY=AUTO; SQL> ALTER SESSION SET PARALLEL_DEGREE_POLICY=AUTO;
Automated Degree of Parallelism
How it works
SQL
statement
Statement is hard parsed
And optimizer determines the
execution plan
Optimizer determines
ideal DOP
If estimated time greater
than threshold
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 478
Statement
executes serially
Statement executes
in parallel
Actual DOP = MIN(default DOP, ideal DOP)
If estimated time less
than threshold
PARALLEL_MIN_TIME_THRESHOLD
Adaptive Cursor Sharing
Adaptive cursor sharing introduced in 11g
Common problem:
When bind variables are used, the initial plan can be
suboptimal due to the fact that
Future values used in future executions share the initial plan
The first set of binds used may not be representative of the
majority of executions
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 479
For explanation and examples see Note:740052.1 and
Note:836256.1
This feature monitors the execution statistics for
candidates queries and makes it possible for
the same query to generate and use different execution
plans for different set of binds values
Parameter: _optimizer_adaptive_cursor_sharing=FALSE|TRUE
PL/SQL Native Compilation
Previous versions of Oracle required a directory object, an
external compiler license for each deployment system, and
many parameters to use PL/SQL native compilation
Since Oracle 11g: Easier, Cheaper, Faster
No directory object needed: compiled library resides in database
No external compiler required no extra license costs!
Can speed up PL/SQL performance (results may vary)
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 480
Can speed up PL/SQL performance (results may vary)
Just two PL/SQL native compilation parameters to set:
plsql_code_type=native
plsql_optimize_level=3
Then recompile the schemas:
SQL> exec DBMS_UTILITY.COMPILE_SCHEMA('<username>');
Conclusion:
Native compilation lead to a slightly better overall completion timing
SecureFiles
SecureFiles = new LOB storage technology
Better performance
Additional features: deduplication, encryption
Examples:
CREATE TABLE t1 (a CLOB) LOB(a) STORE AS SECUREFILE;
CREATE TABLE t2 (a CLOB) LOB(a) STORE AS SECUREFILE
(DEDUPLICATE);
CREATE TABLE t1 (a CLOB) LOB(a) STORE AS SECUREFILE;
CREATE TABLE t2 (a CLOB) LOB(a) STORE AS SECUREFILE
(DEDUPLICATE);
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 481
Tablespace must be ASSM managed
Initialization parameter:
(DEDUPLICATE);
CREATE TABLE t3 (a CLOB ENCRYPT USING 'AES128')
LOB(a) STORE AS SECUREFILE (CACHE);
(DEDUPLICATE);
CREATE TABLE t3 (a CLOB ENCRYPT USING 'AES128')
LOB(a) STORE AS SECUREFILE (CACHE);
DB_SECUREFILE = [NEVER | PERMITTED | ALWAYS | IGNORE]
CREATE TABLE t1 (a CLOB); -- this will be a Securefile!!!
DB_SECUREFILE = [NEVER | PERMITTED | ALWAYS | IGNORE]
CREATE TABLE t1 (a CLOB); -- this will be a Securefile!!!
LONG/LOB = == = SecureFile Conversion
LONG and BasicFiles LOB data types are still supported
But they have many limitations (size, performance, operations)
Recommendation: Move to SecureFiles
Data Pump Import with TRANSFORM=LOB_STORAGE:SECUREFILE
Use Online Redefinition with DBMS_REDEFINITION
For conversion examples see:
Note:728758.1 How to online convert from BasicFiles to SecureFiles
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 482
Note:728758.1 How to online convert from BasicFiles to SecureFiles
Advantage: Source table is available during the whole process
SecureFiles are fully transparent to applications!
Data type still a BLOB/CLOB
No functional differences
API access via PL/SQL (DBMS_LOB), JDBC, .NET, PHP
Reference:
Wellcome Trust Sanger Institute - >1000 TB Database
Compression
Index compression available since 8i
Table compression available since 9.2
Designated for DWH
Direct path and bulk INSERTs, CREATE TABLE .. AS SELECT
Didn't work for INSERT/UPDATE/DELETE
Before 11g syntax:
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 483
New 11g syntax:
BASIC has superseded the clause FOR DIRECT_LOAD OPERATIONS in 11.2
In 12c, change compression while migrating
Data Pump import TRANSFORM=TABLE_COMPRESSION_CLAUSE:<clause>
CREATE TABLE sales_history COMPRESS CREATE TABLE sales_history COMPRESS
CREATE TABLE sales_history CREATE TABLE sales_history
COMPRESS BASIC
Advanced Compression
Advanced Compression since Oracle 11g works for:
All types of data
Backup New RMAN compression algorithm
Data Pump exports
Data Guard gap resolution and LGWR ASYNC transport
Reduces resource requirements and costs!!!
Storage
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 484
Storage
Performance
Typically 2x to 4x compression possible
DML
uncompressed
PCTFREE
reached:
Compression!
Further DML
uncompressed
PCTFREE
reached:
Compression!
Overhead
Free Space
uncompressed
compressed
Advanced Compression
http://www.oracle.com/technetwork/database/focus-
areas/storage/advanced-compression-whitepaper-130502.pdf
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 485
Advanced Compression
Compression Advisor
DBMS_COMPRESSION since Oracle 11.2
Download for earlier releases:
http://www.oracle.com/technetwork/database/options/compression/index.html
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 486
Hybrid Columnar Compression (HCC)
Available only on Exadata, ZFS and Pillar Axiom 600 Storage
WP: http://www.oracle.com/technetwork/middleware/bi-foundation/ehcc-twp-131254.pdf
No extra license required
For historical data getting VERY LITTLE changes
Compression ratio is very high
How it works:
Tables are organized into Compression Units (CUs)
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 487
Tables are organized into Compression Units (CUs)
CUs are larger than database blocks
Within Compression Units, data is organized by column instead of by row
Column organization brings similar values close together, enhancing compression
Compression Unit
10x to 15x
Reduction
Hybrid Columnar Compression (HCC)
Compression Units
Logical structure spanning multiple database blocks
Data organized by column during data load
Each column is compressed separately
All column data for a set of rows stored in compression unit
Logical Compression Unit
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 488
CU HEADER
BLOCK HEADER BLOCK HEADER BLOCK HEADER BLOCK HEADER
C3
C4
C1
C2
C7
C5
C6 C8
C8
Logical Compression Unit
General Preparation Steps
Upgrade & Migration Cases
Fallback Strategies
Introduction & Overview
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 489
Performance Management
Wrap Up
Fallback Strategies
New Features in Oracle 12c
Slides Download: blogs.oracle.com/UPGRADE
Scroll
down
to go
Scroll
down
to go
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 490
to the
slides
to the
slides
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 491
Copyright 2013, Oracle and/or its affiliates. All rights reserved. Upgrade, Migrate and Consolidate to Oracle Database 12c 492

Вам также может понравиться