oracle migration strategies coug presentation – feb 2013

26
1 Oracle Migration Strategies COUG Presentation – Feb 2013 Feb 21, 2013 Ray Smith [email protected]

Upload: miracle

Post on 24-Feb-2016

20 views

Category:

Documents


0 download

DESCRIPTION

Oracle Migration Strategies COUG Presentation – Feb 2013. Feb 21, 2013. Ray Smith [email protected]. Agenda:. What are my objectives today ? To get you thinking about migration strategies available to you Fly through the slides as quickly as possible. - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Oracle Migration Strategies         COUG Presentation – Feb  2013

1

Oracle Migration Strategies COUG Presentation – Feb 2013Feb 21, 2013

Ray [email protected]

Page 2: Oracle Migration Strategies         COUG Presentation – Feb  2013

2

What are my objectives today? To get you thinking about migration strategies available to

you Fly through the slides as quickly as possible. Try some out.. And hope we don’t crash and burn..

Agenda:

Page 3: Oracle Migration Strategies         COUG Presentation – Feb  2013

3

Migration strategies

Good old fashioned import/export Datapump copy Good old fashioned cold backup/copy (clone) Good old fashioned hot backup / copy / recovery

(clone) RMAN clone from backup copy RMAN clone from live 4000 clerks and a lot of typing Transportable tablespaces

Page 4: Oracle Migration Strategies         COUG Presentation – Feb  2013

4

Migration types

Identical platforms Similar platforms Completely different systems

Page 5: Oracle Migration Strategies         COUG Presentation – Feb  2013

5

Migration strategies - Identical platforms

Good old fashioned import/export Slow but simple, requires database to be pre-created, scan through errors

on import 2/10

Datapump copy Slow but simple, requires database to be pre-created, sometimes issues

with roles/grants. 6/10

Good old fashioned cold backup/copy (clone) Simple, easy but outage increases because of copy time 9/10

Page 6: Oracle Migration Strategies         COUG Presentation – Feb  2013

6

Migration strategies - Identical platforms

Good old fashioned hot backup / copy / recovery (clone)

Simple, minimal downtime to copy final archives 10/10

RMAN clone from backup copy Fairly easy 9/10 (possibly 10/10)

RMAN clone from live Actually quite nice and fairly simple too 10/10

Other strategies… why complicate things – we’ve already got some great strategies above

Page 7: Oracle Migration Strategies         COUG Presentation – Feb  2013

7

Migration strategies – Similar platforms

Good old fashioned import/export Slow but simple, requires database to be pre-created, scan through errors

on import 2/10

Datapump copy Slow but simple, requires database to be pre-created, sometimes issues

with roles/grants 6/10

Good old fashioned cold backup/copy (clone) Simple, easy but outage, recompilation required (utlirp/utlrp), conversion

using RMAN of rollback 8/10

Page 8: Oracle Migration Strategies         COUG Presentation – Feb  2013

8

Migration strategies – Similar platforms

Good old fashioned hot backup / copy / recovery (clone)

Simple, minimal downtime to copy final archives, recompilation required (utlirp/utlrp), rman conversion for rollback

10/10

RMAN clone from backup copy Fairly easy, can get confused if 32-bit/64-bit conversions 9/10

RMAN clone from live Actually quite nice and fairly simple too although still some issues during

32-bit/64-bit conversions 9/10

Other strategies… not touching them as we’ve already got some easy options… why complicate things

Page 9: Oracle Migration Strategies         COUG Presentation – Feb  2013

9

Migration strategies – Different platforms

Good old fashioned import/export Slow but simple, requires database to be pre-created, scan through errors

on import 2/10

Datapump copy Slow but simple, requires database to be pre-created, sometimes issues

with roles/grants 6/10

Good old fashioned cold backup/copy (clone)

Page 10: Oracle Migration Strategies         COUG Presentation – Feb  2013

10

Migration strategies – Different platforms

Good old fashioned hot backup / copy / recovery (clone)

RMAN clone from backup copy RMAN clone from live 4000 clerks and a lot of typing

Um….

Transportable tablespaces Database pre-creation required, RMAN conversion required, Datapump

metadata export required, relatively complicated. 4/10 for small databases 8/10 for big databases

Page 11: Oracle Migration Strategies         COUG Presentation – Feb  2013

11

What shall we try?

Migrating from Solaris to Linux. SANDBOX (11G on Solaris) PROD1 (11G on Linux) How different is different? How do I find the Endian format?

Page 12: Oracle Migration Strategies         COUG Presentation – Feb  2013

12

Endian Format

Primary (Existing) - SANDBOXSELECT d.platform_name, endian_format FROM v$transportable_platform tp, v$database dWHERE tp.platform_name = d.platform_name; PLATFORM_NAME ENDIAN_FORMAT------------------------- -------------Solaris[tm] OE (64-bit) Big

Remote (new) - PROD1PLATFORM_NAME ENDIAN_FORMAT------------------------- -------------Linux x86 64-bit Little

Page 13: Oracle Migration Strategies         COUG Presentation – Feb  2013

13

What shall we try?

Migrating from Solaris to Linux SANDBOX (11G on Solaris) PROD1 (11G on Linux) How different is different? How do I find the Endian format? What strategies are available?

