Search icon
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Oracle Goldengate 12c Implementers Guide

You're reading from  Oracle Goldengate 12c Implementers Guide

Product type Book
Published in Jul 2015
Publisher
ISBN-13 9781785280474
Pages 422 pages
Edition 1st Edition
Languages

Table of Contents (21) Chapters

Oracle GoldenGate 12c Implementer's Guide
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Getting Started Installing and Preparing GoldenGate Design Considerations Configuring Oracle GoldenGate Configuration Options Configuring GoldenGate for HA Advanced Configuration Managing Oracle GoldenGate Performance Tuning Troubleshooting GoldenGate The Future of GoldenGate GGSCI Commands
GoldenGate Installed Components
Acronyms
Index

Chapter 4. Configuring Oracle GoldenGate

Having installed Oracle GoldenGate 12c, it must be configured in order to meet all of your data replication, data migration, or upgrade requirements. After initially discussing the main GoldenGate parameters, this chapter will provide a methodical approach to the configuration process, stepping through each task to give the depth of information necessary to successfully implement GoldenGate on Oracle 11g and 12c environments. You will learn the basic steps necessary to configure one-way replication in a GoldenGate environment, including data synchronization between the source and target.

This includes the following discussion topics:

  • Choosing the most appropriate instantiation method to synchronize the source database with the target prior to replication

  • Preparing and configuring the data capture for the initial load on the source system

  • Configuring change synchronization on the source system

  • Configuring change synchronization on the target system

  • Configuring...

GoldenGate parameters


Parameters play a very important role in the configuration of GoldenGate. Every configurable process is driven from an associated parameter file, which are stored by default in the dirprm subdirectory under the GoldenGate Home with the following naming convention:

<process_group>.prm

Following a successful software installation as described in Chapter 2, Installing and Preparing GoldenGate, we have already used a handful of parameters for a basic configuration. Although parameter files can be edited using a text editor, it is strongly recommended to edit process group parameter files from GGSCI using the EDIT PARAMS <process_group> command.

Let's now take a look at the scope and application of the GoldenGate parameters used in this chapter.

The following table lists the parameters and their description grouped by their process type. This is by no means an exhaustive list; we will become familiar with these parameters as we continue our journey through the...

The GoldenGate instantiation


An initial load synchronizes the source and target databases, which is an important first step in data replication. Commonly known as instantiation, it extracts an entire copy of the source dataset, transforms it if necessary, and applies it to the target tables. Data replication can then continue from this point.

One of GoldenGate's many features is change synchronization that keeps track of ongoing transactional changes while the initial load is being applied. This feature is used extensively as part of the supported zero downtime migration functionality, and when configured, the change data capture and delivery concurrent process tracks the incremental changes, which are then reconciled with the results of the initial load.

So why is instantiation so important? To answer this question, consider an UPDATE statement. By its nature, the row to be updated must exist on the target table; otherwise, the transaction will fail. This is also true for DELETE operations...

Performing the initial load


Let's now step through the necessary tasks required to perform the initial load using the File to Replicat instantiation method. For small and simple data synchronization with no transformations, this is the preferred solution.

The example architecture

This example assumes that the target tables are truncated and are identical in structure to the source tables. The configuration includes the following tasks:

  • The Initial load: This specifies the Direct Load data synchronization

  • The one-way replication: Change data capture and delivery

The following system schematic diagram illustrates the architecture and naming convention used in this chapter's examples:

Direct Load instantiation

We will use the Direct Load instantiation method to perform our initial load from the Oracle 12c multitenant container database, starting with the initial data capture configuration.

Configuring initial data capture

The first step is to create the initial capture Extract parameter file for the...

Configuring change data capture


Oracle recommends that CDC is configured and started before the initial load. This enables change synchronization to keep track of ongoing transactional changes while the load is being applied—a very useful feature when you cannot afford for your source system to be taken offline. In fact, GoldenGate can manage and combine the online transactional changes and the initial data extract with ease, ensuring no data loss or downtime.

So, let's now take a look at the steps required to configure and start CDC in the Oracle 12c multitenant container database environment. After this, we will look at the same for an Oracle database configured in the noncontainer database architecture.

The configuration summary

To summarize the configuration overview in this section, the following table describes the naming convention and mapping between roles, filenames, and processes used in the configuration examples:

Configuring change delivery


Change delivery is the process of applying the logical change records (LCR) generated from transactions that occurred on the source database. The data delivery is the responsibility of the Replicat process that mines the remote trail files, converts the LCRs to DML and DDL statements, and applies them to the target database. This process can often cause a bottleneck, depending on the volume of data being replicated. Oracle recommends enabling Integrated Capture or Coordinated Delivery against the target database to leverage parallel processing and enhance the performance of Replicat.

For this example, we will create one Replicat named ROLAP01 to apply DML to the EMP and DEPT tables in the PDB2: TGT schema. For a nonCDB database, the schema will be TGT in our OLAP target database.

For classic mode, the first step in order to configure Change Data Delivery (CDD) is the creation of a Checkpoint table. This is optional; Oracle highly recommends it over the default...

Testing change data capture and delivery


