GoldenGate for Oracle to MS SQL Server

Similar documents
GoldenGate for Oracle to DB2 on zos

Upon completion of this lesson, you will be able to configure GoldenGate to provide Oracle to TimesTen synchronization.

Oracle GoldenGate for Oracle to Oracle

Oracle GoldenGate for MS SQL Server 2005

GoldenGate for NonStop SQL/MP to SQL Server

GoldenGate for DB2 on zos to DB2 on UNIX

Oracle GoldenGate for DB2 to Oracle

GoldenGate for DB2 to Oracle

HP NonStop SQL/MX to Oracle

Oracle GoldenGate for Sybase to Sybase on UNIX

Oracle GoldenGate for Non-Audited Enscribe to Oracle

GoldenGate for NonStop SQL/MP to Oracle

GoldenGate for Audited NonStop Enscribe to Oracle Using a Data Pump for CDC

Teradata to Teradata: Max Performance

Teradata to Teradata: Max Protection

Teradata to Teradata: Max Performance

Oracle GoldenGate for HP NonStop SQL/MP

Teradata to Teradata: Max Protection

1. Some OGG fundamental concepts : PK/UK, KEYCOLS, ADD TRANDATA, Before and After images and they how work together

Oracle GoldenGate Director

Getting started. Amardeep Sidhu

Expert Oracle GoldenGate

Oracle - 1z Oracle GoldenGate 11g Certified Implementation Exam Essentials

Oracle 1Z0-539 Exam Questions & Answers

Configuring Oracle GoldenGate OGG 11gR2 local integrated capture and using OGG for mapping and transformations

Oracle - Oracle GoldenGate 12c: Fundamentals for

Oracle Fusion Middleware Using Oracle GoldenGate for Heterogeneous Databases

Oracle GoldenGate 11g Fundamentals for Oracle

EasyLobby Database Setup EasyLobby Family of Products Version 10.0

Oracle GoldenGate 11g: Fundamentals for SQL Server Student Guide

Oracle GoldenGate 12c Tips and Tricks. Infrastructure at your Service.

1z0-447.exam.44q 1z0-447 Oracle GoldenGate 12c Implementation Essentials

Installation of Microsoft SQL Server 2012 Setup MwPharm++ database

An Oracle White Paper September Replicating between Cloud and On-Premises using Oracle GoldenGate

Oracle GoldenGate for Java

SYNTHESYS.NET INTERACTION STUDIO Database Output Actions

Oracle Fusion Middleware Upgrading Oracle GoldenGate for Windows and UNIX. 18c (18.1.0)

Millennium Expert/Enterprise Installation Guide Version Table of Contents

Error Messages Reference for Oracle GoldenGate for Windows and UNIX 12c ( )

enterprise professional expertise distilled Implementer's guide Oracle GoldenGate 11g

Microsoft SQL Installation and Setup

Using Data Replication with Merge Apply and Audit Apply in a Single Configuration

GoldenGate: An Introduction


Oracle GoldenGate DB2 LUW Installation and Setup Guide 11g Release 1 (11.1.1) E August 2010

GoldenGate Zbigniew Baranowski

Lab Answer Key for Module 1: Creating Databases and Database Files

Defining an ODBC data source

Defining Multiple Replicat Processes to Increase GoldenGate Performance

WinSCP. Author A.Kishore/Sachin

Oracle Fusion Middleware

DOCUMENT REVISION HISTORY

Oracle GoldenGate 11g Release 2 ( ) Release Notes E

Installation Guide. Last Revision: Oct 03, Page 1-

xtrace Monitor Installation Guide

Replication to SAP HANA Database with Oracle GoldenGate 12c

Novell ZENworks Asset Management 7

Setting up a database for multi-user access

Installing Blank SiriusSQL Database 4.0

Oracle SQL. murach s. and PL/SQL TRAINING & REFERENCE. (Chapter 2)

Author A.Kishore/Sachin WinSCP

1z Oracle GoldenGate 11g Certified Implementation Exam Essentials

Crystal Reports. Overview. Contents. Differences between the Database menu in Crystal Reports 8.5 and 9

Oracle GoldenGate v10.4. Release Notes. Release Notes

Solution Explorer Copy Items in a Solution Files That Manage Solutions and Projects Solutions (SQL Server Management Studio) Associate a Query with a

