Vous êtes sur la page 1sur 64

1 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Zero Downtime Migrations


using Oracle GoldenGate
Thomas Niewel
Principal Sales Consultant
The following is intended to outline our general product
direction. It is intended for information purposes only, and
may not be incorporated into any contract. It is not a
commitment to deliver any material, code, or functionality,
and should not be relied upon in making purchasing
decisions. The development, release, and timing of any
features or functionality described for Oracle’s products
remains at the sole discretion of Oracle.

3 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.


Agenda

ƒ GoldenGate Architecture

ƒ GoldenGate 11.2 Classic Capture vs. Integrated Capture

ƒ Zero Downtime Migrations

ƒ Instantiation Methods for the Target Database

ƒ Sizing Aspects

ƒ Setup of Oracle GoldenGate Including a Failback Environment

4 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.


Oracle GoldenGate
Low-Impact Real-Time Data Integration & Transactional Replication
Zero Downtime Upgrade
& Migration
New DB/HW/OS/APP

Highly Available /
Disaster Recovery
Legacy Fully Active Distributed DB

Query Offloading,
Disaster Recovery
Log-based, Reporting Database
changed data Real-time BI, Operational
Reporting, MDM

Database Data Integrator


Data Warehouse
ODS Data Synchronization
across the Enterprise

Global Data Centers


Message Bus Event Driven
Architecture, SOA
Message Bus

5 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.


Oracle GoldenGate Topologies
Unidirectional Bi-Directional Peer-to-Peer
Query Offloading Hot Standby or Load Balancing
Zero-Downtime Migration Active-Active for HA Multi-Master

Broadcast Integration/Consolidation Data Distribution


Data Distribution Data Warehouse via Messaging

BPM

BAM

CEP

6 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.


Oracle GoldenGate Documentation

ƒ Documentation:
ƒ http://www.oracle.com/technetwork/middleware/g
oldengate/documentation/index.html

ƒ Certification Matrix
ƒ http://www.oracle.com/technetwork/middleware/i
as/downloads/fusion-certification-100350.html

7 Copyright © 2013, Oracle and/or its affiliates. All rights reserved. 7


GoldenGate Architecture

Source: Oracle GoldenGate Windows and UNIX Administrator’s Guide

8 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.


GoldenGate DDL Replication

ƒ DDL Replication is a trigger based solution


ƒ Table structure on source and target environment
must be identical
ƒ DDL Replication only possible in a homogenous
environment
ƒ Setup
ƒ marker_setup.sql
ƒ ddl_setup.sql
9 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.
How GoldenGate Works

Source: Oracle GoldenGate Windows and UNIX Administrator’s Guide

10 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.


Agenda

ƒ GoldenGate Architecture

ƒ GoldenGate 11.2 Classic Capture vs. Integrated Capture

ƒ Zero Downtime Migrations

ƒ Instantiation Methods for the Target Database

ƒ Sizing Aspects

ƒ Setup of Oracle GoldenGate Including a Failback Environment

11 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.


GoldenGate 11.2 – Classic Capture

Source: Oracle GoldenGate Windows and UNIX Administrator’s Guide

12 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.


GoldenGate 11.2 – Integrated Capture

Integrated Capture: See note 1411356.1 for Oracle 11.2.0.3 required patches

Source: Oracle GoldenGate Windows and UNIX Administrator’s Guide

13 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.


GoldenGate 11.2
Classic Capture or Integrated Capture ?
ƒ Classic Capture
ƒ Most data types supported

ƒ Restricted support for complex data types

ƒ GoldenGate Profiling Scripts


ƒ Note 1298562.1 (Database)
ƒ Note 1296168.1 (Schema)

14 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.


GoldenGate 11.2
Classic Capture or Integrated Capture ?
ƒ Integrated Capture
ƒ Fully integrated with the database, no additional setup is
required to work with Oracle RAC, ASM, and TDE
ƒ Easier Integration into RAC
ƒ Integrated Log Management, because of Logminer usage
ƒ Classic Capture Restrictions abandoned (see next slides)
ƒ Downstream Capture

