Académique Documents
Professionnel Documents
Culture Documents
Mike Dietrich
Master Product Manager
Database Upgrade
Oracle Corporation
5.5 years
Technology Presales for DataGuard, Upgrades
Mike Dietrich
Master Product Manager
Database Upgrades & Migrations
>7 years
ST Upgrade Development Team
50% 50% + x%
Reference Workshops Development
Projects Worldwide Work
Copyright © 2015 Oracle and/or its affiliates. All rights reserved. | Minimal Downtime Migration with Full Transportable 2
Supported Versions today
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
Oracle 9.2 JAN 2007 JUL 2010
(GA: Jul 2002)
Copyright © 2015 Oracle and/or its affiliates. All rights reserved. | Minimal Downtime Migration with Full Transportable 3
Extended Support for Oracle Database 11.2
Copyright © 2015 Oracle and/or its affiliates. All rights reserved. | Minimal Downtime Migration with Full Transportable 4
Database Upgrade Blog
http://blogs.oracle.com/UPGRADE
Copyright © 2015 Oracle and/or its affiliates. All rights reserved. | Minimal Downtime Migration with Full Transportable 5
“At DVAG we do thorough testing in a 3-step
approach for our critical environments.
The decision to upgrade directly to Oracle
Database 12c skipping the terminal patch set of
the previous database release was taken in order
to save us one complete testing cycle, and
furthermore the accompanying costs as well"
– Michael Kuhn, Deutsche Vermögensberatung AG
Copyright © 2015 Oracle and/or its affiliates. All rights reserved. | Minimal Downtime Migration with Full Transportable 6
"The migration of all 16 German Electronic
Income Tax databases to Oracle Database 12c
in less than 10 months went smooth and fine.
We are very satisfied with the performance
and the robustness of Oracle Database 12c."
Copyright © 2015 Oracle and/or its affiliates. All rights reserved. | Minimal Downtime Migration with Full Transportable 7
http://www.oracle.com/technetwork/issue-archive/2015/15-may/o35diemobiliar-2541568.html
Copyright © 2015 Oracle and/or its affiliates. All rights reserved. | Minimal Downtime Migration with Full Transportable 8
Proper Preparation
The Road to Success
Copyright © 2015 Oracle and/or its affiliates. All rights reserved. | Minimal Downtime Migration with Full Transportable 9
Migration
Very large database
Cross platform with limited
amount of downtime
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | Minimal Downtime Migration with Full Transportable 10
Options
Migrate a large database
– Cross platform, cross Endianness
– With limited downtime
Realistic options
– Data Pump
– Transportable Tablespaces
– Full Transportable Export/Import
– Plus:
Oracle Golden Gate
Oracle Streams
RMAN Incremantal Rolled Forward Backups
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | What's new in Oracle Data Pump in Oracle Database 12c? 11
of +Terabyte Migrations get
25%
delayed or fail because of
insufficient network hardware,
setup or bandwidth
Copyright © 2015 Oracle and/or its affiliates. All rights reserved. | Minimal Downtime Migration with Full Transportable 12
Network Bandwidth
Copyright © 2015 Oracle and/or its affiliates. All rights reserved. | Minimal Downtime Migration with Full Transportable 13
Concept Transportable Tablespaces
impdp
expdp "'"sys/sys
"'"sys/sys as sysdba"'"…
as sysdba"'" …
TRANSPORT_DATAFILES=…
TRANSPORT_TABLESPACES=TS1,TS2 …
75TB 75TB
48 hrs
Oracle 10.2.0.4 Oracle 11.2.0.4
IBM AIX OL5.8 64bit
Copyright © 2015 Oracle and/or its affiliates. All rights reserved. | Minimal Downtime Migration with Full Transportable 14
Transportable Tablespaces Pros and Cons
Pro Con
– Potentially very fast – SYSTEM/SYSAUX can't be transported
Copying large files can be faster than – Complexity is your enemy
exporting & importing everything
Too many objects to rebuild
No need to rebuild indexes – Views, synonyms, sequences …
– Decrease copy/convert time by using – Simple is better for fast TTS!!!
RMAN Incremental Backups Too many objects in tablespaces
– Cross platform since Oracle 10g slow down meta expdp/impdp
– (Sub)partitions, partitioned indexes …
– Prooven solutions for EBS and other
apps available
Copyright © 2015 Oracle and/or its affiliates. All rights reserved. | Minimal Downtime Migration with Full Transportable 15
Workflow
Copyright © 2015 Oracle and/or its affiliates. All rights reserved. | Minimal Downtime Migration with Full Transportable 16
Concept Transportable Tablespaces xTTS
Copyright © 2015 Oracle and/or its affiliates. All rights reserved. | Minimal Downtime Migration with Full Transportable 17
Upgrade/Migration: Transportable Tablespaces
Rebuild meta information
(views, synonyms, trigger, roles etc)
Read Only
SYSTEM CODE
SYSTEM CODE
HUGO HUGO
TEMP TEMP
Copyright © 2015 Oracle and/or its affiliates. All rights reserved. | Minimal Downtime Migration with Full Transportable 19
Possible options
Moving meta information
– The “brute force” approach
Data Pump
expdp/impdp CONTENT=METADATA_ONLY
Copyright © 2015 Oracle and/or its affiliates. All rights reserved. | Minimal Downtime Migration with Full Transportable 20
The biggest pain points of TTS?
Copy and Convert a large database
Rebuild all the meta information
Copyright © 2015 Oracle and/or its affiliates. All rights reserved. | Minimal Downtime Migration with Full Transportable 22
TTS Pain Points
Copy and convert large databases Rebuilding all meta information
– Solution: – Solution:
RMAN Incremental Backups Full Transportable Export/Import
PERL scripts in MOS Note:1389592.1 and in Data Pump feature allows
MOS Note: 2005729.1 One Command Migration
Source: 10.2.0.3 or newer Source: 11.2.0.3 or newer
Target: 11.2.0.4 or newer Target: 12.1.0.1 or newer
Can be combined
Copyright © 2015 Oracle and/or its affiliates. All rights reserved. | Minimal Downtime Migration with Full Transportable 23
Pure Transportable Tablespace with Incremental Backups
impdp"'"sys/sys
expdp "'"sys/sysasassysdba"'"
sysdba"'"…
…
TRANSPORT_DATAFILES=…
TRANSPORT_TABLESPACES=TS1,TS2 …
Convert and apply
Downtime!!! backups
Read Only
SYSTEM CODE
SYSTEM
CODE
SYSAUX SYSAUX
SCOTT SCOTT
UNDO Data Pump UNDO
TEMP
PRIVS
TEMP PRIVS
HUGO HUGO
Copyright © 2015 Oracle and/or its affiliates. All rights reserved. | Minimal Downtime Migration with Full Transportable 24
Full Transportable Export/Import with Copies
Read Only
SYSTEM CODE SYSTEM CODE
HUGO HUGO
TEMP TEMP
Copyright © 2015 Oracle and/or its affiliates. All rights reserved. | Minimal Downtime Migration with Full Transportable 25
Full Transportable Export/Import with Backups
Read Only
SYSTEM CODE
SYSTEM
CODE
SYSAUX SYSAUX
SCOTT SCOTT
UNDO Data Pump UNDO
TEMP
PRIVS
TEMP PRIVS
HUGO HUGO
Copyright © 2015 Oracle and/or its affiliates. All rights reserved. | Minimal Downtime Migration with Full Transportable 26
Full Transportable Export/Import in 3 Steps
Data Pump
"One Command Migration"
Copyright © 2015 Oracle and/or its affiliates. All rights reserved. | Minimal Downtime Migration with Full Transportable | 27
Let's do it
Full Transportable Export/Import
with RMAN Incremental Rolled Foward Backup strategy
Copyright © 2015 Oracle and/or its affiliates. All rights reserved. | Minimal Downtime Migration with Full Transportable 28
Overview - Phases
Phase 1 - Initial Setup phase
Phase 2 - Prepare phase
Phase 3 - Roll Forward phase
Phase 4 - Final Incremental Backup
Phase 5 - Transport Phase: Import all Metadata
Phase 6 - Validate the Transported Tablespaces
Phase 7 - Cleanup
Copyright © 2015 Oracle and/or its affiliates. All rights reserved. | Minimal Downtime Migration with Full Transportable 29
Phase 1 - Initial Setup phase
Download the PERL scripts from MOS Note:1389592.1
– Key scripts:
Copyright © 2015 Oracle and/or its affiliates. All rights reserved. | Minimal Downtime Migration with Full Transportable 30
Phase 1 - Initial Setup phase
Choose the best method
– RMAN backup / convert – DBMS_FILE_TRANSFER
Faster Slower
Requires staging space for CONVERT Does not require staging space
xttdriver.pl -p and -c CONVERT happens implicitly
xttdriver.pl -S and -G
Backup Convert
Restore &
Convert
Staging
Copyright © 2015 Oracle and/or its affiliates. All rights reserved. | Minimal Downtime Migration with Full Transportable 31
Phase 1 - Initial Setup phase
Create a destination database
Oracle Database Default
– Oracle 11.2.0.4 or newer Time Zone
For Full Transportable Export/Import: Release Version
– SourceDB must be 11.2.0.3 or higher 10.2.0.3, 10.2.0.4, 10.2.0.5 DST V4
– DestDB must be 12.1.0.1 or higher
11.1.0.6 , 11.1.0.7 DST V4
– COMPATIBLE equal or higher 11.2.0.1 DST V11
– Identical database character sets 11.2.0.2 , 11.2.0.3, 11.2.0.4 DST V14
– Identical national characher sets 12.1.0.1, 12.1.0.2 DST V18
– Identical time zone version Most recent interim patch: DST V24
See MOS Note:412160.1
TZ can't be downgraded
Copyright © 2015 Oracle and/or its affiliates. All rights reserved. | Minimal Downtime Migration with Full Transportable 32
Phase 1 - Initial Setup phase
Indentify tablespaces to be transported
Configure:
xtt.properties ## Destination system file locations
## =================================
## Location where datafile copies are placed by the user
## Tablespaces to transport ## when they are transferred manually from souce system.
## ======================== stageondest=/oracle/DQ1/rman_stage
tablespaces=TS1,TS2
## storageondest
## Source database platform ID ## -------------
## =========================== ## Location where the converted datafile copies will be
platformid=13 ## written during the "-c conversion of datafiles" step.
## This is the final location of the datafiles
## Source system file locations ## where they will be used by the destination database.
## ============================ storageondest=/oracle/DQ1/sapdata50
## Location where datafile copies are created
## during the "-p prepare" step. ## backupondest
dfcopydir=/oracle/DQ1/rman_stage ## ------------
## Location where converted incremental backups
## backupformat ## on the destination system will be written during
## ------------ ## the "-r roll forward datafiles" step.
## Location where incremental backups are created. backupondest=/oracle/DQ1/rman_stage_incr
backupformat=/oracle/DQ1/rman_stage
Copyright © 2015 Oracle and/or its affiliates. All rights reserved. | Minimal Downtime Migration with Full Transportable 33
Phase 1 - Initial Setup phase
Copy all xtt-scripts to the destination host
Set TMPDIR=/home/oracle/xtt on both hosts
/home/oracle/xtt /home/oracle/xtt
Copyright © 2015 Oracle and/or its affiliates. All rights reserved. | Minimal Downtime Migration with Full Transportable 34
Phase 2 - Prepare phase
Create data file copies on source
– [oracle@source]$ $ORACLE_HOME/perl/bin/perl xttdriver.pl –p
– Creates the following files used later:
xttplan.txt
rmanconvert.cmd
Staging
Copyright © 2015 Oracle and/or its affiliates. All rights reserved. | Minimal Downtime Migration with Full Transportable 35
Phase 2 - Prepare phase
Transfer files to destination host
– Not necessary of your staging location is available to the destination host (NFS etc)
– xtt.properties: dfcopydir = stageondest
Staging
Copyright © 2015 Oracle and/or its affiliates. All rights reserved. | Minimal Downtime Migration with Full Transportable 36
Phase 2 - Prepare phase
Copy rmanconvert.cmd to destination
Convert the data file copies and write them to storageondest
– [oracle@dest]$ $ORACLE_HOME/perl/bin/perl xttdriver.pl –c
Copy /home/oracle/xtt
rmanconvert.cmd
C
Staging C
Copyright © 2015 Oracle and/or its affiliates. All rights reserved. | Minimal Downtime Migration with Full Transportable 37
Phase 3 - Roll Forward phase
Create incremental backups on source
– [oracle@source]$ $ORACLE_HOME/perl/bin/perl xttdriver.pl -i
– Creates the following files used later:
tsbkupmap.txt
incrbackups.txt [not necessary here due to NFS mount]
i
i
Staging
Copyright © 2015 Oracle and/or its affiliates. All rights reserved. | Minimal Downtime Migration with Full Transportable 38
Phase 3 - Roll Forward phase
Transfer incremental backups to destination host
– Not necessary of your staging location is available to the destination host (NFS etc)
– xtt.properties: backupformat= stageondest
i
i Staging
Copyright © 2015 Oracle and/or its affiliates. All rights reserved. | Minimal Downtime Migration with Full Transportable 39
Phase 3 - Roll Forward phase
Copy xttplan.txt and tsbkupmap.txt to destination
Convert the inc backups and merge it into tablespace files on storageondest
– [oracle@dest]$ $ORACLE_HOME/perl/bin/perl xttdriver.pl –r
xttplan.txt
Copy /home/oracle/xtt
tsbkupmap.txt
i
i
i
Staging i
Copyright © 2015 Oracle and/or its affiliates. All rights reserved. | Minimal Downtime Migration with Full Transportable 40
Phase 3 - Roll Forward phase
Record FROM_SCN on source for next incremental backup
– [oracle@source]$ $ORACLE_HOME/perl/bin/perl xttdriver.pl -s
– Writes it into xttplan.txt
SCN
xttplan.txt
Staging
Copyright © 2015 Oracle and/or its affiliates. All rights reserved. | Minimal Downtime Migration with Full Transportable 41
Phase 3 - Roll Forward phase
Repeat entire Phase 3 as often as necessary
– Increase of frequency will decrease file sizes
Staging
Copyright © 2015 Oracle and/or its affiliates. All rights reserved. | Minimal Downtime Migration with Full Transportable 42
Phase 4 - Final Incremental Backup
Set tablespaces read/only – Downtime!
– SQL:SOURCEDB> alter tablespace TS1 read only;
SQL:SOURCEDB> alter tablespace TS2 read only;
Read Only
Read Only
Staging
Copyright © 2015 Oracle and/or its affiliates. All rights reserved. | Minimal Downtime Migration with Full Transportable 43
Phase 4 - Final Incremental Backup
Create final incremental backup on source
– [oracle@source]$ $ORACLE_HOME/perl/bin/perl xttdriver.pl -i
i
i
Read Only
Read Only
Staging
Copyright © 2015 Oracle and/or its affiliates. All rights reserved. | Minimal Downtime Migration with Full Transportable 44
Phase 4 - Final Incremental Backup
Copy xttplan.txt and tsbkupmap.txt to destination
Convert final inc backups and merge it into tablespace files on storageondest
– [oracle@dest]$ $ORACLE_HOME/perl/bin/perl xttdriver.pl –r
xttplan.txt
Copy /home/oracle/xtt
tsbkupmap.txt
i
Read Only
i
i
Read Only
Staging i
Copyright © 2015 Oracle and/or its affiliates. All rights reserved. | Minimal Downtime Migration with Full Transportable 45
Phase 5 - Transport Phase: Import all Metadata
Prepare destination database for Full Transportable Export/Import
– SQL:DESTDB> CREATE DIRECTORY xyz_dir AS '/home/oracle/dp';
– SQL:DESTDB> GRANT READ, WRITE ON DIRECTORY xyz_dir TO mike;
– SQL:DESTDB> CREATE PUBLIC DATABASE LINK v112 USING 'v112';
Read Only
i
Database Link
Read Only
Copyright © 2015 Oracle and/or its affiliates. All rights reserved. | Minimal Downtime Migration with Full Transportable 46
Phase 5 - Transport Phase: Import all Metadata
Start Full Transportable Export/Import
– [oracle@dest]$ impdp mike/passwd NETWORK_LINK=v112
FULL=Y TRANSPORTABLE=ALWAYS [VERSION=12]
METRICS=Y EXCLUDE=STATISTICS
LOGTIME=ALL LOGFILE=xyz_dir:v112fullimp.log
TRANSPORT_DATAFILES='/oracle/DQ1/sapdata50/ts1.dbf'
TRANSPORT_DATAFILES='/oracle/DQ1/sapdata50/ts2.dbf'
Copyright © 2015 Oracle and/or its affiliates. All rights reserved. | Minimal Downtime Migration with Full Transportable 47
Phase 6 - Validate the Transported Tablespaces
Validate transported tablespaces
– RMAN> validate tablespace TS1, TS2 check logical;
Read Only
RMAN>
Read Only
Copyright © 2015 Oracle and/or its affiliates. All rights reserved. | Minimal Downtime Migration with Full Transportable 48
Phase 7 - Cleanup
Set tablespaces in source read/write
Cleanup all files created for this process
Cleanup staging area if not done already
Copyright © 2015 Oracle and/or its affiliates. All rights reserved. | Minimal Downtime Migration with Full Transportable 49
Yes, we made it
It looks a bit complicated at first sight but once you tried it, it is very straight forward
Copyright © 2015 Oracle and/or its affiliates. All rights reserved. | Minimal Downtime Migration with Full Transportable 50
Resources
Download slides from:
– http://blogs.oracle.com/UPGRADE
Copyright © 2015 Oracle and/or its affiliates. All rights reserved. | Minimal Downtime Migration with Full Transportable 51
Copyright © 2015 Oracle and/or its affiliates. All rights reserved. | Minimal Downtime Migration with Full Transportable 52