Log Server Configuration Utility

Apparo Fast Edit. Database configuration for the Apparo repository and others 1 / 20

Oracle Retail Customer Engagement Cloud Service (Relate) Installation Guide - Installer Release 11.4 E Revision 2

Installing GFI MailArchiver

Getting started with Oracle

National Fire Incident Reporting System (NFIRS 5.0) Configuration Tool User's Guide

Administering Oracle GoldenGate Adapters 12c ( )

RSA NetWitness Logs. Citrix XenApp. Event Source Log Configuration Guide

GOLDENGATE A LIVE INTRODUCTION PATRICK HURLEY

Oracle GoldenGate Best Practices: Configuring Oracle GoldenGate with Oracle Grid Infrastructure Bundled Agents (XAG)

Install and Configure Oracle GoldenGate 12.3 Microservices Architecture

Wechsel von Oracle Streams. nach Oracle GoldenGate 12c. Joachim Jaensch Principal Sales Consultant

Data Replication With Oracle GoldenGate Looking Behind The Scenes Robert Bialek Principal Consultant Partner

2012 Peer Small Business Data

Lab 2: Installation of Oracle XE & SOA11g

RSA NetWitness Logs. IBM Tivoli Identity Manager. Event Source Log Configuration Guide. Last Modified: Monday, March 06, 2017

1. ECI Hosted Clients Installing Release 6.3 for the First Time (ECI Hosted) Upgrading to Release 6.3SP2 (ECI Hosted)

Managing the CaseMap Admin Console User Guide

Installation and Configuration Guide

How to design and print cards using a database connection with. emedia CS Software

4 BSM FOUNDATION BOOTCAMP

Converting the AF-MASTER Process for DDMSPLUS

How do I connect to Peachtree using ODBC/OLEDB?

How to resolve connection problems between server and workstation

Summary of Server Installation

Electronic Owner s Manual User Guide

SQL Server. Management Studio. Chapter 3. In This Chapter. Management Studio. c Introduction to SQL Server

Oracle Hyperion Financial Data Quality Management, Fusion Edition ERP Source Adapter for SAP. Readme. Purpose. Overview.

MDCStore High Content Data Management Solution Database Schema

GOLDENGATE REPLICATION CONFLICT DETECTION AND RESOLUTION AND ITS CHALLENGES

Global Software, Inc.'s Spreadsheet Writeback User Manual. Release V14 R1 M2

2015 Beta 2 Tutorials

Default Password For Hr Schema In Oracle 10g

Using Oracle GoldenGate Monitor 12c (12.2.1)

Welcome to this review guide for the configuration and use of Database Fields. Requirements. Contact Us. Create a Database Fields index in ZyINDEX

Transcription:

GoldenGate for Oracle to MS SQL Server GoldenGate for Oracle to MS SQL Server Objective Upon completion of this lesson, you will be able to configure GoldenGate to provide Oracle to SQL Server transactional data management using log-based extraction. During this lesson, you will learn how to: Prepare your user environment Prepare the database Configure and start the change capture process of database operations Configure and execute the initial data load process Configure and start the change delivery process of database operations Configuration for Oracle to MS SQL Server The following diagram illustrates an Oracle source system replicating to a Windows MS SQL Server. <source> server Windows server <target> Oracle Source <owner/schema> Manager Network Manager Log Extract Collector Trails Replicat MS SQL Server <dsn> Target <schema> Overview of Tasks Prepare the GoldenGate Environment In order to execute this lesson, the GoldenGate application must be installed on both the source and target systems. The installation includes a sample database and scripts to generate Page 1

GoldenGate for Oracle to MS SQL Server initial data as well as subsequent update operations. The source and target tables are created and loaded with initial data. The GoldenGate Manager processes are also started so that other processes may be configured and started. Configure Initial Data Load Initial database synchronization is almost always required. To initially load data across actively changing databases, you have limited choices. GoldenGate provides the ability to perform initial data synchronization while your application remains active. There are several techniques available, including sending data to files to be loaded by Replicat or by Microsoft BCP/DTS bulk-load utility, or sending data directly to Replicat. This lesson demonstrates using the direct load method to capture data directly from the source tables and send it directly to the delivery process on the target system. Oracle <source> server Network <target> server MS SQL Server <dsn> Source <owner/schema> Initial Extract Initial Replicat Target <schema> Configure Change Capture For log-based Oracle capture, the Extract process is configured to capture change data directly from the Oracle online redo logs or archive logs and store the changes in data queues known as GoldenGate remote trails. Configure Change Delivery Once the tables have been initially loaded with data, the Replicat process is configured to deliver the captured change data into the target database. Page 2

