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

Oracle Database Cloud Migration

Fast, simple, universal

Mike Dietrich Soner Toraman


Master Product Manager Product Owner Relational Databases
Database Upgrades & Migrations METRO-NOM GmbH
Oracle Corporation

Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | Oracle Database Cloud Migration: Fast, simple, universal
a n y
G e rm

Mike Dietrich https://MikeDietrichDE.com


Master Product Manager
Oracle Database Upgrades and Migrations MikeDietrichDE

Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | Oracle Database Cloud Migration: Fast, simple, universal 2
Slides download and other resources
• https://MikeDietrichDE.com/slides

Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | Oracle Database Cloud Migration: Fast, simple, universal 3
Overview

Photo by asoggetti on Unsplash


Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | Oracle Database Cloud Migration: Fast, simple, universal
ExaCC: Exadata Cloud at Customer
• https://www.oracle.com/technetwork/database/exadata/exacc-x7-ds-4126773.pdf

Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | Oracle Database Cloud Migration: Fast, simple, universal 5
Project Goal
• Cross platform migration
– AIX (Big Endian) to Linux (Little Endian)
– Options:
• Data Pump
– Simple but slow due to complexity and amount of data
• Transportable Tablespaces
– More prep work due to complexity but can deal with high amounts of data
• Full Transportable Export/Import
– Combines both but may be harder due to unforeseeable log errors

• All-purpose migration path


– Even for same-Endianness migrations

Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | Oracle Database Cloud Migration: Fast, simple, universal 6
Decision
• Build a universal Transportable Tablespaces solution
• Utilize the ZDLRA for cross platform incremental backup/restore

Photo by Javier Allegue Barros on Unsplash


Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | Oracle Database Cloud Migration: Fast, simple, universal 7
Strategy Overview

Restore/Recover

Inc Backup Transport

Rebuild Meta

Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | Oracle Database Cloud Migration: Fast, simple, universal 8
Migration with Transportable Tablespaces - Overview
Rebuild meta information
(views, synonyms, trigger, roles etc)

SOURCE Database 12.1.0.2 DESTINATION Database 12.2.0.1


VIEWS VIEWS

Read Only
SYSTEM CODE
SYSTEM CODE

SCOTT SYSAUX SCOTT SYSAUX


UNDO PRIVS UNDO PRIVS

HUGO HUGO
TEMP TEMP

Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | Oracle Database Cloud Migration: Fast, simple, universal 9
TTS: Using Incremental Backups
impdp"'"sys/sys
expdp "'"sys/sysasassysdba"'"
sysdba"'"…

TRANSPORT_DATAFILES=…
TRANSPORT_TABLESPACES=TS1,TS2 …
Convert and apply
Downtime!!! backups

SOURCE Database 12.1.0.2 DESTINATION Database 12.2.0.1


VIEWS Read Write VIEWS

Read Only
SYSTEM CODE SYSTEM CODE

SCOTT SYSAUX SCOTT SYSAUX


Data Pump / Scripts
UNDO PRIVS UNDO PRIVS

HUGO HUGO
TEMP TEMP

Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | Oracle Database Cloud Migration: Fast, simple, universal 10
What is the plan?

Photo by Alvaro Reyes on Unsplash


Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | Oracle Database Cloud Migration: Fast, simple, universal 11
Timeline

Backups Restore Level 0

Restore Level 1

Restore Level 1 TTS


Meta

Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | Oracle Database Cloud Migration: Fast, simple, universal 12
Migration Details
Part 1 - The ZDLRA

Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | Oracle Database Cloud Migration: Fast, simple, universal 13
ZDLRA: Strategy Overview

Restore/Recover

dbmigusera.pl
Inc Backup Transport
Customized PERL scripts
for Recovery Appliance
Rebuild Meta

Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | Oracle Database Cloud Migration: Fast, simple, universal 14
Zero Data Loss Recovery Appliance
• Install most recent libra.so
– MOS Note: 2219812.1 - ZDLRA: Download new sbt library

Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | Oracle Database Cloud Migration: Fast, simple, universal 15
Zero Data Loss Recovery Appliance
• Download package dbmigusera.pl incl. xtt.properties
– MOS Note: 2460552.1 - Cross Platform Database Migration using ZDLRA

Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | Oracle Database Cloud Migration: Fast, simple, universal 16
Zero Data Loss Recovery Appliance
• Deploy package dbmigusera.pl

Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | Oracle Database Cloud Migration: Fast, simple, universal 17
Zero Data Loss Recovery Appliance
• Customize xtt.properties
# SBT parameter configuration to be used for restore and recover operations
sbtlibparms="SBT_LIBRARY=/u01/app/oracle/product/12.2.0.1/dbhome_1/lib/libra.so, …')"

# The number of datafiles that will be restored / recovered in parallel.


resparallel=16

# The list of tablespaces to be migrated


ttsnames=T14_1,T14_2,T14_3,T14_4,T14_5,T14_6,T14_7,T14_8,T14_9,T14_10,T14_11

# The directory to which the datafiles will be restored


storageondest=+DATAC1/dbmig/datafile