15 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.


GoldenGate 11.2
Integrated Capture vs. Classic Capture
Some important Features Classic Capture Integrated Capture
Compression (Basic, OLTP,
EHCC)
X 9

XML Partially 9

Mutithreaded X 9

RAC with PDML With Restrictions 9

RAC with XA With Restrictions 9

More details: Oracle GoldenGate for Oracle Installation and Setup Guide – Chapter 1.4

16 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.


GoldenGate 11.2
Integrated Capture vs. Classic Capture
Database Version Classic Capture Integrated Capture

10.2 Supported Supported *

TDE/TSE, Fetch support for


11.1.0.7 SecureFiles, ADTs, VARRAYS, Supports TDE/TSE *
Nested Tables, Object Tables
TDE/TSE, XA-RAC, Compression,
TDE/TSE, Fetch support for
SecureFiles, Fetch support for
11.2.0.2 SecureFiles, ADTs, VARRAYS,
ADTs, VARRAYS, Nested Tables,
Nested Tables, Object Tables
Object Tables *
TDE/TSE, XA-RAC, Compression,
TDE/TSE Fetch support for XML Object Relational, XML
11.2.0.3 SecureFiles, ADTs, VARRAYS, Binary, SecureFiles,Fetch support
Nested Tables, Object Tables for ADTs, VARRAYS, Nested
Tables, Object Tables
* Supported for Downstream Capture model only
Source: http://www.oracle.com/us/products/middleware/data-integration/goldengate-11gr2-new-features-wp-1736116.pdf

17 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.


Agenda

ƒ GoldenGate Architecture

ƒ GoldenGate 11.2 Classic Capture vs. Integrated Capture

ƒ Zero Downtime Migrations

ƒ Instantiation Methods for the Target Database

ƒ Sizing Aspects

ƒ Setup of Oracle GoldenGate Including a Failback Environment

18 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.


Zero Downtime Migration
with Oracle GoldenGate
ƒ Example 1: near-zero-downtime upgrade with GoldenGate

Old environment Linux guest new

extract pump
replicat

+ ASM + ASM

+Diskgroup +Diskgroup

19 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.


Zero Downtime Migration
with Oracle GoldenGate
ƒ Example 1: near-zero-downtime upgrade with GoldenGate

Old environment Linux guest new

extract pump
replicat

SCN=4711 SCN=4711
+ ASM ...... + ASM

+Diskgroup +Diskgroup

SCN on source is 4711


Step 1: Start extract and pump process

20 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.


Zero Downtime Migration
with Oracle GoldenGate
ƒ Example 1: near-zero-downtime upgrade with GoldenGate

Old environment Linux guest new

extract pump
replicat

SCN=4750 SCN=4711
+ ASM ..... + ASM

SCN 4750

+Diskgroup
export/import
+Diskgroup

Step 2: export/import with consistent SCN 4750

21 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.


Zero Downtime Migration
with Oracle GoldenGate
ƒ Example 1: near-zero-downtime upgrade with GoldenGate

Old environment Linux guest new

extract pump
replicat

SCN=4790 SCN=4711
+ ASM ..... + ASM

SCN 4750

+Diskgroup +Diskgroup

Step 3: Start replicat with SCN 4750


replicat process applies changes until databases are in sync

22 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.


Zero Downtime Migration
with Oracle GoldenGate
ƒ Example 1: near-zero-downtime upgrade with GoldenGate

Old environment Linux guest new

replicat Pump Extract


failback failback failback

+ ASM + ASM

+Diskgroup +Diskgroup

Step 4: Application can be stopped


Replication can be stopped and started in the opposite direction
Application can be started on the new database

23 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.


Zero Downtime Migration
Oracle 10.2 Æ Oracle 11g Cross-Platform (Linux x86 to Linux for z)
Example 2: near-zero-downtime upgrade with GoldenGate

Oracle 10.2 Clone Æ Oracle