Prepare the Environment Exercise 1. Prepare the Environment Objective The goals of this exercise are to: Configure and start the Manager processes Create sample tables and load data into source tables Add supplemental logging Generate source definitions file Prepare your Oracle source environment 1. Configure the Manager process on the source On the <source> system, create the Manager parameter file and specify the port it should use. Create the Manager parameter file. Shell> cd <install location> Shell> ggsci GGSCI> EDIT PARAMS MGR Use the editor to assign a port. --GoldenGate Manager parameter file PORT <port> Start the Manager. GGSCI> START MGR Verify that the Manager has started. GGSCI> INFO MGR 2. Create the source tables and load the initial data. Using SQL*Plus, create and populate the TCUSTMER and TCUSTORD tables by running the demo_ora_create.sql and demo_ora_insert.sql files found in the install directory. Execute the following commands on the <source> system. Shell> cd <install location> Shell> sqlplus <login>/<password> SQL> @demo_ora_create Page 3

Prepare the Environment SQL> @demo_ora_insert Verify the results: SQL> select * from tcustmer; SQL> select * from tcustord; SQL> exit 3. Add supplemental logging Using GGSCI, log in to the database on the <source> and turn on supplemental logging for the TCUSTMER and TCUSTORD tables. Shell> ggsci GGSCI> DBLOGIN USERID <login> GGSCI> ADD TRANDATA <owner/schema>.tcustmer GGSCI> ADD TRANDATA <owner/schema>.tcustord Verify that supplemental logging has been turned on for these tables. GGSCI> INFO TRANDATA <owner/schema>.tcust* 4. Configure source definition generator Execute the following commands on the <source> system to create the DEFGEN parameter file and add the listed parameters. Shell> cd <install location> Shell> ggsci GGSCI> edit param defgen DEFSFILE./dirdef/source.def, PURGE USERID <login>, PASSWORD <password> TABLE <owner/schema>.tcustmer; TABLE <owner/schema>.tcustord; GGSCI> exit 5. Execute the source definition generator Execute the following commands on the <source> system. Shell> defgen paramfile dirprm/defgen.prm 6. Transfer the source definition file to the target system Execute the following commands to transfer the souce.def file to the <target> system. Shell> ftp <target> Name (<source>:): <login> Password: password ftp> ascii ftp> cd <install location>/dirdef Page 4

Prepare the Environment ftp> lcd <install location>/dirdef ftp> put source.def (see note below) ftp> bye Note: To avoid overlaying existing definition files, always put the file as <db type>.def instead of source.def (e.g. Oracle.def). Prepare the SQL Server 2005 target system Install Manager 1. Configure Manager process on the target Execute the following commands on the <target> system. Note! The port numbers must be unique if you are installing GoldenGate more than once on the same server. Shell> cd <install location> Shell> ggsci GGSCI> EDIT PARAMS MGR In the parameter file, enter the following parameter, then save and close the file. -- GoldenGate Manager Parameter file PORT <port> Start Manager. GGSCI> START MANAGER Verify the results: GGSCI> INFO MANAGER Steps to create the database 2. Create the database From Start>Programs, run SQL Server Management Studio. Enter the name of the local SQL Server instance, then click connect. Note: These instructions assume SQL Server Authentication which requires the more complex, double layer, of authentication. For only Windows Authentication, you can leave out most of the login and password entries. Page 5

Prepare the Environment This displays the main SQL Server Management Studio dialog box. Right, right-click Database and select the New Database option. The New Database dialog box appears. In the Name box, type the <database> from the Lab Preparation worksheet. Page 6

Prepare the Environment Click OK to add the database. The main SQL Server Management Studio dialog box reappears. 3. Create SQL Server logins and users Right-click Security and select the New > Login. The New Login dialog box appears. Page 7

