Vous êtes sur la page 1sur 51

Minimal Downtime Migration

with Full Transportable Export/Import

Mike Dietrich
Master Product Manager
Database Upgrade
Oracle Corporation

Created: Aug 1, 2015


Copyright © 2015 Oracle and/or its affiliates. All rights reserved. | Minimal Downtime Migration with Full Transportable
$> whoami
6 years
RDBMS Core & Mission Critical Support

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)

Oracle 10.1 JAN 2009 JAN 2012


(GA: Jan 2004)

Oracle 10.2 JUL 2010 JUL 2013


(GA: Jul 2005)

Oracle 11.1 AUG 2012 AUG 2015


(GA: Aug 2007)

Oracle 11.2 JAN 2015 JAN 2018


(GA: Sep 2009)

Oracle 12.1 JUN 2018 JUN 2021


(GA: Jun 2013)

Premier Support Extended Support Waived Extended Sustaining Support

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."

Anja Albrecht, Rechenzentrum der Finanzverwaltung NRW

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

Interface Net Data Theoretical Real World


Volume Transfer Transfer Throughput
Throughput
100 Mbit Ethernet 11 MB/sec 40 GB/hour <30 GB/hour
1 Gbit Ethernet 110 MB/sec 400 GB/hour <300 GB/hour
10 Gbit Ethernet 1100 MB/sec 4000 GB/hour <3000 GB/hour
Infiniband IB 4xQDR 4000 MB/sec 14400 GB/hour <11000 GB/hour

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 …

 TTS feature available since Oracle 8i


 Cross platform support since Oracle 10g

Self Contained? Read Write


Read Only

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

Set all data Export Restore and


Generate
table- meta convert
CREATE
spaces tablespace datafile
scripts
Read-Only contents backups

Set all data Import meta Precreate


Execute tablespace
table- users in
CREATE contents +
spaces Plug in target
scripts
Read-Write Datafiles database

Copyright © 2015 Oracle and/or its affiliates. All rights reserved. | Minimal Downtime Migration with Full Transportable 16
Concept Transportable Tablespaces xTTS

 Cross platform support


– V$TRANSPORTABLE_PLATFORM
LITTLE ENDIAN PLATFORMS
HP IA Open VMS
HP Open VMS
RMAN BIG ENDIAN PLATFORMS
HP Tru64 UNIX
Linux IA (32-bit) Apple Mac OS
Linux IA (64-bit) CONVERT HP-UX (64-bit)
Linux x86 64-bit HP-UX IA (64-bit)
Microsoft Windows IA (64-bit) AIX-Based Systems (64-bit)
Microsoft Windows x86 64-bit FILE IBM zSeries Based Linux
Microsoft Windows IA (32-bit) FILE DBMS_FILE_
IBM Power Based Linux
TRANSFER
Solaris Operating System (x86) Solaris[tm] OE (32-bit)
Solaris Operating System (x86-64) COPY Solaris[tm] OE (64-bit)
COPY

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)

SOURCE Database 10.2.0.4 DESTINATION Database 11.2.0.4


VIEWS VIEWS

Read Only
SYSTEM CODE
SYSTEM CODE

SCOTT SYSAUX SCOTT SYSAUX


UNDO PRIVS UNDO PRIVS

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

– The “smart” approach


 DBMS_METADATA

SELECT DBMS_METADATA.GET_DDL('SYNONYM', SYNONYM_NAME,


OWNER) FROM all_synonyms where owner='PUBLIC' and
table_owner not in ('SYS');

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

SOURCE Database 10.2.0.5 DESTINATION Database 12.1.0.2


VIEWS Read Write VIEWS

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

SOURCE Database 11.2.0.3 DESTINATION Database 12.1.0.2


VIEWS VIEWS

Read Only
SYSTEM CODE SYSTEM CODE

SCOTT SYSAUX SCOTT SYSAUX


Data Pump
UNDO PRIVS UNDO PRIVS

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

Convert and apply


backups

SOURCE Database 11.2.0.3 DESTINATION Database 12.1.0.2


VIEWS VIEWS

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

 Create a new database or PDB

 Copy the datafiles or Restore/Merge Inc Backups

 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:

– Extract them to: /home/oracle/xtt

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

Copy xtt scripts including modified xtt.properties

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'

impdp FULL=Y TRANSPORTABLE=ALWAYS


Read Only
i
Database Link
Read Only

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

Vous aimerez peut-être aussi