Database 11g
Oracle 10.2 Linux
on Linux
Oracle
GoldenGate
Capture

Oracle Oracle 11g on


GoldenGate Linux for z
Delivery

1. Start of the Oracle GoldenGate capture process 6. Cross platform transportable tablespaces
2. Create of a clone database; after that upgrade to Oracle 11g metadata Import and transfer of the datafiles with
3. Cross platform transportable tablespace metadata export
4. Use of a “full database NOROWS export” (Views, Packages, etc) conversion of the endianess
of the Clone DB 7. Full Import with IGNORE option
5. Installation of a new Oracle 11g Database on Linux for z 8. Start Oracle GoldenGate Delivery on Linux for z

24 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.


Zero Downtime Migration
Oracle 10.2 Æ Oracle 11g Cross-Platform (Linux x86 to Linux for z)
Example 2: near-zero-downtime upgrade with GoldenGate
Oracle 10.2 Clone Æ Oracle
11g Linux
Oracle 10.2
Linux

Failback option
Oracle Database 11g
Linux for z

9. Wait until source and target database are in sync


10. Stop the application and wait until all data is processed
11. Start Oracle GoldenGate Capture on the z/Linux platform
12. Start Oracle GoldenGate Delivery on the Linux platform
13. **SWITCHOVER** of the application

25 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.


Things to Consider

ƒ Trigger
ƒ Disable triggers
ƒ Replicat parameter DBOPTIONS SUPPRESSTRIGGERS

ƒ Referential integrity
ƒ Disable cascading delete constraints on target
ƒ Replicat parameter DBOPTIONS DEFERREFCONST

26 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.


Things to Consider

ƒ Sequences

ƒ Supported with uni-directional active-passive topology

ƒ Target sequence value always higher (or equal, if


the cache is 0) than source sequence value

27 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.


Agenda

ƒ GoldenGate Architecture

ƒ GoldenGate 11.2 Classic Capture vs. Integrated Capture

ƒ Zero Downtime Migrations

ƒ Instantiation Methods for the Target Database

ƒ Sizing Aspects

ƒ Setup of Oracle GoldenGate Including a Failback Environment

28 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.


Methods for an Instantiation of the Target
Database
ƒ expdp/impdp
ƒ expdp/impdp via a database link
ƒ (Cross platform) Transportable Tablespaces
ƒ CTAS (Create Table As Select)
ƒ Export / Import
ƒ Backup / Restore (see Note 369644.1 and 1079563.1)
ƒ Instantiation with GoldenGate
ƒ …..

29 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.


Methods for an Instantiation of the Target
Database - Examples
1. SELECT DBMS_FLASHBACK.GET_SYSTEM_CHANGE_NUMBER
FROM DUAL;
a) Insert into target select * from scott.emp as of scn 3488839
b) expdp strmadmin SCHEMAS=hr DIRECTORY=DPUMP_DIR
DUMPFILE=hr_schema_dp.dmp FLASHBACK_SCN=3488839
c) RMAN> backup database plus archivelog ;
RMAN> duplicate target database to <databasename>
nofilenamecheck until scn <value returned from “RMAN
restore database preview summary” command> (see Notes 369644.1 and
1079563.1)
2. Start of the replicat process (depending on instantiation method)
START REPLICAT <name> AFTERCSN <3488839>
START REPLICAT <name> ATCSN <3488839>

30 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.


Instantiation without the Determination of an
SCN
ƒ HANDLECOLLISIONS (Replicat Parameter) has to be used

ƒ Works fine if Primary Key / Unique Index available


ƒ Tables without Primary Key / Unique Index
ƒ Duplicate rows in case of insert statements
ƒ Described in Oracle GoldenGate Installation and Setup Guide
Use the HANDLECOLLISIONS and NOHANDLECOLLISIONS parameters to control whether or not
Replicat tries to resolve duplicate-record and missing-record errors when applying SQL on the
target. These errors can occur during an initial load, when data from source tables is being
loaded to target tables while Oracle GoldenGate is replicating transactional changes that are
being made to those tables. When Oracle GoldenGate applies the replicated changes after the
load is finished, HANDLECOLLISIONS causes Replicat to overwrite duplicate records in the target
tables and provides alternate handling of errors for missing records