Prepare the Environment For Name, type the <login>. Select Authentication, If you selected SQL Server Authentication, type the <password> in the two Password fields. Under Defaults, select your <database> for Database, and leave Language set to the default. Do not click OK. Instead, from Select a page in the upper left-hand box, double click User Mapping. Page 8

Prepare the Environment In the upper Users mapped to this login area, activate the checkmark next to your database. In the lower Database role membership for <database> area,, check the box for the db_owner role. Click OK to exit. The next step creates a schema that you will associate with the new user. While you have the database selected, click on the New Query button in the main menu. The right side of the dialog displays the SQL Query interface. Type in: create schema <owner/schema>; And press the Execute button from the toolbar. Page 9

Prepare the Environment Now you need to associate the new user and the schema that you have created with the new database. Right click on the Security option that is under the database and select New > User. The New Database User dialog box appears. Enter the name of your user and press the browse button labeled with three dots ( ). Page 10

Prepare the Environment The Select Login dialog displays. Press the Browse button. Select your new user <login> from the list. Then press OK. Your selected user now displays in the object names box. Press OK to exit from Select Login. Back in the New Database User dialog, enter the <schema> you added as the default schema and press OK. 4. Create the ODBC system data source name The GoldenGate Extract process connects to a SQL Server database through an ODBC (Open Database Connectivity) connection. Both the Extract and Replicat components of GoldenGate require that a system data source name (DSN) be established, which stores the information about how to connect to the SQL Server. Click Start > Settings > Control Panel. Double-click Administrative Tools. Double-click Data Sources (ODBC) to open the ODBC Data Source Administrator dialog box. Click the System DSN tab, and then click the Add button. The Create New Data Source dialog box appears. Note: For SQL Server 2000, you may use any ODBC driver supported by the database. For SQL Server 2005, however, you must use the ODBC driver that is included with Microsoft Data Access Components (MDAC). Both Extract and Replicat will abend if the SQL Native Client ODBC driver that is provided with SQL Server 2005 is used. Page 11

Prepare the Environment Select the SQL Server driver and then click Finish. The Create a New Data Source to SQL Server dialog box appears. For Name, type <dsn>. For a description, type "GG Training Data source" when creating this source DSN. This field is optional. For Which SQL Server do you want to connect to, select the server name. Click Next. Answer the question about how SQL Server should verify the login by selecting the option that you entered when creating the <login>. Then type <login> in Login ID and <password> in Password. Page 12

Prepare the Environment Click Next. Make certain the default database is set to the database that you created; otherwise select Change the default database to: and select it. Leave the other settings to their defaults to use ANSI. Click Next. Leave the next dialog box set to the defaults, and click Finish. In the confirmation, click Test Data Source to test the connection. Close the confirmation dialog box and the Create a New Data Source box. Page 13

Prepare the Environment 5. Create the practice tables Execute the following commands on the <target> system. Go to SQL Server Management Studio, select your database and select New Query from the toolbar. If the correct database is not displayed in the drop down box (showing ggsdata above), click on the arrow and select it from the list. Click the File > Open and navigate to the demo_mss_create.sql script. Click Open to open the script in the New Query window. Execute the script by clicking the Execute Query button on the toolbar. Verify the results using the following commands in the input window: sp_help tcustmer go sp_help tcustord go Page 14

Initial Data Load Exercise 2. Initial Data Load using Direct Load Method Objective These steps configure initial load groups that copy source data and apply it to the target tables. Steps to configure initial load 1. Add the initial data load extract batch task group Execute the following commands on the <source> system to add an Extract process called EINI<unique id> 1. Execute the following command in GGSCI to create the batch task. Shell> cd <install location> Shell> ggsci GGSCI> ADD EXTRACT EINI<unique id>, SOURCEISTABLE Verify the results: GGSCI> INFO EXTRACT *, TASKS 2. Configure the initial data load Extract parameter file Execute the following command in GGSCI to open the editor. GGSCI> EDIT PARAMS EINI<unique id> Add the following lines to the parameter file -- -- GoldenGate Initial Data Capture -- for TCUSTMER and TCUSTORD -- EXTRACT EINI<unique id> USERID <login>, PASSWORD <password> RMTHOST <target>, MGRPORT <port> RMTTASK REPLICAT, GROUP RINI<unique id> TABLE <owner/schema>.tcustmer; TABLE <owner/schema>.tcustord; 1 The process names used in lab exercises, for example EINIBD, are made up of 1) one character for the GoldenGate process (E for Extract, R for Replicat); 2) three or four to describe the process type (INI for initial data load, ORA for capture from or delivery to an Oracle database, etc.) and 3) two characters to create a unique identifier (usually your initials). Page 15

