Professional Documents
Culture Documents
Prepared by:
Jim Czuprynski
OnX Enterprise Solutions
April 11, 2016
@JimTheWhyGuy
My Credentials
35+ years of database-centric IT
experience
Oracle DBA since 2001
Oracle 9i, 10g, 11g OCP
Oracle ACE Director
100+ articles on databasejournal.com
and ioug.org
Oracle-centric blog (Generally, It
Depends)
Regular speaker at Oracle OpenWorld,
IOUG COLLABORATE, and OTN ACE
Tours
Oracle University instructor core
Oracle DBA courses
Who We Are
>Solution Provider focused on
>Technology Solutions
>Comprehensive Service Offerings
>Extensive reach U.S., Canada, and
the U.K.
>$700M annual revenue with over
$100M in Services
>Industry Certifications across a
broad selection of best-in-class IT
manufacturers and technologies
>Significant investment in technical
3
Our Agenda
Migration Planning: Not a Trivial
Subject!
Migration Via Oracle GoldenGate
(OGG)
Piecemeal Migration and Conversion
Via Transportable Tablespace Sets
(TTS)
Pre-12c to 12c Database Migration
Techniques
Cross-Platform Transportable Tablespace
Sets (XTTS)
Fully Transportable Export/Import (FTE/I)
Cross-Platform Transfer (CPT)
Windows of Inopportunity
Reversibility, Repeatability, and the Rule of Three
Migratibility
Potential Migration Approaches
Data Warehouse?
Certainly if
scoped properly.
Air Traffic Control
System? (Please not
while Im travelling!)
Order Entry
System?
Likely if
handled
carefully.
6
Migratability
Does all application data have to move
simultaneously?
Older historical data can be staged for later
migration
A great time to consider new / revamped
partitioning schemes!
Migrating to 12c? Consider new ILM features!
Advantages
Drawbacks
Oracle GoldenGate
Piecemeal
Transportable
Tablespace Sets (TTS)
Migration
Supports endian
conversion, welldocumented, simple to
checklist
Cross-Platform
Transportable
Tablespace Sets
(XTTS)
Supports endian
conversion and most
11gR2 databases
forward
Cross-Platform
Transport
(CPT)
Full Transportable
Export/Import (FTE/I)
AP_DAT
A
AP_IDX
AP_CLO
B
Ora12102
AP_DAT
A
AP_IDX
AP_CLO
B
EXTRA
EXTRA
CT
CT
PUMP
PUMP
Networ
k
Trail
Trail
Files
Files
REPLIC
REPLIC
AT
AT
Trail
Trail
Files
Files
whichprocesses
PUMP
EXTRACT
processes
create
localconsume
trail files
and transmit
securely over
network to the
destination
and become
remote trail
files at the
destination
which REPLICAT
processes consume
and apply to the
destination.
Drawbacks:
Since its logical replication, it may take significantly longer to
process some types of transactions, especially when LOB data is
involved
Encrypting data transmission and trail files requires Advanced
Security option
Separately licensed software but term licensing may be available
11
Drawbacks:
Unexpected surprises during tablespace set migration discovery
are not uncommon so be sure to check once more before actual
migration
Scripted approach only requires careful attention via checklist!
See MOS #1457743.1, Upgrading a Database Using
Transportable Tablespaces
13
2
2
expdp system/******
B
A 1
Build
desired
tablespace
PARFILE=tts_10205.d
Make desired
TTS tablespaces
set(s)
pectl
Export
READ ONLY
DUMPFILE=tts_10205.d
RMAN> TRANSPORT
SQL>
ALTER TABLESPACE
ap_data
ap_data, metadata
mpTABLESPACE
READ
ONLY;
for desired
ap_idx,
ap_clob
LOGFILE=tts_10205.log
ALTER TABLESPACE ap_idx
TTS
TRANSPORT_TABLES
TABLESPACE
READ
ONLY;
DESTINATION
+FRA
PACE=Y
3
TABLESPACES=ap_da
AUXILIARY DESTINATION
Copy
ta,+FRA
datafiles
;
DBMS_FILE_TRA
& metadata
NSFER
dump set to
Ora12102 ARCHIVELOG ON destination
COMPATIBLE = 12.x
4
4
impdp
OPEN READ WRITE
B
AP_DAT
A
AP_IDX
AP_CLO
B
system/******
A5
5
If
desired,
bring all transported
Plug
TTS
RMAN>
CONVERT
PARFILE=tts_12102
If necessary,
DIRECTORY=DPDIR
TSPs
back into READ WRITE
mode
datafiles
DATAFILE
.dpictl
convert
DUMPFILE=tts_10205.dm
into to
<dfname>
FROM
SQL>
ALTER TABLESPACE
ap_data
datafiles
pPLATFORM
12.1.0.2
READ WRITE;
destinations
LOGFILE=tts_12102.log
database
<platform type>
endian-ness
TRANSPORT_DATAFILE
FORMAT
S=
<new_dfname>;
ap_data, ap_idx, ap_clob
16
XTTS: Prerequisites
# Create source database objects:
1
CREATE OR REPLACE DIRECTORY ora10g_dbf
AS '+DATA/ORA10G/DATAFILE';
GRANT READ, WRITE ON DIRECTORY ora10g_dbf TO PUBLIC;
CREATE OR REPLACE DIRECTORY xttsfiles
AS '/home/oracle/XTTSFILES';
GRANT READ, WRITE ON DIRECTORY xttsfiles TO PUBLIC;
# Create destination database objects:
CREATE PUBLIC DATABASE LINK ora10g
CONNECT TO system
IDENTIFIED BY R3alS3cu5
USING 'ORA10G';
XTTS: Prerequisites
# Unzip XTTS objects and scripts:
$> unzip d /home/oracle/XTTS rman_xttconvert_1.4.zip
Edit xtt.properties on source and destination:
4
# Tablespace(s) for XTTS transport:
tablespaces=AP_DATA,AP_IDX,AP_CLOB
# Source database parameters:
platformid=2
srcdir=ORA10G_DBF
srclink=ORA10G
dfcopydir=/home/oracle/XTTSFILES
backupformat=/home/oracle/XTTSFILES
# Destination database parameters:
dstdir=ORA12C_DBF
stageondest=/home/oracle/XTTSFILES
storageondest=+DATA
backupondest=+FRA
asm_home=/u01/app/oracle/product/12.1.0/grid
asm_sid=+ASM
parallel=4
rollparallel=2
ARCHIVELOG
ON
COMPATIBLE =
Ora12010 12.0
OPEN READ
WRITE
5B
5A
22
Transfer
copies
files
to
Pull
initial image
datafile
image
copies
todestination:
destination:
$>./xttdriver.pl
scp
$>
G
D_F_T
Convert datafiles
different
Conversion
handled(if
implicitly!
RMAN
endianness):
RMAN> CONVERT
$> ./xttdriver.pl i
$> scp
ARCHIVELOG
ON
COMPATIBLE =
Ora12010 12.0
OPEN READ
WRITE
6
B
$> ./xttdriver.pl -r
Capture FROM_SCN for next
synchronization:
$> ./xttdriver.pl -s
7
B
$> ./xttdriver.pl -e
Import tablespaces into
destination database:
$> impdp ... parfile=xtts.dpictl
Bring tablespaces into READ
WRITE mode:
SQL> ALTER TABLESPACE ap_data
READ WRITE;
...
See also:
MOS #2013540.1, Cross-Platform Database Migration (Across Same Endian)
Using RMAN Backupset In 12c
MOS # 2013271.1, 12c How To Perform Cross-Platform Database Transport To
Different Endian Platform With RMAN Backup Sets
23
RMAN> BACKUP
Back up 1
FOR TRANSPORT
READ
FORMAT +DATA1
ONLY
DATAPUMP
tablespa
FORMAT
ces as
/home/oracle/dfte.d
backup
+RECO
mp
set from
TABLESPACE
12.1.0.1
2 tpch_data,
tpch_idx;
Copy RMAN
backup sets +
DBMS_FILE_TRA
DP dump set to
NSFER
destination
database
ARCHIVELOG ON
3
DB12102
COMPATIBLE >= RMAN> RESTORE
12.0
Restore
FOREIGN TABLESPACE
OPEN READ WRITEtpch_data, tpch_idx
tablespace
+DATA1
s into
FORMAT +DATA1
12.1.0.2
FROM BACKUPSET
non-CDB
+RECO
+RECO
or PDB
DUMP FILE FROM
BACKUPSET
/home/oracle/dfte.dmp;
COMPATIBLE >=
12.0
OPEN READ
WRITE
+DATA1
Drawbacks:
Source database must be at least Release 11.2.0.3
At the source, the entire tablespace set must be brought into READ
ONLY mode
but remember: Intent is to migrate to new platform / environment!
See Oracle Database 12c Administrators Guide, Chapter
15: Transporting Data
25
ARCHIVELOG ON
COMPATIBLE >=
11.2.0.3
OPEN READ WRITE
expdp system/******
1
PARFILE=fte_11203.d
Export
pectl
DUMPFILE=fte_11203.
entire
dmp
contents
+DATA1
LOGFILE=fte_11203.lo
of 11.2.0.3
g
database
TRANSPORTABLE=A
+FRA
2LWAYS
VERSION=12.0
Copy
datafiles &
DBMS_FILE_TRA
FULL=Y dump
metadata
NSFER
set to 12.1.0.2
DB12102
database
ARCHIVELOG ON
COMPATIBLE >=
3
impdp
12.0
OPEN READ WRITEsystem/******
Plug nonPARFILE=fti_11203.
SYSTEM
DIRECTORY=DPDIR
+DATA1
datafiles &
dpictl
DUMPFILE=fte_11203.dm
all objects
p
+FRA
into
LOGFILE=fti_11203.log
12.1.0.2
FULL=Y
database
TRANSPORT_DATAFILE
S=
Q+A
Session #1344:
Migrating and Upgrading to Oracle
Database 12c Quickly With Near-Zero
Downtime
31