IBM DB2 Universal Database Replication Guide and Reference
Total Page:16
File Type:pdf, Size:1020Kb
® ® IBM DB2 Universal Database Replication Guide and Reference Ve r s i o n 7 SC26-9920-00 ® ® IBM DB2 Universal Database Replication Guide and Reference Ve r s i o n 7 SC26-9920-00 Before using this information and the product it supports, be sure to read the general information under “Appendix C. Notices” on page 403. This document contains proprietary information of IBM. It is provided under a license agreement and is protected by copyright law. The information contained in this publication does not include any product warranties, and any statements provided in this manual should not be interpreted as such. Order publications through your IBM representative or the IBM branch office serving your locality or by calling 1-800-879-2755 in the United States or 1-800-IBM-4YOU in Canada. When you send information to IBM, you grant IBM a nonexclusive right to use or distribute the information in any way it believes appropriate without incurring any obligation to you. © Copyright International Business Machines Corporation 1994, 2000. All rights reserved. US Government Users Restricted Rights – Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp. Contents About this book ..........ix Data distribution .........19 Who should read this book .......x Data consolidation .........20 How this book is structured .......x Update anywhere .........21 Conventions ............x Occasionally connected .......22 Terminology ............xi Examples of replication configurations . 24 How to read syntax diagrams ......xi Archiving audit information .....24 Roadmap............xii Consolidating data from distributed How to send your comments ......xiii databases ............24 Distributing data to remote sites ....25 What’s new ............xv Distributing IMS data to remote sites . 27 Compatibility ...........xv Accessing data continuously .....28 What’s new for Version 7 .......xv Replicating operational data to decision DATALINK replication .......xv support systems..........29 Replication for AS/400 .......xv Using target tables as sources of updates Replication for UNIX, Windows, and (update anywhere) .........30 OS/2.............xvi Updating data on occasionally connected What’s new for Version 6 .......xvi systems ............31 DB2 Satellite Edition ........xvi Retrieving data from a non-DB2 Database currency ........xvii distributed data store ........32 Performance features .......xviii Replicating operational data to a non-DB2 Integration with DB2 .......xviii reports and query database ......33 Part 1. Introduction........1 Chapter 3. Data replication scenario . 35 Before you begin ..........35 Planning this scenario.........36 Chapter 1. Overview of data replication . 3 Replication source .........36 DB2 data replication components .....3 Replication target .........37 Control tables ...........4 Replication options.........37 Logical servers ..........4 Setting up the replication environment for Administration interfaces .......5 this scenario ............38 Change-capture mechanisms ......6 Step 1: Customize control tables ....38 Apply program ..........7 Step 2: Define a replication source . 39 How the replication components Step 3: Define a subscription set and a communicate ...........7 subscription-set member .......40 DB2 data replication concepts ......10 Step 4: Configure the source database . 43 Replication sources.........10 Step 5: Bind the Capture and Apply Subscription sets and subscription-set programs ............43 members ............11 Step 6: Create a password file .....44 Apply qualifier ..........13 Step 7: Replicate the scenario data . 45 Data manipulation .........13 Operating in a replication environment . 47 Target tables ...........14 Step 1: Update the source table ....47 Schedule for applying updates .....17 Step 2: Prune the control tables ....48 Step 3: Stop the Capture and Apply Chapter 2. Data replication configurations 19 programs ............49 Overview of replication configurations . 19 © Copyright IBM Corp. 1994, 2000 iii Chapter 4. Data replication tasks ....51 Chapter 6. Setting up your replication Planning your replication requirements . 51 environment ...........93 Setting up your replication environment . 53 Using the DB2 Control Center to set up Setting up the system ........53 replication ............93 Setting up the replication criteria ....53 Configuring the Control Center for host Performing the initial replication ....54 RDBMSs............94 Adding to your replication environment 55 Setting replication preferences in the DB2 Copying your replication environment . 55 Tools Settings notebook .......95 Operating in your replication environment. 55 Customizing CD table, index, and tablespace names .........95 Part 2. Administration ......59 Using the DB2 DataJoiner Replication Administration tool to set up replication . 96 Installing DJRA ..........98 Chapter 5. Planning for replication....61 Setting preferences .........99 Capacity planning ..........61 Customizing DJRA.........99 Storage planning ..........61 Defining replication control tables ....100 Database log and journal data .....62 Creating replication control tables using Active log file size for Capture for VSE DJRA..............102 and VM and current receiver size for Customizing and running replication SQL Capture for AS/400 ........63 files ..............103 Target tables and control tables ....63 Setting up security for replication ....104 Spill files ............65 Authorization requirements for Network planning ..........65 administration ..........104 Connectivity ...........65 Authorization requirements for running Where to run the Apply program: push or the Capture program........104 pull configuration .........66 Authorization requirements for running Data blocking for large volumes of the Apply program ........105 changes ............68 Defining replication sources ......105 Deciding what to replicate .......69 Defining replication sources for Subsetting columns and rows .....70 update-anywhere replication .....106 Replicating joins using views .....71 Detecting conflicts ........107 Replicating before and after images . 72 Defining views as replication sources . 108 Renaming columns.........73 Enabling replication logical-partitioning- Creating computed columns .....74 key support...........109 Using stored procedures for before and Defining CCD tables .........111 after run-time processing.......74 Defining replication subscription sets . 112 Replicating large objects .......74 Defining subscription sets for Replicating DATALINK values .....75 update-anywhere replication .....114 Key-update restrictions .......76 Choosing a target-table type .....115 General restrictions for replication . 77 Defining the target-table structure: Capture triggers for non-IBM sources . 80 columns and rows ........116 How the Capture triggers capture the data Defining a subscription set with a changes ............80 user-defined table .........119 Capture Triggers and pre-existing triggers 81 Defining SQL statements or stored Staging data ............82 procedures for the subscription set . 121 Attributes of CCD tables .......82 Data-sharing considerations .....122 Using CCD tables as replication sources. 84 Specifying a data-blocking value ....122 Pruning the CD and CCD tables ....88 Data currency requirements .....123 Auditing data usage .........88 Data consistency requirements ....125 Planning for migration ........89 Maintaining external CCD tables....126 iv DB2 Replication Guide and Reference Loading target tables offline using DJRA . 127 Problem determination for the Capture Copying your replication configuration to program .............156 another system...........127 Capture-program trace table .....157 Setting up the Capture program .....128 Capture-program trace file ......157 Specifying tuning parameters for the Capture-program log file ......158 Capture program .........128 Other problem-determination facilities for Restrictions when running the Capture the Capture program........158 program ............130 Problem determination for AS/400 ....159 Setting up the Apply program .....131 Gathering information about active jobs 159 Refreshing target tables with the Determining if the journal job is started 160 ASNLOAD exit routine .......131 Collecting data for problem determination 160 Using the ASNDONE exit routine . 132 Using the Replication Analyzer .....163 Using the ASNDLCOPY exit routine . 133 Troubleshooting ..........166 Using the ASNDLCOPYD file-copy Problem-source identification questions . 171 daemon ............136 Setting up DB2 DataJoiner .......137 Part 3. Operations .......173 Chapter 7. Operating DB2 DataPropagator 139 Chapter 9. Capture and Apply for AS/400 175 Operating the Capture program .....139 Coexistence considerations .......175 Before you start the Capture program . 139 Setting up the Capture and Apply programs 176 Starting or restarting the Capture Installing DB2 DataPropagator for AS/400 176 program ............140 Connecting to an AS/400 server ....176 Operating the Apply program .....142 Verifying and customizing your Improving Apply performance for Sybase or installation of DB2 DataPropagator for Microsoft SQL Server ........144 AS/400 ............177 Performing regular database maintenance 145 Specifying tuning parameters for Capture Monitoring the replication environment . 146 for AS/400 ...........178 Resolving gaps between source and target Authorization requirements for running the tables ..............147 Capture and Apply programs ......181 Modifying