Initial Data Load 3. Add the initial data load Replicat batch task group Execute the following commands on the <target> system. Execute the following command in GGSCI to create the batch task. GGSCI> ADD REPLICAT RINI<unique id>, SPECIALRUN Verify the results: GGSCI> INFO RINI<unique id>*, TASKS 4. Configure the initial data load Replicat parameter file Execute the following commands on the <target> system. Execute the following command in GGSCI to open the editor. GGSCI> EDIT PARAMS RINI<unique id> Add the following lines to the parameter file -- GoldenGate Initial Data Load Delivery -- REPLICAT RINI<unique id> TARGETDB <dsn>, USERID <login>, PASSWORD <password> DISCARDFILE./dirrpt/RINI<unique id>.txt, PURGE SOURCEDEFS./dirdef/source.def MAP <owner/schema>.tcustmer, TARGET <owner/schema>.tcustmer; MAP <owner/schema>.tcustord, TARGET <owner/schema>.tcustord; Note: Remember to use <db type>.def if you renamed the source.def when you transferred it to the <target>. 5. Execute the initial data load process Execute the following commands on the <source> system. Execute the following command to start the initial data load process. GGSCI> START EXTRACT EINI<unique id> Verify the results: GGSCI> VIEW REPORT EINI<unique id> Execute the following commands on the <target> system. Verify the results: GGSCI> VIEW REPORT RINI<unique id> Query Analyzer> SELECT * FROM <owner/schema>.tcustmer Query Analyzer> SELECT * FROM <owner/schema>.tcustord Page 16

Configure Change Capture Exercise 3. Configure Change Capture Objective The goals of this exercise are to: Configure and add the Extract process that will capture changes. Add the trail that will store the changes. Start the Extract process. Configure change capture 1. Add the Extract group Execute the following command on the <source> system to add an Extract group named EORA<unique id>. GGSCI> ADD EXTRACT EORA<unique id>, TRANLOG, BEGIN NOW, THREADS <instances> Verify the results: GGSCI> INFO EXTRACT EORA<unique id> 2. Create the Extract parameter file Execute the following commands on the <source> system. GGSCI> EDIT PARAM EORA<unique id> -- -- Change Capture parameter file to capture -- TCUSTMER and TCUSTORD Changes -- EXTRACT EORA<unique id> USERID <login>, PASSWORD <password> RMTHOST <target>, MGRPORT <port> RMTTRAIL./dirdat/<trail id> TABLE <owner/schema>.tcustmer; TABLE <owner/schema>.tcustord; Note: Record the two characters selected for your <trail id>:. You will need this in the next step and when you set up the Replicat. Page 17

Configure Change Capture Note: When Oracle Automatic Storage Management (ASM) is in use, the TRANLOGOPTIONS ASMUSER and ASMPASSWORD must be set in the Extract parameter file. For more information refer to the GoldenGate for Windows & UNIX Administrator and Reference manuals. 3. Define the GoldenGate trail Execute the following command on the <source> to add the trail that will store the changes on the target. GGSCI> ADD RMTTRAIL./dirdat/<trail id>, EXTRACT EORA<unique id>, MEGABYTES 5 Verify the results: GGSCI> INFO RMTTRAIL * 4. Start the capture process GGSCI> START EXTRACT EORA<unique id> Verify the results: GGSCI> INFO EXTRACT EORA<unique id>, DETAIL GGSCI> VIEW REPORT EORA<unique id> Discussion points 1. Identifying a remote system What parameter is used to identify the remote target system? 2. Sizing the GoldenGate trail Where do you set how large a GoldenGate trail file may get before it rolls to the next file? What option do you use? Page 18