31 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.


Instantiation with GoldenGate

32 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.


Agenda

ƒ GoldenGate Architecture

ƒ GoldenGate 11.2 Classic Capture vs. Integrated Capture

ƒ Zero Downtime Migrations

ƒ Instantiation Methods for the Target Database

ƒ Sizing Aspects

ƒ Setup of Oracle GoldenGate Including a Failback Environment

33 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.


Determine the Resource Usage
of the Source Environment
ƒ Oracle
– Oracle Enterprise Manager
– AWR reports
ƒ Unix
– sar
– iostat
– vmstat

34 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.


Example:
I/O Determined by AWR Report
Load profile
~~~~~~~~~~~~ Per Second Per Transaction
--------------- ---------------
Redo size: 18,884,730.34 72,451.84
Logical reads: 26,685.24 102.38
Block changes: 16,810.84 64.50
Physical reads: 272.99 1.05
Physical writes: 2,170.07 8.33
User calls: 2,597.49 9.97
Parses: 521.30 2.00
Hard parses: 0.05 0.00
Sorts: 1.37 0.01
Logons: 0.05 0.00
Executes: 523.53 2.01
Transactions: 260.65

35 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.


Example:
Avg CPU Usage Determined by AWR Report

Statistic Total per Second per Trans


-------------------------------- ------------------ -------------- -------------
CPU used by this session 40,637 44.0 0.2
CPU used when call started 40,431 43.7 0.2
CR blocks created 6 0.0 0.0
Cached Commit SCN referenced 476 0.5 0.0
Commit SCN cached 1 0.0 0.0
DB time 572,703 619.5 2.4
DBWR checkpoint buffers written 83,867 90.7 0.4
DBWR checkpoints 33 0.0 0.0
DBWR fusion writes 2,253 2.4 0.0
DBWR object drop buffers written 0 0.0 0.0
DBWR thread checkpoint buffers w 19,530 21.1 0.1

36 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.


Example:
PGA Usage Determined by AWR Report
PGA Memory Advisory DB/Inst: TEST/TEST1 Snap: 8315

-> When using Auto Memory Mgmt, minimally choose a pga_aggregate_target value
where Estd PGA Overalloc Count is 0

Estd Extra Estd PGA Estd PGA


PGA Target Size W/A MB W/A MB Read/ Cache Overalloc
Est (MB) Factr Processed Written to Disk Hit % Count
---------- ------- ---------------- ---------------- -------- ----------
13 0.1 552.6 13.2 98.0 5
25 0.3 552.6 13.2 98.0 5
50 0.5 552.6 0.0 100.0 0
75 0.8 552.6 0.0 100.0 0
100 1.0 552.6 0.0 100.0 0
120 1.2 552.6 0.0 100.0 0
140 1.4 552.6 0.0 100.0 0
160 1.6 552.6 0.0 100.0 0
180 1.8 552.6 0.0 100.0 0
200 2.0 552.6 0.0 100.0 0
300 3.0 552.6 0.0 100.0 0
400 4.0 552.6 0.0 100.0 0
600 6.0 552.6 0.0 100.0 0

37 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.


Example:
SGA Usage Determined by AWR Report
SGA Target Advisory DB/Inst: ORA1/ORA1P5 Snap: 8315

SGA Target SGA Size Est DB Est Physical


Size (M) Factor Time (s) Reads
---------- ---------- ------------ ----------------
150 0.5 7,535 139,852
225 0.8 7,416 123,298
300 1.0 7,381 118,408
375 1.3 7,356 117,413
450 1.5 7,339 115,022
525 1.8 7,339 115,022
600 2.0 7,339 115,022
-------------------------------------------------------------

38 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.