To test whether change synchronization is working, we must make some data changes on our source database and ensure that they are propagated to and applied on the target.

The following simple steps provide a basic test case that will confirm all is well.

  1. On the source database server, start a SQL*Plus session and connect it to the PDB1 database as the SRC user:

    sqlplus src/TIGER@PDB1
    
  2. We can call the following script to generate a test transaction:

    SQL> @src_test_transaction.sql
    
    1 row created.
    
    
    1 row created.
    
    
    1 row updated.
    
    
    Commit complete.
    

    Issuing a commit forces Oracle to write the transaction details to the database's online redo logs. These are subsequently read by the Extract process (EOLTP01) in real time and written to the local trail. The transaction in the local trail is read by the data pump process (EPMP01) that transfers the data via TCP/IP to the remote trail. The Replicat process (ROLAP01) reads the remote trail, converts the...

Stopping GoldenGate processes


Now that we know how to start the Manager, Extract, and Replicat processes using GGSCI commands, let's take a look at how to stop them. Issuing a stop command will gracefully shutdown the GoldenGate processes.

  1. First, check the processes that are running in your GoldenGate Home using the following code:

    GGSCI (db12server01) 1> info all
    
    Program     Status      Group       Lag         Time Since Chkpt
    
    MANAGER     RUNNING
    EXTRACT     RUNNING     EOLTP01     00:00:00    00:00:01
    EXTRACT     RUNNING     EPMP01      00:00:00    00:00:02
    
  2. Stop all processes using a wildcard, as shown in the following code:

    GGSCI (db12server01) 2> stop *
    
    Sending STOP request to EXTRACT EOLTP01 ...
    Request processed.
    
    Sending STOP request to EXTRACT EPMP01 ...
    Request processed.
    
  3. Check the processes again using the following code:

    GGSCI (db12server01) 3> info all
    
    Program     Status      Group       Lag         Time Since Chkpt
    
    MANAGER     RUNNING
    EXTRACT     STOPPED     EOLTP01...

More about trail files


Trail files are used by Extract and Replicat processes; their primary role is for data persistence. You could argue that writing files to what could be deemed as a staging area is wasteful and suboptimal. Having said that, GoldenGate writes only the committed transactions to trail files in large blocks minimizing I/O. Furthermore, the architecture provides a guaranteed no data loss solution that is not to be underestimated.

The trail

By default, trail files are in the canonical format being unstructured, but with a header record. They are stored in the ./dirdat subdirectory under the GoldenGate Home. Each record contains the changed data and is of a variable record length. A trail can contain numerous trail files, each having a two-character prefix with a six-digit sequence number suffix.

An Extract process can write data to many trails. A Replicat can process data from only one trail. In classic mode, it is possible to configure multiple Replicat processes to handle...

Configuring Oracle Manager process


In the previous chapter, we discussed the PORT parameter that is mandatory for the GoldenGate Manager process communication. In the previous section, you learned how to set a retention period for the trail files in the Manager configuration. Let's now look at some additional, Oracle recommended Manager process parameters: AUTOSTART and AUTORESTART.

The following code will tell the Manager to start the Extract or Replicat processes when the Manager starts and to restart only the Extract process(es) after two minutes in the event of a failure. With the following code, the Manager will try five times before abending the processes:

AUTOSTART ER *
AUTORESTART EXTRACT *, WAITMINUTES 2, RETRIES 5

When you edit the GoldenGate Manager parameter file from GGSCI, ensure that the Extract, Replicat, and Manager processes are restarted for all the changes to take effect.

Configuring the downstream mining database


The downstream mining database topology has been available since Oracle GoldenGate 11g Release 2. Its functionality is reminiscent of Oracle Streams, where both the capture and apply processes are configured on the target system. Known as source database offloading, the source database sends its redo stream to the target system. Here, the Extract process uses the Logminer server on the downstream database to mine the logs.

The configuration is largely conducted on the source and target database to enable the Oracle Data Guard transport mechanism of log shipping. This can be in real-time mode or archive log shipping mode. Configuring the former allows Oracle to fall back to the latter when it is under extreme load or experiencing network latency.

The following diagram illustrates the architecture of the downstream mining database that includes the naming convention used in the example configuration:

Preparing the source database

The first step involved...

Summary


The examples given in this chapter illustrate the configuration process, providing a greater understanding of the GoldenGate architecture.

You learned how to configure the Extract and Replicat processes for different instantiation methods, such as File to Replicat and Direct Load, to perform the initial load. We also considered the importance of data synchronization between a source and target database in a replication environment.

Configuring change data capture and delivery has shown us how to enable zero downtime migrations as well as provide the final step in the GoldenGate instantiation.

Exploring new features, we discovered that there are many parameters and options along with their available functions, offering enormous scope and flexibility.

In the next chapter, we will look at configuration in more detail (from data mapping and filtering to finally discussing data transformation and error handling), all of which help to create a robust GoldenGate environment.

lock icon The rest of the chapter is locked
You have been reading a chapter from
Oracle Goldengate 12c Implementers Guide
Published in: Jul 2015 Publisher: ISBN-13: 9781785280474
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime}

Role

Process

Process group name

Parameter filename

Trail filename...