Configure Change Delivery Exercise 4. Configure Change Delivery Objective The goals of this exercise are to: Set up the checkpoint table on the target system. Create a named group that includes the Replicat process and the checkpoint tables. Configure the Replicat group by adding parameters. Start the Replicat group. Set up checkpoints 1. Edit a GLOBALS file on the target system Execute the following commands on the <target> system. Edit the GLOBALS parameter file to add the checkpoint table. Shell> cd <install location> Shell> ggsci GGSCI> EDIT PARAMS./GLOBALS In the text editor, type: CHECKPOINTTABLE <owner/schema>.ggschkpt Record the checkpoint table owner and name, then save and close the file. Table owner name Note: You could name the table anything you want, but for training purposes we are using ggschkpt. 2. Activate the GLOBALS parameters For the GLOBALS configuration to take effect, you must exit the session in which the changes were made. Execute the following command to exit GGSCI. GGSCI> EXIT Page 19

Configure Change Delivery 3. Add a Replicat checkpoint table Execute the following commands on the <target> system. This step adds the checkpoint table that you specified when you created the GLOBALS parameter file. It will be created in the <dsn> database. Run GGSCI on the target. Shell> cd <install location> Shell> ggsci Execute the following commands in GGSCI. GGSCI> DBLOGIN SOURCEDB <dsn>, USERID <login>, PASSWORD <password> GGSCI> ADD CHECKPOINTTABLE Configure delivery 4. Add the Replicat checkpoint group Execute the following commands on the <target> system to create the Replicat group named RMSS<unique id>. GGSCI> ADD REPLICAT RMSS<unique id>, EXTTRAIL./dirdat/<trail id> Note: Refer to your Extract set up for the correct two-character <trail id>. 5. Create Replicat parameter file Execute the following command on the <target> system to edit the Replicat parameter file. GGSCI> EDIT PARAM RMSS<unique id> Add the following lines to the parameter file. REPLICAT RMSS<unique id> TARGETDB <dsn>, USERID <login>, PASSWORD <password> HANDLECOLLISIONS SOURCEDEFS./dirdef/source.def DISCARDFILE./dirrpt/RMSS<unique id>.dsc, PURGE MAP <owner/schema>.tcustmer, TARGET <owner/schema>.tcustmer; MAP <owner/schema>.tcustord, TARGET <owner/schema>.tcustord; Note: Remember to use <db type>.def if you renamed the source.def when you transferred it to the the <target>. Page 20

Configure Change Delivery 4. Start the Replicat process Execute the following commands on the <target> system. Execute the following command in GGSCI to start the Replicat process. GGSCI> START REPLICAT RMSS<unique id> Verify the results: GGSCI> INFO REPLICAT RMSS<unique id> Discussion points Search in the Windows//UNIX Reference Guide for the information on the following questions. 1. When to use HANDLECOLLISIONS When would you use HANDLECOLLISIONS? What does it do? 2. What information is supplied by SOURCEDEFS? 3. What is the purpose of the DISCARDFILE? Page 21

Generate Activity and Verify Results Exercise 5. Generate Activity and Verify Results Objective The goals of this exercise are to: Execute miscellaneous update, insert, and delete operations on the source system. Verify the delivery of the changes to the target Turn off the error handling used for initial load. Generate database operations 1. Execute miscellaneous update, insert, and delete operations Execute the following commands on the <source> system. Shell> cd <install location> Shell> sqlplus <login>/<password> SQL> @demo_ora_misc Verify change capture and delivery 2. Verify results on the source system Execute the following commands on the <source> system. SQL> select * from tcustmer; SQL> select * from tcustord; SQL> exit Shell> ggsci GGSCI> SEND EXTRACT EORA<unique id>, REPORT GGSCI> VIEW REPORT EORA<unique id> Verify your target SQL Server 2005 results 3. Verify your results on the SQL Server 2005 target Verify and record processing statistics on the <target> with the following command in GGSCI. GGSCI> SEND REPLICAT RMSS<unique id>, REPORT Page 22

Generate Activity and Verify Results GGSCI> VIEW REPORT RMSS<unique id> Verify the data by executing the following commands in the New Query window of SQL Server Management Studio on the source: select * from TCUSTMER; select * from TCUSTORD; Turn off error handling 4. Turn off initial load error handling for the running delivery process Execute the following commands on the <target> system. GGSCI> SEND REPLICAT RMSS<unique id>, NOHANDLECOLLISIONS 5. Remove initial load error handling from the parameter file GGSCI> EDIT PARAMS RMSS<unique id> Remove the HANDLECOLLISIONS parameter. Page 23

Exercise Name Page 24