sourceplatid=2
dbid=4173218531
retrycount=2

Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | Oracle Database Cloud Migration: Fast, simple, universal 18
Restore and Recover
Level 0 Backup Restore

Restore/Recover

Inc Backup
$ perl dbmigusera.pl --restore …

Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | Oracle Database Cloud Migration: Fast, simple, universal 19
Restore and Recover
Level 1 Backup Restore-Recover

Restore/Recover

Inc Backup
$ perl dbmigusera.pl --recover …

Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | Oracle Database Cloud Migration: Fast, simple, universal 20
Restore and Recover
Level 1 Backup Restore-Recover

Restore/Recover

Inc Backup
$ perl dbmigusera.pl --recover …

Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | Oracle Database Cloud Migration: Fast, simple, universal 21
Migration Details
Part 2 - Transportable Tablespaces to ExaCC

Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | Oracle Database Cloud Migration: Fast, simple, universal 22
TTS: Strategy Overview

Custom TTS
Restore/Recover
Customized Transportable
Tablespaces Scripts
Inc Backup Transport

Rebuild Meta

Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | Oracle Database Cloud Migration: Fast, simple, universal 23
Check Script on all Sources

• Check script
– Checks for objects in SYSTEM tablespace
– Size of database
– Tablespaces
– Object count meta objects
CHECK
– And more …
• AWR extract
• Plan Capture

Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | Oracle Database Cloud Migration: Fast, simple, universal 24
Prep Work on ExaCC

• Build a new database


– Identical character set
– Identical national character set
Restore/Recover
– Identical time zone version
Transport – As PDB
Rebuild Meta • Adjustments
– Rename USERS tablespace to
USERS_DROP_ME_LATER
– Set Guaranteed Restore Point for testing

Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | Oracle Database Cloud Migration: Fast, simple, universal 25
Prep Work on Source

• Move tables out of SYSTEM TS


• Generate scripts
– Set tablespaces read/only, and reverse
– Create dummy tablespaces, and reverse
– Create temporary tablespaces
– Create User, create Profiles
– Create Grants, Roles, Directories
– Grants to create MVs, DB-Links
– Create Functions used in Tables/Indexes
– Create Global Temporary Tables
– xtt.properties tablespace list

Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | Oracle Database Cloud Migration: Fast, simple, universal 26
Incremental Backup-Restore - No Downtime

• Level 0 backup restore


– $ perl dbmigusera.pl --restore

• Level 1 backup restore/recover


Restore/Recover
– $ perl dbmigusera.pl --recover
Transport
• Repeat …
Rebuild Meta

Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | Oracle Database Cloud Migration: Fast, simple, universal 27
Prep Work on ExaCC

• Create
– Profiles
– Dummy tablespaces
Restore/Recover – Temporary tablespaces
– Users
Transport
– Directories
Rebuild Meta • Drop
– Dummy tablespaces
• Create
– Grants, Roles, Directories, Functions for tables/indexes

• From dfcopy.txt (xtt PERL):


– Generate TRANSPORT_DATAFILES strings

Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | Oracle Database Cloud Migration: Fast, simple, universal 28
Final Incremental Backup-Restore - Downtime
Tablespaces
Read Only
• Level 1 backup restore/recover
– $ perl dbmigusera.pl --recover

Restore/Recover

Transport

Rebuild Meta

Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | Oracle Database Cloud Migration: Fast, simple, universal 29
Export Tablespace and Meta Information

• Metadata export
– function, package, procedure,
database_link, sequence, view,
Restore/Recover synonym
Transport • TTS export
Rebuild Meta
• Important:
– GATHER_SCHEMA_STATS('SYS')
– GATHER_SCHEMA_STATS('SYSTEM')

Meta Data TTS


Export Export

Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | Oracle Database Cloud Migration: Fast, simple, universal 30
TTS Import

• TTS Import
– Afterwards tablespaces are attached
– Duration: 60 mins in test environment
Restore/Recover

Transport

Rebuild Meta

TTS
Import

Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | Oracle Database Cloud Migration: Fast, simple, universal 31
Rebuild of Meta Information

• Meta Import
–Rebuilds:
• Functions
Restore/Recover
• Packages
Transport • Procedures
Rebuild Meta
• Database links
• Sequences
• Views
• Synonyms

Metadata
Import
Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | Oracle Database Cloud Migration: Fast, simple, universal 32
Check Script: Comparison

• Clean up
– Drop GRP
– Other treatments
• Run check script
CHECK CHECK – Comparison Before/After
• Encryption

Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | Oracle Database Cloud Migration: Fast, simple, universal 33
Back to reality …

Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | Oracle Database Cloud Migration: Fast, simple, universal 34
Oracle Database Cloud Migration

@Metro|nom
Oracle Open World, 25.10.2018

36
Introduction

37
Oracle Database Cloud Migration @ Metro|nom
Introduction

Soner Toraman
Product Owner Relational Databases @

Team: 13 DBAs
Managing > 2500 Databases
2100 Oracle Databases
Backup Infrastructure ZDRLA

38
Oracle Database Cloud Migration @ Metro|nom
Introduction

