Book Image

Oracle 11g Streams Implementer's Guide

Book Image

Oracle 11g Streams Implementer's Guide

Overview of this book

From smaller businesses through to huge enterprises ñ users all over the world often require access to data 24 hours a day. Distributed database systems proliferate the world of data sharing providing an ability to access real-time data anywhere, anytime. Oracle Streams, a built-in feature of the Oracle database, is a data replication and integration feature critical to the success and wellbeing of enterprises in today's fast moving economy. This book provides the reader with solid techniques to master Oracle Streams technology and successfully deploy distributed database systems. This book quickly goes over the basics and gets you up and running with a simple Oracle 11g Streams environment. It will serve as an excellent companion to the Oracle Streams Administration Guide. It is intended for Oracle database architects and administrators, and provides in-depth discussion on must-know information for the design, implementation, and maintenance of an Oracle Streams environment. The book does not attempt to regurgitate all the information in the Oracle Streams Administration Guides, but rather provides additional clarification and explanation of design, implementation, and troubleshooting concepts that are often elusive in Streams documentation. It also identifies helpful tools and Oracle resources to add to your knowledge base, as well as tried and tested tricks and tips to help you tame Oracle Streams. The book starts by introducing and explaining the components of Oracle Streams and how they work together. It then moves on logically, helping you to determine your distributed environment requirements and design your Streams implementation to meet those requirements. Once these concepts are discussed, the book moves to configuration and basic implementation examples to help solidify those concepts. It then addresses advanced features such as tags, down-stream capture, and conflict resolution. You then move on to maintenance techniques such as documenting the environment, effectively planning and implementing changes to the environment, and monitoring and troubleshooting the environment. When you have studied the techniques and completed the hands-on examples, you will have an understanding of Oracle Streams' core concepts and functionally that will allow you to successfully design, implement, and maintain an Oracle Streamed environment.
Table of Contents (14 chapters)
Oracle 11g Streams Implementer's Guide
Credits
About the Authors
About the Reviewers
Preface

Combined Capture and Apply


You've seen these movies and heard the famous songs where, when certain planets align in certain ways at certain times, special powerful things automatically happen. As of 11g, Streams has such a cosmic event potential. And when this cosmic event occurs, its called Combined Capture and Apply. Seriously, it really is like a cosmic event in the galaxy of optimization. When Oracle Streams is configured a particular way between two sites, the Capture process acts as the propagator, using its associated Propagation process rule set, and transmits the eligible LCR's directly to the Apply process at the destination via database link. This functionality automatically detects if the optimal configuration is in place and "flips the switch" to enable Combined Capture and Apply. The only way to control whether or not Combined Capture and Apply is enabled, is to change the configuration of your Streams so that one of the configuration "rules" is violated.

The configurations that cultivate this cosmic event are a little different depending on where the Apply process resides.

If the Apply process resides in a different database than the Capture process, the configuration is required:

  • The Capture and Apply databases must be on release 11g Release 1 or higher

  • The Capture process is the only publisher for the capture queue

  • Propagation is configured directly between the capture and apply queues (no intermediate queues allowed)

  • The Propagation is the only consumer for the Capture queue

  • The Propagation is the only publisher for the Apply queue

  • If a buffered Apply queue is used, the Apply process can be the only consumer for the queue

  • If a persistent Apply queue is used, multiple Apply processes can be consumers for the queue

One behavior to point out here is that if the Apply process is unavailable at the destination database, the Capture process will hang in the INITIALIZING state at startup until the Apply process becomes available. Once the Apply process is enabled, the Capture process immediately transitions to CAPTURING CHANGES.

If the Apply process resides in the same database as the Capture process, the configuration is required:

  • The database must be on release 11g Release 1 or higher

  • The Capture and Apply process use the same queue

  • The Capture process is the only publisher for the queue

  • Propagation is configured directly between the capture and apply queues (no intermediate queues allowed)

  • If a buffered queue is used, the Apply process can be the only consumer for the queue

  • If a persistent queue is used, multiple Apply processes can be consumers for the queue

As the user has no control over the enablement of Combined Capture and Apply (CCA) beyond setting up the Streams configuration, it may not be immediately obvious when Combined Capture and Apply is enabled. You can determine if it is enabled by checking the V$STREAMS_CAPTURE and V$STREAMS_APPLY_READER views.

In V$STREAMS_CAPTURE, the APPLY_NAME will have the name of the Apply process and the OPTIMIZATION will be greater than 0 (zero, zed) if CCA is enabled.

select capture_name, apply_name, optimization from V$STREAMS_CAPTURE;
CAPTURE_NAME APPLY_NAME OPTIMIZATION
------------------ ----------------------- ------------
HR_CAPTURE HR_APPLY 2

The PROXY_SID is not NULL in V$STREAMS_APPLY_READER.

select apply_name, proxy_sid from V$STREAMS_APPLY_READER;
APPLY_NAME PROXY_SID
------------------------------ ----------
HR_APPLY 132

You will also see a similar entry in the alert log:

Propagation Sender (CCA) HR_PROPAGATION for Streams Capture HR_CAPTURE and Apply HR_APPLY [on destination STRM2] with pid=28, OS id=6096 started.

When Streams is in Combined Capture and Apply mode, you will not see information concerning the Propagation in the DBA_QUEUE_SCHEDULES view. In this case, you will need to query the V$PROPAGATION_SENDER and V$PROPAGATION_RECEIVER views.