Professional Documents
Culture Documents
Abstract:
Eliminating database downtime poses a significant challenge for IT organizations that need to upgrade or migrate
mission-critical database environments running Oracle database software versions 8i or 9i to Oracle 10g or 11g. That
is particularly true for critical applications that must provide continuous or near-continuous operations to users who
increasingly expect uninterrupted availability of online service. Any outage of an application or website, even if that
outage is scheduled or “planned,” has an impact on the revenue and reputation of the business.
The purpose of this paper is to present a solution that tackles the specific challenge of upgrading or migrating an
Oracle 8i or 9i database to Oracle software version 10g or 11g – without taking any database downtime. Key technology
components used in this solution are GoldenGate Software’s platform for transactional data management and Oracle’s
Cross Platform Transportable Tablespace feature.
The details within this paper will showcase key technical strengths of the solution, including how to achieve a
rolling upgrade/migration for this scenario; using a clone database to offload instantiation and conversions; keeping
transactions in synch across the databases; managing “partial” or phased migrations or upgrades; conducting data
verification post-upgrade/migration; and implementing an easy and reliable failover strategy.
Table of Contents
Section Page Number
1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
2. Goals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
3. Concepts and Terminology . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
GoldenGate’s Technology for Transactional Data Management . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
Database Upgrade . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
Database Migration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
Standby Database . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
Transportable Tablespace . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
Cross Platform Transportable Tablespace . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
Clone Database . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
RMAN (Recovery Manager) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
4. A Zero-Downtime Approach Using GoldenGate and Oracle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
Upgrade vs. Migration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
5. Upgrade and Migration Challenges . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
Business Challenges . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
Technical Challenges . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
6. Available Solutions: 8i or 9i ➔ 10g or 11g Upgrade or Migration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
Database Upgrade Assistant . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
Export/Import . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
SQL Plus As Copy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
Transportable Tablespaces . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
SQL*Loader . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
Oracle Data Guard, Oracle Streams . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
The GoldenGate Zero-Downtime Upgrades Solution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
7. Overview of GoldenGate’s Technology Components . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
Capture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
On-Disk Queues aka “Trail files” . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
Delivery (Apply) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
GoldenGate Veridata® . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
8. Overview of The Oracle Cross Platform Transportable Tablespace Feature . . . . . . . . . . . . . . . . . . . . . . . . 13
9. Detailed Steps Using a Platform Migration Case Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
Migration without Failback . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
Migration with Failback . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
Failback Steps . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
Partial Migration Using Bi-Directional Synchronization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
10. Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
About the Author . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
2. GOALS
This paper is created primarily for advanced database users.
The main goal of this paper is to increase awareness of a solution for minimizing database downtime
during a database upgrade or migration under the circumstances outlined in the introduction. As such,
resource issues such as disk space, software-licensing costs, etc., are not discussed – not because such
issues are unimportant, but because the need to minimize downtime or completely avoid it outweighs other
considerations in demanding high availability environments.
Furthermore, this document is not intended to repeat the upgrade steps, typical warnings, and preparatory
details associated with an Oracle database upgrade. There are many articles and notes that exist on the
Oracle MetaLink customer support portal, in various books, and on the web, which are helpful towards
understanding the operational procedures and complexities associated with upgrades and migrations.
As one of the lead developers of the Cross Platform Transportable Tablespace feature in 10g at Oracle,
I struggled with minimizing downtime when migrating very large 8i or 9i databases from one platform to
another. My aim therefore is to present a novel solution that allows for a database upgrade/migration from
8i or 9i to 10g/11g without taking database downtime or having to make tablespaces read-only, or take any
locks. The solution presented leverages the benefits of real-time synchronization, clone databases, rolling
upgrades, transportable and cross-platform transportable tablespaces, and failback. Every effort is made to
avoid overhead at the primary database to ensure application availability (activities such as instantiation, file
conversion for cross platform transport, etc., are offloaded to a clone).
A secondary goal is also to explain how to minimize the “wall clock time” required to perform the entire
upgrade. Experienced users will realize that wall clock time can be on the order of days or weeks, yet the
downtime to the application can still be near zero. The key here, as will be explained in the following pages,
is to offload work processing to additional database copies.
3.2.1 In place
An in-place upgrade renders the database inaccessible for business applications while the database software
is being upgraded. This procedure entails running an upgrade script (e.g. for u0902000.sql), recompiling
invalid PL/SQL etc., and experiencing downtime that is usually not acceptable in most mission-critical
environments.
The intent of this paper is to not to address in-place upgrades.
5.2.1 Instantiation
The first problem that needs to be addressed when performing a rolling upgrade is choosing the method
by which the target database is instantiated. In other words, how do you create a first version of the target
database?
The complexity of the problem is magnified when the target database is on a different platform, since physical
backups cannot simply be restored at the target and converted into a clone.
To handle multi-terabyte sized databases, procedures such as export/import are tedious and error prone.
Failures during the instantiation or global data consistency are not adequately addressed with methods that
are time consuming, unless some form of locking is used. Extracting data from the production database
over a period of time results in a performance impact on the source database that is unacceptable. There’s
also interference with the normal mechanics of the database cache manager affecting buffer allocation and
flushing algorithms, resource management algorithms, etc., since the typical OLTP database is not optimized
to handle long running queries, table scans, etc.
A good instantiation solution therefore must properly address:
½½ Global data consistency
½½ Efficiency (speed)
½½ Performance (i.e. low impact on the production database)
½½ Manageability
Time
T1 T3 T100
3. The instantiation method picks up a read consistent version of table SLAVE as of SCN 23.12777.
Route
LAN/WAN/Web/IP
4. Transaction TM inserts new row R1 into table MASTER at SCN 24.12890.
There are several problems
Delivery
with this method. First, how are transactions
Target Trail
handled
Source Trail
that are active as of SCN
Capture
23.12360 but commit after SCN 23.98745? Second, the MASTER and SLAVE tables are from different points
in time, and as a result are inconsistent with each other from a referential integrity point of view. And third,
the data submitted subsequent to SCN 23.12360 for the MASTER table (in this case row R1) still needs to
be moved.
Thus, a good solution that addresses incremental data movement must:
Compare & Verify
i) Ensure global consistency
ii) Identify a clean instantiation termination point
iii) Allow transactions from that point onward to be propagated to the target database
Capture
iv) Handle any failures during incremental data propagation (e.g. loss of network, media failure, etc.)
2 3 6 7
exp_norows.dmp
exp_xtts.dmp
Dprod Dprod backup Dpitr
9i / Sun Solaris 9i ➔ 10g
4 Sun Solaris
© 2009 GoldenGate Software, Inc.
7
8
white paper
5.2.7 Verification
Testing that the source and target database are synchronized needs to be conducted post upgrade/migration
— any out-of-synch conditions at the new source and/or failback database could pose risks to the business
and should be identified and acted upon. Conducting this verification should be possible even as ongoing
transactions are being processed at the source database.
A good solution must therefore address fast and efficient comparison of data across the two databases,
i.e. the database should not acquire any locks during the verification period. In-flight transactions must be
accounted for during the comparison.
5.2.8 Failback
Once the upgrade/migration takes place, a failback strategy must be in place to avoid any downtime and
data loss in case the new environment is not stable. Therefore, all transactions that have been processed
at the target (the new production database) need to be propagated to the original production database in a
consistent and manageable manner for a successful failback.
1. From Oracle 9.2 to Oracle 10g+ it may work for very limited data types and low-volume databases.
2. Requires transient logical standby and does not allow the use of standby systems for failover during the upgrade process.
3. May work for limited data types and low-volume databases.
Figure 3: An Overview of Downtime Categories for Different Solutions, Given Various Oracle Upgrade
and Migration Scenarios
There are a number of possible solutions that may be evaluated to help with a project to move onto 10g or 11g. The
figure above (Figure 3) depicts whether these solutions support different possible migration or upgrade scenarios,
along with associated time categories—from extended downtime to real-time switchover.
Those and several other common methods and solutions are summarized below with their respective advantages
and disadvantages, illustrating where significant shortfalls exist for environments seeking minimal downtime and high
availability:
6.2 Export/Import
A full export can be done from an 8i or 9i database, followed by an import into an existing vanilla 10g database.
For Oracle 10g to 11g upgrades you can use the Data Pump Export utility and import the data into an existing
vanilla 11g database using Data Pump Import. Oracle’s Export utility extracts data from the database and
writes it to a proprietary file (called an export dump file). Import processes the data and recreates all the
objects (tables, indexes, packages, etc.). Thus the time required for an export/import upgrade is high. With
Oracle 10g Data Pump you can parallelize the process more easily but the time required will be still significant.
An export in FULL mode does have advantages in that it moves all database objects; it also supports both
upgrades and migrations. However, in a high availability environment, there are three significant disadvantages
to using Export/Import:
1. V
olume-Time Relationship: The time required to extract the data is dependent on the size of the data.
Extracting and reinserting high volumes of data can take days or even weeks for large databases.
2. Ongoing Transactions: Ongoing changes are not captured by Export, nor is there a way to demarcate
the boundaries across SCNS that allow the incremental data to be re-exported. This effectively
implies application downtime during the export/import process.
3. Recoverability: Failures during export and/or import are not easy to recover from.
Time
T1 T3 T100
7. OVERVIEW OF GOLDENGATE’S TECHNOLOGY COMPONENTS
There are a number of key technology components that comprise GoldenGate’s software platform and are
relevant to the subject at hand
Route
LAN/WAN/Web/IP
Figure 4: H
igh-Level Architecture Diagram of Goldengate’s Software Products, Running
Bi-Directionally and Verifying Data Between Two Databases
Capture
7.1 Capture 2 3 6 7
8
Apply
© 2009 GoldenGate Software, Inc.
12
11 12
Failover IGNORE = Y
7.3 Delivery (Apply)
The GoldenGate® Delivery process runs on the target system. It reads the captured data from the Trail Files
and applies the captured transactions at the target using dynamic SQL. To maintain synchronization between
the source and target databases, GoldenGate applies data changes to the target tables using native database
calls, statement caches, and local database access. To ensure data and referential integrity, GoldenGate
applies data changes in the transaction commit order that occurred at the source database.
Route
LAN/WAN/Web/IP
Capture
2 3 6 7
exp_norows.dmp
exp_xtts.dmp
Dprod Dprod backup Dpitr
9i / Sun Solaris 9i ➔ 10g
4 Sun Solaris
8
Apply
11 12
IGNORE = Y
10
13
Compare & Verify
5 Dtarget
10g Linux
Route
LAN/WAN/Web/IP
8. Plug the set of tablespaces from Dpitr into Dtarget using the Cross Platform Transportable Tablespace
feature. Use the exp_xtts.dmp file created from Step 7. Note that the plugged in tablespaces are in
read-only mode.
Compare & Verify
9. Make the set of user tablespaces in Dtarget Read Write. (Not depicted)
10. Do a NOROWS import with IGNORE=Y option at Dtarget using the exp_norows.dmp dump file.
11. Start GoldenGate Apply process at Dtarget and synchronize up to the changes generated since
Qscn. Capture
Capture
2 3 6 7
exp_norows.dmp
exp_xtts.dmp
Dprod Apply Dprod backup Dpitr
9i / Sun Solaris 9i ➔ 10g
16 4 Sun Solaris
8
Apply
11 12
Failover IGNORE = Y
14 10
Capture
13
Compare & Verify
5 Dtarget
10g Linux
1. Address change management by restricting creation of newer packages, tablespaces, etc. during
the migration process. (Not depicted)
2. Start GoldenGate Capture process (captures consistent scn = Qscn) at the production database
Dprod.
3. Do a point-in-time recovery of an existing backup of Dprod until Qscn in a separate staging area. Call
this database Dpitr.
4. Upgrade Dpitr to 10g on Solaris. Advance compatibility to 10.0 or higher.
5. Set up a vanilla 10g database on Linux. Call this database Dtarget.
6. Take a full export without rows at Dpitr. Call the generated export exp_norows.dmp. This will pick up
any objects that are not picked up as part of the transportable tablespace export.
7. Unplug the user tablespaces from Dpitr using the Oracle Cross Platform Transportable Tablespace
feature using source side endian conversion. (Note the conversion would not be required if
the endian systems were the same.) This is the step that avoids any performance degradation and
does not require any quiescing at Dprod. This step will create a small export dump file. Call this
exp_xtts.dmp.
8. Plug the set of tablespaces from Dpitr into Dtarget using the Oracle Cross Platform Transportable
Tablespace feature. Use the exp_xtts.dmp file created from Step 7. Note that the plugged in
tablespaces are in read-only mode.
9. Make the set of user tablespaces in Dtarget Read Write.
10. Do a NOROWS import with IGNORE=Y option at Dtarget using the exp_norows.dmp dump file.
11. Start the GoldenGate Delivery process at Dtarget and synchronize up to the changes generated since
Qscn.
12. If any data types are not supported by Transportable Tablespace or GoldenGate then do a special
export/import of these objects from Dprod to Dtarget.
13. After GoldenGate eliminates the lag between Dprod and Dtarget use GoldenGate Veridata to verify
that the data at Dprod and Dtarget is synchronized.
14. Start GoldenGate Capture process at Dtarget.
15. Switchover the application from Dprod to Dtarget. (Not depicted)
16. Start GoldenGate Apply on Dprod.
10. SUMMARY
To summarize, the key technical strengths of the solution are as follows:
½½ A rolling upgrade/migration – using two databases
½½ No instantiation using primary database – by offloading to a clone database
½½ Conversions – offloaded to a clone staging database
½½ Synchronize transactions across databases
½½ Verify data replication and transaction integrity – using GoldenGate Veridata
½½ Easy failover strategy – using a bi-directional GoldenGate configuration
Using GoldenGate’s software platform and Oracle’s Cross Platform Transportable Tablespace feature, a rolling
upgrade or even a migration can be done with zero database downtime and only very minimal application
switchover downtime. This combined solution enables companies to start utilizing new database features
provided in Oracle 10g and 11g releases without impacting business operations.
REFERENCES
1. 1
0.10 Upgrade with Logical Standby Database
(http://download.oracle.com/docs/cd/B19306_01/server.102/b14238/toc.htm)
Using a logical standby database enables you to accomplish upgrades for database software and patch sets with almost
no downtime. Note: This capability is not available for upgrading from Oracle9i to Oracle Database 10g.
2. D
embeck, Chet. “Yahoo Cashes in on Ebay’s Outage,” E-Commerce Times, June 18, 1999
(http://www.ecommercetimes.com/perl/story/545.html)
3. Oracle 11g upgrade documentation (http://download.oracle.com/docs/cd/B28359_01/server.111/b28300/toc.htm)
4. O
racle MetaLink note about 10g to 11g upgrade with the transient logical standby
(https://metalink.oracle.com/metalink/plsql/ml2_documents.showDocument?p_database_id=NOT&p_id=300479.1)
• L owell, David E.; Saito, Yasushi; Samberg, Eileen J. Devirtualizable Virtual Machines Enabling General, Single-Node,
Online Maintenance, Hewlett Packard Laboratories
• GoldenGate 8.0 Operations Guide for Windows and UNIX
CONTACT INFORMATION
For a list of worldwide offices and for more company information, please visit:
www.goldengate.com