00 employees
s 20
0,000 employee
15
es
IT-Servic
on
€37 Billi ons
IT-Soluti
tries
25 Coun

39
1 Our Vision
what was our trigger & strategy?

Agenda 2 Cloud Migration Tool And The Reality


what‘s behind? how did we use it?

3 Best Practices
facts and recommendations

40
Our Vision

41
Oracle Database Cloud Migration @ Metro|nom
Our Vision

Why shift to cloud@customer?

agility cost transparency cloud ready flexibility

y
xit ses go ud
e es ce o
pl c u n cl
m o yo rie lic
co pr as pe b
ce if
y y ex pu
du pl pa in to
re si
m
ga
lif
t

42
Oracle Database Cloud Migration @ Metro|nom
Our Vision

OCPUs Cloud@Customer IBM Power Systems

Phase4 DUS

Phase3 FRA IBM 2 OCC

IBM 2 OCC

Phase2 FRA

IBM 2 OCC

Phase1 DUS

IBM 2 OCC
Oracle Public Cloud

1y 2y 3y 4y t

43
Oracle Database Cloud Migration @ Metro|nom
Our Vision

2018 2022

Jul. ‚18 Aug. ‚18 Sep. ‚18 Oct. ‚18 Nov. ‚18 Dec. ‚18 Jan. ‚19 Feb. ‚19 Mar. ‚19 Apr. ‚19 Mai. ‚19 Jun. ‚19 Jul. ‚19 Nov. ‚20

Cross-platform
PoC migration 200
Core Applications databases
FRA Frozen FRA Approx. 1500
OCC/ECC database
Cross-platform migrations
migration 40 DUS Frozen DUS In 4y
databases on ECC

Cross-platform
migration 204
databases on OCC

Restore/Recover

Inc Backup Transport

Rebuild Meta

44
Oracle Database Cloud Migration @ Metro|nom
Our Vision
DC1 Düsseldorf
DC2 Frankfurt

Availability Zone 1 Availability Zone 2 Availability Zone 1 Availability Zone 2

Oracle Cloud
Backup

Oracle Cloud
Archive
45
Cloud Migration Tool
And The Reality

46
Oracle Database Cloud Migration @ Metro|nom
CMT and the Reality
!!
e!
im
nt
Our expectations: ow
D
o
N

One Click Migration

Higher Management
!!
e!
im
nt
Experts ow
D
um
im
in
M

Pretasks Migration PostTasks


Migration in 3 Steps

47
Oracle Database Cloud Migration @ Metro|nom
CMT and the Reality
!!
e!
im
nt
ow
What did we get? D
um
m
i ni
M

PreTasks Migration PostTasks


Migration in 3 Steps

hard one easy one easy one

Error-prone
Too many manual interventions

48
Oracle Database Cloud Migration @ Metro|nom
CMT and the Reality

PreTasks Migration PostTasks

generate >50 scripts, which have


to be partially customized

m
te
sys
s,
sy ts ly
in ip ts on
Source ts s cr r ip d
ec e s c a …
ob
j
vl0 th 1 vl1 re vl1 TS
or pl te p lvl th
e
pl to pl rtT
f u r a u y u B ku po
k ck ne ck p ck tD c ex
ec ba ba co ba se ba
ch ge

b
pd lvl
0 vl1 vl1
… n
rl rl TS tio
cr
ea
te
st
or
e
co
ve
ve rtT ryp t
re re co po c
Target re Im en

49
Best Practices

50
Oracle Database Cloud Migration @ Metro|nom
Best Practices
• Automate your Pretasks
- no modifications of generated scripts - avoid human errors
• Define directory structures
- you should know where to find your logfiles and scripts
• Use a shared directory for scripts & logfiles
- avoid switching from source to target vice versa and copy activities
• Do the Pretasks 2-3 days before
- risk of major changes in the database
• Don‘t concentrate on databases with individual errors
- you have a fallback in place
• Check the load on your ZDLRA
- when you do mass migrations
• Check the load on your target infrastructure
- even it is a ExaCC
• Give feedback to the authors of the cloud migration tool
- they will enhance the tool

51
Oracle Database Cloud Migration @ Metro|nom
Best Practices

• Errors during import of XML tables


- don‘t worry, export/import separatly
• Scan your logfiles
- exclude known uncritical errors
• The order of your imports are important
- you can‘t grant privileges to users which don't exist
• Monitor the filesystems you need for your migration
- this can be show stopper when you do mass migrations
• Install most recent libra.so
- MOS Note: 2219812.1 - ZDLRA: Download new sbt library

• Do not neglect the ZDLRA


- It‘s an appliance but needs a lot of love

52
Oracle Database Cloud Migration @ Metro|nom
Best Practices

Our wishes …
• for the Pretasks
… a procedure included within the database

• additional feature for the cloud migration tool


… make sure that the tool is using the latest incremental backup when recover

53
54
Thank you for
Soner Toraman

your attention!
Slides download and other resources
• https://MikeDietrichDE.com/slides

Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | Oracle Database Cloud Migration: Fast, simple, universal 55
Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | Oracle Database Cloud Migration: Fast, simple, universal 56

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