Page 14: Oracle Migration Strategies         COUG Presentation – Feb  2013

14

Migration strategies – Different platforms

Good old fashioned import/export 2/10

Datapump copy 6/10

Transportable tablespaces 4/10 for small databases 8/10 for big databases

Page 15: Oracle Migration Strategies         COUG Presentation – Feb  2013

15

Lets play

Migrating from Solaris to Linux SANDBOX (11G on Solaris) PROD1 (11G on Linux) How different is different? Endian Formats How do I find the Endian format? What strategies are available? What would I like to try?

Page 16: Oracle Migration Strategies         COUG Presentation – Feb  2013

16

Lets play

Datapump Network based.

Pre-create the database Update the TNS information Create the directory (for the log) Create the database link Impdp command

Page 17: Oracle Migration Strategies         COUG Presentation – Feb  2013

17

Commands used in demo - network datapump

Preparation newdb – create the directory for logfile

set echo oncreate or replace directory migrate as '/u01/oracle/PROD1_MIGRATE';select * from dba_directories;

Page 18: Oracle Migration Strategies         COUG Presentation – Feb  2013

18

Commands used in demo - network datapump

Preparation newdb – create the database link

connect system/letme1nset echo onset pages 1000col OWNER format a8col DB_LINK format a15col USERNAME format a10col HOST format a10create database link migrate_link connect to system identified by letme1nusing 'SANDBOX';select * from dba_db_links;connect / as sysdba

Page 19: Oracle Migration Strategies         COUG Presentation – Feb  2013

19

Commands used in demo - network datapump

Preparation newdb – Precreate the tablespaces

set echo oncreate tablespace TRAN datafile '/u01/oracle/PROD1/tran01.dbf' size 100M;create tablespace TRAN_IDX datafile '/u01/oracle/PROD1/trani01.dbf' size 75M;

Page 20: Oracle Migration Strategies         COUG Presentation – Feb  2013

20

Commands used in demo - network datapump

Import newdb – datapump command

PARFILE: dp_migrate.par

NETWORK_LINK=MIGRATE_LINKFULL=YLOGFILE=migrate.logdirectory=MIGRATE

Impdp system/letme1n parfile=dp_migrate.par

Page 21: Oracle Migration Strategies         COUG Presentation – Feb  2013

21

Commands used in demo - Transportable tablespace

Preparation newdb – precreate the users – copied from source

create user JP identified by letmein;create user martin identified by letmein;create user rays identified by letmein;grant connect,resource to jp,martin,rays;grant QUERY REWRITE to RAYS;grant CREATE MATERIALIZED VIEW to JP;grant UNLIMITED TABLESPACE to JP;grant CREATE DATABASE LINK to MARTIN;grant DROP PUBLIC DATABASE LINK to RAYS;grant CREATE DATABASE LINK to JP;grant QUERY REWRITE to JP;grant CREATE VIEW to JP;grant QUERY REWRITE to MARTIN;grant CREATE MATERIALIZED VIEW to MARTIN;grant CREATE PUBLIC DATABASE LINK to RAYS;grant CREATE MATERIALIZED VIEW to RAYS;grant UNLIMITED TABLESPACE to MARTIN;

Page 22: Oracle Migration Strategies         COUG Presentation – Feb  2013

22

Commands used in demo - Transportable tablespace

Preparation newdb – datapump location (metadata)

create or replace directory migrate as '/u01/oracle/PROD1_MIGRATE';select * from dba_directories;

Page 23: Oracle Migration Strategies         COUG Presentation – Feb  2013

23

Commands used in demo - Transportable tablespace

Preparation sourcedb – make the tablespaces read only

alter tablespace TRAN read only;alter tablespace TRAN_IDX read only;

Page 24: Oracle Migration Strategies         COUG Presentation – Feb  2013

24

Commands used in demo - Transportable tablespace

Preparation sourcedb – metadata export

PARFILE: expdp.par:

dumpfile=SANDBOX_meta.dplogfile=SANDBOX_meta.logdirectory=MIGRATETransport_tablespaces=TRAN,TRAN_ID

expdp system/letme1n parfile=expdp.par

Page 25: Oracle Migration Strategies         COUG Presentation – Feb  2013

25

Commands used in demo - Transportable tablespace

Datafile conversion newdb

sqlfile: rman_convert.sql:

convert datafile'/u01/oracle/PROD1/preconv/tran01.dbf'FROM PLATFORM 'Solaris[tm] OE (64-bit)'FORMAT '/u01/oracle/PROD1/tran01.dbf' ;

convert datafile'/u01/oracle/PROD1/preconv/trani01.dbf'FROM PLATFORM 'Solaris[tm] OE (64-bit)'format'/u01/oracle/PROD1/trani01.dbf';

rman target /@rman_convert.sql

Page 26: Oracle Migration Strategies         COUG Presentation – Feb  2013

26

Commands used in demo - Transportable tablespace

Import newdb – datapump command

Parfile: dp_migrate.par:

directory=MIGRATEdumpfile=SANDBOX_meta.dplogfile=SANDBOX_meta.logtransport_datafiles='/u01/oracle/PROD1/tran01.dbf','/u01/oracle/PROD1/trani01.dbf','/u01/oracle/PROD1/tran02.dbf‘

impdp system/letme1n parfile=dp_migrate.par