Sie sind auf Seite 1von 64

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

1
Zero Downtime Migrations
using Oracle GoldenGate
Thomas Niewel
Principal Sales Consultant
Copyright 2013, Oracle and/or its affiliates. All rights reserved. 3
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 Oracles products
remains at the sole discretion of Oracle.
Copyright 2013, Oracle and/or its affiliates. All rights reserved. 4
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
Copyright 2013, Oracle and/or its affiliates. All rights reserved. 5
Oracle GoldenGate
Low-Impact Real-Time Data Integration & Transactional Replication
New DB/HW/OS/APP
Fully Active Distributed DB
Reporting Database
Data Warehouse
Global Data Centers
ODS
Data Integrator
Zero Downtime Upgrade
& Migration
Query Offloading,
Disaster Recovery
Data Synchronization
across the Enterprise
Real-time BI, Operational
Reporting, MDM
Highly Available /
Disaster Recovery
Log-based,
changed data
Database
Message Bus
Legacy
Message Bus
Event Driven
Architecture, SOA
Copyright 2013, Oracle and/or its affiliates. All rights reserved. 6
Unidirectional
Query Offloading
Zero-Downtime Migration
Bi-Directional
Hot Standby or
Active-Active for HA
Peer-to-Peer
Load Balancing
Multi-Master
Broadcast
Data Distribution
Integration/Consolidation
Data Warehouse
BPM
BAM
CEP
Data Distribution
via Messaging
Oracle GoldenGate Topologies
Copyright 2013, Oracle and/or its affiliates. All rights reserved. 7 7
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
Copyright 2013, Oracle and/or its affiliates. All rights reserved. 8
GoldenGate Architecture
Source: Oracle GoldenGate Windows and UNIX Administrators Guide
Copyright 2013, Oracle and/or its affiliates. All rights reserved. 9
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
Copyright 2013, Oracle and/or its affiliates. All rights reserved. 10
How GoldenGate Works
Source: Oracle GoldenGate Windows and UNIX Administrators Guide
Copyright 2013, Oracle and/or its affiliates. All rights reserved. 11
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
Copyright 2013, Oracle and/or its affiliates. All rights reserved. 12
GoldenGate 11.2 Classic Capture
Source: Oracle GoldenGate Windows and UNIX Administrators Guide
Copyright 2013, Oracle and/or its affiliates. All rights reserved. 13
GoldenGate 11.2 Integrated Capture
Source: Oracle GoldenGate Windows and UNIX Administrators Guide
Integrated Capture: See note 1411356.1 for Oracle 11.2.0.3 required patches
Copyright 2013, Oracle and/or its affiliates. All rights reserved. 14
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)
Copyright 2013, Oracle and/or its affiliates. All rights reserved. 15
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
Copyright 2013, Oracle and/or its affiliates. All rights reserved. 16
Some important Features Classic Capture Integrated Capture
Compression (Basic, OLTP,
EHCC)
X
XML
Partially
Mutithreaded
X
RAC with PDML
With Restrictions
RAC with XA
With Restrictions
GoldenGate 11.2
Integrated Capture vs. Classic Capture
More details: Oracle GoldenGate for Oracle Installation and Setup Guide Chapter 1.4
Copyright 2013, Oracle and/or its affiliates. All rights reserved. 17
GoldenGate 11.2
Integrated Capture vs. Classic Capture
Database Version Classic Capture Integrated Capture
10.2 Supported Supported *
11.1.0.7
TDE/TSE, Fetch support for
SecureFiles, ADTs, VARRAYS,
Nested Tables, Object Tables
Supports TDE/TSE *
11.2.0.2
TDE/TSE, Fetch support for
SecureFiles, ADTs, VARRAYS,
Nested Tables, Object Tables
TDE/TSE, XA-RAC, Compression,
SecureFiles, Fetch support for
ADTs, VARRAYS, Nested Tables,
Object Tables *
11.2.0.3
TDE/TSE Fetch support for
SecureFiles, ADTs, VARRAYS,
Nested Tables, Object Tables
TDE/TSE, XA-RAC, Compression,
XML Object Relational, XML
Binary, SecureFiles,Fetch support
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
Copyright 2013, Oracle and/or its affiliates. All rights reserved. 18
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
Copyright 2013, Oracle and/or its affiliates. All rights reserved. 19
Zero Downtime Migration
with Oracle GoldenGate
Example 1: near-zero-downtime upgrade with GoldenGate
extract
Old environment
+Diskgroup
+ ASM
Linux guest new
+ ASM
replicat
+Diskgroup
pump
Copyright 2013, Oracle and/or its affiliates. All rights reserved. 20
Zero Downtime Migration
with Oracle GoldenGate
Example 1: near-zero-downtime upgrade with GoldenGate
Old environment
+Diskgroup
Linux guest new
replicat
+Diskgroup
pump
SCN=4711
SCN on source is 4711
Step 1: Start extract and pump process
SCN=4711
......
+ ASM + ASM
extract
Copyright 2013, Oracle and/or its affiliates. All rights reserved. 21
Zero Downtime Migration
with Oracle GoldenGate
Example 1: near-zero-downtime upgrade with GoldenGate
extract
Old environment
+Diskgroup
Linux guest new
replicat
+Diskgroup
pump
SCN=4750
Step 2: export/import with consistent SCN 4750
SCN=4711
.....
export/import
SCN 4750
+ ASM
+ ASM
Copyright 2013, Oracle and/or its affiliates. All rights reserved. 22
Zero Downtime Migration
with Oracle GoldenGate
Example 1: near-zero-downtime upgrade with GoldenGate
extract
Old environment
+Diskgroup
Linux guest new
replicat
+Diskgroup
pump
SCN=4790
Step 3: Start replicat with SCN 4750
replicat process applies changes until databases are in sync
SCN=4711
.....
SCN 4750
+ ASM + ASM
Copyright 2013, Oracle and/or its affiliates. All rights reserved. 23
Zero Downtime Migration
with Oracle GoldenGate
Example 1: near-zero-downtime upgrade with GoldenGate
Extract
failback
Old environment
+Diskgroup
Linux guest new
+Diskgroup
Pump
failback
Step 4: Application can be stopped
Replication can be stopped and started in the opposite direction
Application can be started on the new database
replicat
failback
+ ASM + ASM
Copyright 2013, Oracle and/or its affiliates. All rights reserved. 24
Oracle
GoldenGate
Capture
Oracle
GoldenGate
Delivery
Oracle 10.2
on Linux
Oracle 10.2 Clone Oracle
Database 11g
Linux
Oracle 11g on
Linux for z
Zero Downtime Migration
Oracle 10.2 Oracle 11g Cross-Platform (Linux x86 to Linux for z)
Example 2: near-zero-downtime upgrade with GoldenGate
1. Start of the Oracle GoldenGate capture process
2. Create of a clone database; after that upgrade to Oracle 11g
3. Cross platform transportable tablespace metadata export
4. Use of a full database NOROWS export (Views, Packages, etc)
of the Clone DB
5. Installation of a new Oracle 11g Database on Linux for z
6. Cross platform transportable tablespaces
metadata Import and transfer of the datafiles with
conversion of the endianess
7. Full Import with IGNORE option
8. Start Oracle GoldenGate Delivery on Linux for z
Copyright 2013, Oracle and/or its affiliates. All rights reserved. 25
9. Wait until source and target database are in sync
10. Stop the application and wait until all data is processed
Failback option
Oracle 10.2
Linux
Oracle 10.2 Clone Oracle
11g Linux
Oracle Database 11g
Linux for z
Zero Downtime Migration
Oracle 10.2 Oracle 11g Cross-Platform (Linux x86 to Linux for z)
Example 2: near-zero-downtime upgrade with GoldenGate
11. Start Oracle GoldenGate Capture on the z/Linux platform
12. Start Oracle GoldenGate Delivery on the Linux platform
13. **SWITCHOVER** of the application
Copyright 2013, Oracle and/or its affiliates. All rights reserved. 26
Things to Consider
Trigger
Disable triggers
Replicat parameter DBOPTIONS SUPPRESSTRIGGERS
Referential integrity
Disable cascading delete constraints on target
Replicat parameter DBOPTIONS DEFERREFCONST
Copyright 2013, Oracle and/or its affiliates. All rights reserved. 27
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
Copyright 2013, Oracle and/or its affiliates. All rights reserved. 28
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
Copyright 2013, Oracle and/or its affiliates. All rights reserved. 29
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
..
Copyright 2013, Oracle and/or its affiliates. All rights reserved. 30
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>
Copyright 2013, Oracle and/or its affiliates. All rights reserved. 31
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
Copyright 2013, Oracle and/or its affiliates. All rights reserved. 32
Instantiation with GoldenGate
Copyright 2013, Oracle and/or its affiliates. All rights reserved. 33
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
Copyright 2013, Oracle and/or its affiliates. All rights reserved. 34
Determine the Resource Usage
of the Source Environment
Oracle
Oracle Enterprise Manager
AWR reports
Unix
sar
iostat
vmstat
Copyright 2013, Oracle and/or its affiliates. All rights reserved. 35
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
Copyright 2013, Oracle and/or its affiliates. All rights reserved. 36
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
Copyright 2013, Oracle and/or its affiliates. All rights reserved. 37
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
Example:
PGA Usage Determined by AWR Report
Copyright 2013, Oracle and/or its affiliates. All rights reserved. 38
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
-------------------------------------------------------------
Copyright 2013, Oracle and/or its affiliates. All rights reserved. 39
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
Copyright 2013, Oracle and/or its affiliates. All rights reserved. 40
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
Copyright 2013, Oracle and/or its affiliates. All rights reserved. 41
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
Copyright 2013, Oracle and/or its affiliates. All rights reserved. 42
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
Copyright 2013, Oracle and/or its affiliates. All rights reserved. 43
Zero Downtime Migration with Oracle
GoldenGate
Replication Environment
Extract
Capt01
Schema srcusr
Replicat
Apply01
Schema trgtusr
Expdp/impdp
Trail File
rt
PAZXXT09
PAZXXT08
Copyright 2013, Oracle and/or its affiliates. All rights reserved. 44
Zero Downtime Migration with Oracle
GoldenGate
Failback Environment
Extract
captf01
PAZXXT08
Trail files
ft
replicat
applyf01
PAZXXT09
Schema srcusr Schema trgtusr
Copyright 2013, Oracle and/or its affiliates. All rights reserved. 45
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.
Copyright 2013, Oracle and/or its affiliates. All rights reserved. 46
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
Copyright 2013, Oracle and/or its affiliates. All rights reserved. 47
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
Copyright 2013, Oracle and/or its affiliates. All rights reserved. 48
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.*;
Copyright 2013, Oracle and/or its affiliates. All rights reserved. 49
Example Zero Downtime Migration with
Oracle GoldenGate
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
Preparation of the failback environment
Copyright 2013, Oracle and/or its affiliates. All rights reserved. 50
Example Zero Downtime Migration with
Oracle GoldenGate
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.
Preparation of the failback environment
Copyright 2013, Oracle and/or its affiliates. All rights reserved. 51
Example Zero Downtime Migration with
Oracle GoldenGate
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.*;
Preparation of the failback environment
Copyright 2013, Oracle and/or its affiliates. All rights reserved. 52
Example Zero Downtime Migration with
Oracle GoldenGate
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
Preparation of the failback environment
Copyright 2013, Oracle and/or its affiliates. All rights reserved. 53
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
Copyright 2013, Oracle and/or its affiliates. All rights reserved. 54
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
Copyright 2013, Oracle and/or its affiliates. All rights reserved. 55
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.
Copyright 2013, Oracle and/or its affiliates. All rights reserved. 56
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.
Copyright 2013, Oracle and/or its affiliates. All rights reserved. 57
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
Copyright 2013, Oracle and/or its affiliates. All rights reserved. 58
Example Zero Downtime Migration with
Oracle GoldenGate
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.
Step 6 Start the GoldenGate processes for the failback
Set starting point of failback apply process
Copyright 2013, Oracle and/or its affiliates. All rights reserved. 59
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.
Copyright 2013, Oracle and/or its affiliates. All rights reserved. 60
Example Zero Downtime Migration with
Oracle GoldenGate
Step 6 (continued)
Start captf01 (new environment)
Start Applyf01
Step 7 Switch the application
Copyright 2013, Oracle and/or its affiliates. All rights reserved. 61
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.
Copyright 2013, Oracle and/or its affiliates. All rights reserved. 62
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
Copyright 2013, Oracle and/or its affiliates. All rights reserved. 63
Copyright 2013, Oracle and/or its affiliates. All rights reserved. 64

Das könnte Ihnen auch gefallen