Example:
Buffer Pool Usage Determined by AWR Report
Buffer Pool Advisory DB/Inst: ORA1/ORA1P5 Snap: 8315
-> Only rows with estimated physical reads >0 are displayed
-> ordered by Block Size, Buffers For Estimate
Est
Phys
Size for Size Buffers for Read Estimated
P Est (M) Factor Estimate Factor Physical Reads
--- -------- ------ ---------------- ------ ------------------
D 112 .6 13,636 1.1 124,799
D 128 .7 15,584 1.0 122,965
D 144 .8 17,532 1.0 121,753
D 160 .8 19,480 1.0 120,741
D 176 .9 21,428 1.0 119,683
D 192 1.0 23,376 1.0 118,657
D 208 1.1 25,324 1.0 117,740
D 224 1.2 27,272 1.0 116,939

39 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.


Dedicated Server Processes
ƒ The storage used by dedicated server threads can be calculated as follows:

ƒ Max(logons current) multiplied by storage used per thread

ƒ Storage used per thread is 5MB (Calculated on an idle system by opening


a sqlplus session. The storage usage was monitored with the Linux free
command

40 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.


Agenda

ƒ GoldenGate Architecture

ƒ GoldenGate 11.2 Classic Capture vs. Integrated Capture

ƒ Zero Downtime Migrations

ƒ Instantiation Methods for the Target Database

ƒ Sizing Aspects

ƒ Setup of Oracle GoldenGate Including a Failback Environment

41 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.


Example – Zero Downtime Migration with
Oracle GoldenGate
ƒ Simple Example of a zero downtime migration

– Installation/configuration of GoldenGate on source and


target environment

– Classic Capture is used

– No DDL replication is performed

42 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.


Zero Downtime Migration with Oracle
GoldenGate
ƒ Replication Environment

PAZXXT08 PAZXXT09

Extract
Capt01 Replicat
Trail File Apply01
Schema srcusr rt
Schema trgtusr

Expdp/impdp

43 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.


Zero Downtime Migration with Oracle
GoldenGate
ƒ Failback Environment

PAZXXT08 PAZXXT09

replicat Extract
Trail files
applyf01 captf01
ft
Schema srcusr Schema trgtusr

44 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.


Example – Zero Downtime Migration with
Oracle GoldenGate
Oracle GoldenGate Command Interpreter for OracleVersion 11.2.1.0.2 OGGCORE_11.2.1.0.2T3_PLATFORMS_120724.2205

Linux, s390x, 64bit (optimized), ......

GGSCI (PAZXXT08) 3> dblogin userid gg112, password gg112

Successfully logged into database.

GGSCI (PAZXXT08) 4> add trandata srcusr.*

2013-01-15 03:40:29 WARNING OGG-00869 No unique key is defined for table 'DEPT'. All viable columns will

be used to represent the key, but may not guarantee uniqueness. KEYCOLS may be used to define the key.

Logging of supplemental redo data enabled for table SRCUSR.DEPT.

Logging of supplemental redo data enabled for table SRCUSR.EMP.

45 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.


Example – Zero Downtime Migration with
Oracle GoldenGate
GGSCI (PAZXXT08) 3> EDIT PARAMS capt01

Extract capt01

Userid gg112, password gg112

Rmthost pazxxt09.us.oracle.com , mgrport 1960

Rmttrail /home/oracle/GG_TRGT/rt

Table srcusr.*;

GGSCI (PAZXXT08) 4> add extract capt01,tranlog,begin now

EXTRACT added.

GGSCI (PAZXXT08) 5> add rmttrail /home/oracle/GG_TRGT/rt, EXTRACT capt01

RMTTRAIL added

46 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.


Example – Zero Downtime Migration with
Oracle GoldenGate

GGSCI (PAZXXT09) 2> dblogin userid gg112 password gg112

Successfully logged into database.

GGSCI (PAZXXT09) 3> add checkpointtable gg112.chkptab

Successfully created checkpoint table gg112.chkptab.

GGSCI (PAZXXT09) 1> edit params ./GLOBALS

checkpointtable gg112.chkptab

GGSCI (PAZXXT09) 1> add replicat apply01, exttrail /home/oracle/GG_TRGT/rt

47 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.


Example – Zero Downtime Migration with
Oracle GoldenGate
GGSCI (PAZXXT09) 1> EDIT PARAMS APPLY01

REPLICAT apply01

setenv (ORACLE_SID = "trgt")

SETENV (NLS_LANG = "AMERICAN_AMERICA.WE8MSWIN1252")

assumetargetdefs

userid gg112, password gg112

MAP srcusr.*, target trgtusr.*;

48 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.


Example – Zero Downtime Migration with
Oracle GoldenGate
Preparation of the failback environment
GGSCI (PAZXXT09) 22> edit params captf01

extract captf01

Userid gg112, password gg112

Rmthost pazxxt08.us.oracle.com , mgrport 1860

Rmttrail /home/oracle/GG_SRC/ft

Table trgtusr.*;

GGSCI (PAZXXT09) 4> add extract captf01,tranlog,begin now

EXTRACT added.

GGSCI (PAZXXT09) 5> add rmttrail /home/oracle/GG_SRC/ft, EXTRACT captf01

RMTTRAIL added

49 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.


Example – Zero Downtime Migration with
Oracle GoldenGate
Preparation of the failback environment
Oracle GoldenGate Command Interpreter for Oracle

Version 11.2.1.0.2 OGGCORE_11.2.1.0.2T3_PLATFORMS_120724.2205

Linux, s390x, 64bit (optimized), ......

GGSCI (PAZXXT09) 2> dblogin userid gg112, password gg112

Successfully logged into database.

GGSCI (PAZXXT09) 3> add trandata trgtusr.*

2013-01-24 04:21:27 WARNING OGG-00869 No unique key is defined for table 'DEPT'. All viable columns will be
used to represent the key, but may not guarantee uniqueness. KEYCOLS may be used to define the key.

Logging of supplemental redo data enabled for table TRGTUSR.DEPT.

Logging of supplemental redo data enabled for table TRGTUSR.EMP.

50 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.


Example – Zero Downtime Migration with
Oracle GoldenGate
Preparation of the failback environment
GGSCI (PAZXXT08) 8> edit params applyf01

REPLICAT applfy01

setenv (ORACLE_SID = "orcl")

SETENV (NLS_LANG = "AMERICAN_AMERICA.WE8MSWIN1252")

assumetargetdefs

userid gg112, password gg112

mAP trgtusr.*, target srcusr.*;

51 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.


Example – Zero Downtime Migration with
Oracle GoldenGate
Preparation of the failback environment
GGSCI (PAZXXT08) 2> dblogin userid gg112 password gg112

Successfully logged into database.

GGSCI (PAZXXT08) 3> add checkpointtable gg112.chkptab

Successfully created checkpoint table gg112.chkptab.

GGSCI (PAZXXT08) 1> edit params ./GLOBALS

checkpointtable gg112.chkptab

GGSCI (PAZXXT08) > add replicat applyf01, exttrail /home/oracle/GG_SRC/ft, checkpointtable gg112.chkptab

52 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.


Example – Zero Downtime Migration with
Oracle GoldenGate
ƒ Step 1 Start capture process
GGSCI (PAZXXT08) 22> start capt01

Sending START request to MANAGER ...


EXTRACT CAPT01 starting

ƒ Step 2 - Instantiate the target database


SQL> SELECT DBMS_FLASHBACK.GET_SYSTEM_CHANGE_NUMBER FROM DUAL;
GET_SYSTEM_CHANGE_NUMBER
------------------------
33301382
expdp gg112 SCHEMAS=srcusr DIRECTORY=DUMP_DIR
DUMPFILE=src_usr_schema_dp.dmp FLASHBACK_SCN=33301382

53 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.


Example – Zero Downtime Migration with
Oracle GoldenGate
ƒ Step 2 - Instantiate the target database (continued)

On Target:
impdp gg112 DIRECTORY=DUMP_DIR DUMPFILE=src_usr_schema_dp.dmp
remap_schema=srcusr:trgtusr

ƒ Step 3 – Start apply process


GGSCI (PAZXXT09) 22> start apply01 aftercsn 33301382

54 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.


Example – Zero Downtime Migration with
Oracle GoldenGate
ƒ Step 4 – Wait until source and target database are in
sync
On Target:

GGSCI (PAZXXT09) 24> lag apply01

Sending GETLAG request to REPLICAT APPLY01 ...


Last record lag: 2 seconds.
At EOF, no more records to process.

55 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.


Example – Zero Downtime Migration with
Oracle GoldenGate
ƒ Step 5 – Stop the application
Wait until all changes are processed (check statistics)
GGSCI (PAZXXT08) 1> lag capt01

Sending GETLAG request to EXTRACT CAPT01 ...


Last record lag: 2 seconds.
At EOF, no more records to process.

56 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.


Example – Zero Downtime Migration with
Oracle GoldenGate
ƒ Step 5a – Stop the GoldenGate pocesses
GGSCI (PAZXXT08) 4> stop extract capt01

Sending STOP request to EXTRACT CAPT01 ...


Request processed.

ƒ Repeat those steps (5+5a) for all capture, pump and apply
processes

57 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.


Example – Zero Downtime Migration with
Oracle GoldenGate
ƒ Step 6 – Start the GoldenGate processes for the failback
ƒ Set starting point of failback apply process

GGSCI (PAZXXT09) 30> alter captf01 begin now


EXTRACT altered.
GGSCI (PAZXXT09) 31> alter extract captf01 etrollover
2013-01-24 04:35:35 INFO OGG-01520 Rollover performed.
For each affected output trail of Version 10 or higher format, after starting the source extract, issue ALTER
EXTSEQNO
for that trail's reader (either pump EXTRACT or REPLICAT) to move the reader's scan to the new trail file; it will
not happen automatically.
EXTRACT altered.

58 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.


Example – Zero Downtime Migration with
Oracle GoldenGate
GGSCI (PAZXXT09) 32> info captf01 detail
EXTRACT CAPTF01 Initialized 2013-01-24 04:34 Status STOPPED
Checkpoint Lag 00:01:10 (updated 00:00:18 ago)
Log Read Checkpoint Oracle Redo Logs
2013-01-24 04:34:25 Seqno 0, RBA 0
SCN 0.0 (0)
Target Extract Trails:
Remote Trail Name Seqno RBA Max MB
/home/oracle/GG_SRC/ft 2 0 100
Target:
GGSCI (PAZXXT08) 33> alter applyf01 extseqno 2
REPLICAT altered.

GGSCI (PAZXXT08) 34> alter applyf01 extrba 0


REPLICAT altered.

59 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.


Example – Zero Downtime Migration with
Oracle GoldenGate
ƒ Step 6 (continued)
– Start captf01 („new“ environment)
– Start Applyf01

ƒ Step 7 – Switch the application

60 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.


Example – Zero Downtime Migration with
Oracle GoldenGate
ƒ Things to consider

ƒ Before starting the instantiation of the target database,


no long running transactions should be active, because
of possible data loss. Long running transactions can be
monitored with the v$transaction view.

61 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.


More Information
ƒ General information
http://www.oracle.com/us/products/middleware/data-integration/
goldengate/overview/index.html
http://www.oracle.com/technetwork/middleware/goldengate/overview/index.html

ƒ Oracle GoldenGate Zero Downtime Migrations


http://www.oracle.com/technetwork/middleware/goldengate/overview/ggzerodowntime
databaseupgrades-174928.pdf

ƒ Oracle GoldenGate Statement of Direction


http://www.oracle.com/technetwork/middleware/goldengate/overview/statement-of-
direction-gg-132120.pdf

62 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.


63 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.
64 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Vous aimerez peut-être aussi