Oracle® GoldenGate

Fundamentals Student Guide Version 10.4

October 2009

Oracle GoldenGate Fundamentals Student Guide, version 10.4

Copyright © 1995, 2009 Oracle and/or its affiliates. All rights reserved. This software and related documentation are provided under a license agreement containing restrictions on use and disclosure and are protected by intellectual property laws. Except as expressly permitted in your license agreement or allowed by law, you may not use, copy, reproduce, translate, broadcast, modify, license, transmit, distribute, exhibit, perform, publish, or display any part, in any form, or by any means. Reverse engineering, disassembly, or decompilation of this software, unless required by law for interoperability, is prohibited. The information contained herein is subject to change without notice and is not warranted to be error-free. If you find any errors, please report them to us in writing. If this software or related documentation is delivered to the U.S. Government or anyone licensing it on behalf of the U.S. Government, the following notice is applicable: U.S. GOVERNMENT RIGHTS Programs, software, databases, and related documentation and technical data delivered to U.S. Government customers are "commercial computer software" or "commercial technical data" pursuant to the applicable Federal Acquisition Regulation and agency-specific supplemental regulations. As such, the use, duplication, disclosure, modification, and adaptation shall be subject to the restrictions and license terms set forth in the applicable Government contract, and, to the extent applicable by the terms of the Government contract, the additional rights set forth in FAR 52.227-19, Commercial Computer Software License (December 2007). Oracle USA, Inc., 500 Oracle Parkway, Redwood City, CA 94065. This software is developed for general use in a variety of information management applications. It is not developed or intended for use in any inherently dangerous applications, including applications which may create a risk of personal injury. If you use this software in dangerous applications, then you shall be responsible to take all appropriate fail-safe, backup, redundancy, and other measures to ensure the safe use of this software. Oracle Corporation and its affiliates disclaim any liability for any damages caused by use of this software in dangerous applications. Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners. This software and documentation may provide access to or information on content, products, and services from third parties. Oracle Corporation and its affiliates are not responsible for and expressly disclaim all warranties of any kind with respect to third-party content, products, and services. Oracle Corporation and its affiliates will not be responsible for any loss, costs, or damages incurred due to your access to or use of third-party content, products, or services.

Contents

ABOUT GOLDENGATE – COMPANY AND SOLUTIONS.................................................................. 5 TECHNOLOGY OVERVIEW ................................................................................................................. 18 ARCHITECTURE ..................................................................................................................................... 22 CONFIGURING ORACLE GOLDENGATE ......................................................................................... 28 STEP 1. PREPARE THE ENVIRONMENT ....................................................................................................... 29 GOLDENGATE COMMAND INTERFACE...................................................................................................... 46 STEP 2. CHANGE CAPTURE ....................................................................................................................... 51 STEP 3. INITIAL LOAD ............................................................................................................................... 64 STEP 4. CHANGE DELIVERY ...................................................................................................................... 71 EXTRACT TRAILS AND FILES............................................................................................................. 76 GOLDENGATE DATA FORMAT .................................................................................................................. 79 ALTERNATIVE FORMATS .......................................................................................................................... 85 VIEWING IN LOGDUMP ............................................................................................................................. 92 REVERSING THE TRAIL SEQUENCE ......................................................................................................... 104 PARAMETERS ........................................................................................................................................ 107 GLOBALS PARAMETERS....................................................................................................................... 109 MANAGER PARAMETERS ........................................................................................................................ 110 EXTRACT PARAMETERS .......................................................................................................................... 113 REPLICAT PARAMETERS ......................................................................................................................... 122 DATA MAPPING AND TRANSFORMATION ................................................................................... 131 DATA SELECTION AND FILTERING .......................................................................................................... 131 COLUMN MAPPING ................................................................................................................................. 138 FUNCTIONS ............................................................................................................................................. 141 SQLEXEC ............................................................................................................................................. 149 MACROS ................................................................................................................................................. 158 USER TOKENS......................................................................................................................................... 163 USER EXITS ............................................................................................................................................ 170 ORACLE SEQUENCES .............................................................................................................................. 177 CONFIGURATION OPTIONS .............................................................................................................. 178 BATCHSQL .......................................................................................................................................... 179 COMPRESSION ........................................................................................................................................ 182 ENCRYPTION .......................................................................................................................................... 183 EVENT ACTIONS ..................................................................................................................................... 187 BIDIRECTIONAL CONSIDERATIONS ......................................................................................................... 192 ORACLE DDL REPLICATION ................................................................................................................... 202 MANAGING ORACLE GOLDENGATE ............................................................................................. 211 COMMAND LEVEL SECURITY ................................................................................................................. 211 TRAIL MANAGEMENT ............................................................................................................................. 214

PROCESS STARTUP AND TCP/IP ERRORS ............................................................................................... 219 REPORTING AND STATISTICS .................................................................................................................. 221 MONITIORING ORACLE GOLDENGATE ................................................................................................... 229 TROUBLESHOOTING ................................................................................................................................ 235 TECHNICAL SUPPORT ............................................................................................................................. 244

and .meaning that the data available is as current as possible – not 24 hours old.meaning your critical data is accessible and available whenever you need it. . Real-Time Information Mission-Critical Systems Integration: the process of combining data from different sources to provide a unified view. Oracle GoldenGate provides solutions that enable your mission-critical systems to have continuous availability and access to real-time data. 24x7.Oracle GoldenGate Fundamentals Student Guide About GoldenGate – Company and Solutions Our Business We enable real-time. We offer a robust yet easy platform for moving real-time transactional data between operational and analytical systems to enable both: .High Availability solutions. At the same time… • Real-Time Information -. continuous movement of transactional data across Operational and Analytical business systems.Real Time Integration solutions • Real-Time Access -. not even 4 hours old. Real-Time Access to Real-Time Information Real-Time Access Availability: the degree to which information can be instantly accessed.

And because our software platform supports a variety of solution use cases… Our more than 500 customers are using our technology for over 4000 solutions around the world. including database and IT infrastructure. business intelligence. packaged applications. . What we typically find that once an initial solution is implemented and the benefits achieved..Oracle GoldenGate Success Company Strength and Service GoldenGate Software established in 1995 Acquired by Oracle in 2009 Global sales and support Rapid Growth in Strategic Partners 500+ customers. our customers then find additional areas across the enterprise where we can further drive advantages for them. Loyal Customer Base Our partnerships are rapidly increasing with major technology players.. and service providers. 4000+ solutions implemented… in 35 countries Established.

routes. 7 . modular architecture.Our reliability – our architecture is extremely resilient against potential interruptions. transforms. thanks to our open. Our Key Capabilities in which we architect the product are: • We move data essentially in “real time” – with sub-second speed. . transformation. routing. We further Differentiate ourselves from other technologies with: . no single point of failure or dependencies.Our flexibility – we meet a wide range of customer solution and integration needs. and delivers transactional data in real time – and it works across heterogeneous environments with very low impact and preserved transaction integrity.Oracle GoldenGate Fundamentals Student Guide Transactional Data Management (TDM) Oracle GoldenGate provides low-impact capture. and easy to recover. . modular architecture Resilient against interruptions and failures Heterogeneous Moves changed data across different databases and platforms Extensibility & Flexibility Transactional Maintains transaction integrity Reliability Our focus is on transactional data management (TDM) – which means delivering a platform in which that data can be best utilized in real-time enterprise wide.High performance with low impact – we can move large volumes of data very efficiently while maintaining very low lag times/latency. and delivery of database transactions across heterogeneous environments in real time Key Capabilities: Real Time Moves with sub-second latency Additional Differentiators: Performance Log-based capture moves thousands of transactions per second with low impact Meets variety of customer needs and data environments with open. • Works in heterogeneous environments – across different database and hardware types • Transactional – we are “transaction aware” and apply read-consistent changed data to maintain its referential integrity between source and target systems. Oracle GoldenGate captures.

directly or via ETL tools. Uses event-driven architecture (EDA) and service-oriented architecture (SOA).TRANSACTIONAL DATA INTEGRATION Oracle GoldenGate provides the following data replication solutions: •High Availability Live Standby for an immediate fail-over solution that can later re-synchronize with your primary source. •Operational Business Intelligence (BI) Real-time data feeds to operational data stores or data warehouses. Active-Active solutions for continuous availability and transaction load distribution between two or more active systems. . •Live Reporting Feeding a reporting database so that you don’t burden your source production systems. •Transactional data integration Real-time data feeds to messaging systems for business activity monitoring (BAM). •Zero-Downtime Upgrades and Migrations Eliminate downtime for upgrades and migrations. business process monitoring (BPM) and complex event processing (CEP).

we offer: • Active-Active solutions for continuous availability and transaction load distribution between two or more active systems •Zero-Downtime Operations that eliminates downtime for planned outages involving upgrades.Oracle GoldenGate Fundamentals Student Guide Oracle GoldenGate Solutions High Availability & Disaster Tolerance Real-Time Data Integration Live Standby Active-Active Zero-Downtime Operations for: Upgrades Migrations Maintenance Real-Time Data Warehousing Live Reporting Transactional Data Integration Oracle GoldenGate provides two primary solution areas: High Availability/Disaster Tolerance and Real-Time Data Integration. Within High Availability and Disaster Tolerance. migrations. we offer: • Real-Time Data Warehousing which gives you real-time data feeds to data warehouses or operational data stores •Transactional Data Integration for distributing data in real-time between transaction processing systems •Live Reporting is for feeding a reporting database so that you don’t burden your source production systems 9 . and ongoing maintenance •Live Standby for an immediate fail-over solution that can later re-synchronize with your primary source Within Real-Time Data Integration.

and an overall lower Total Cost of Ownership by putting your standby systems to work for other solutions! . it’s about “real-time” or CONTINUOUS access to your data via your critical applications. The benefits that Oracle GoldenGate drives here include: -Improved uptime and availability (helping you reach aggressive service level agreements/SLAs) -Higher Performance for your production systems – help to eliminate scalability or response time delays that can give users the impression of an availability or access issue -Faster Recovery and Minimized Data Loss – so you can achieve higher Recovery Time Objectives (RTOs) and Recovery Point Objectives (RPOs) .Oracle GoldenGate for High Availability & Disaster Tolerance High Availability & Disaster Tolerance Live Standby Active-Active Zero-Downtime Operations for: Upgrades Migrations Maintenance Real-Time Access Improved Uptime Higher Performance Faster Recovery Minimized Data Loss Lower TCO For High Availability and Disaster Tolerance solutions.

There is no database recovery process required because changed data is queued outside of the database in persisted Trail files.Oracle GoldenGate Fundamentals Student Guide High Availability: Live Standby Benefits: Eliminate unplanned downtime Reduce data loss and isolate corrupt data Re-synchronize backup and primary systems Remove distance constraints Automate switchovers Improve ROI with active standby available for reporting Live Standby: helps eliminate unplanned outages to enable continuous availability. and data loss risk is minimized. The customer’s Return on Investment can be further increased by using the live standby system for reporting or testing – Oracle GoldenGate allows the standby database to be open. with no geographic distance constraints. Oracle GoldenGate moves changed data from primary database to a standby in subseconds so that end users have a reliable failover system with up to date data that they can immediately switchover. Oracle GoldenGate also isolates corrupt data during movement to make sure the secondary system is reliable when it is needed. so it does not have to sit idle and can be put to work! 11 .

and allows load distribution to improve system performance. We have strong experience in active-active solutions for both High Availability as well as Zero-Downtime upgrades and migration projects. conflict management is required to ensure data accuracy in the event that the same row is changed in two or more databases at (or about) the same time. In the case of an outage of one system. with no geographic distance constraints. Because Oracle GoldenGate is an asynchronous solution. Oracle GoldenGate synchronizes the two active databases by replicating the data between each at a logical level. . Oracle GoldenGate provides capabilities to detect and resolve conflicts as well. The active-active solution allows data updates and changes (“write” activity) to occur on two or more active databases supporting live applications.High Availability: Active-Active Benefits: Achieve continuous availability Enable transaction load distribution (with built-in conflict resolution) Improve performance Lower TCO Active-Active: Oracle GoldenGate enables bidirectional data movement between two or more databases that actively support an application. A variety of active-active scenarios can be supported – depending on the desired implementations. there is no downtime for the end user because the other active system continues with operations.

database.Oracle GoldenGate Fundamentals Student Guide Zero-Downtime Upgrades and Migrations Benefits: Eliminate “planned downtime” during hardware. our Oracle GoldenGate Veridata product verifies that the data is consistent in both systems before and even after switchover. Oracle GoldenGate then keeps the two environments synched with our real-time replication.after switchover Oracle GoldenGate captures the changes that happen in the new system so that the old system is kept up to date in case there is a need for fail back to the old environment. Oracle GoldenGate alleviates many of those risks with our fail-back capabilities -. there is always concern about what will happen once you switchover to the new environment. OS and/or application upgrades and migrations Minimize risk with fail-back contingency Improve success with phased user migrations Zero Downtime Operations: is for eliminating planned outages during database. Oracle GoldenGate captures all the changed data in the primary system while the new system is initiated and prepared. Often with such projects. Once the second or the new system is upgraded or migrated Oracle GoldenGate applies all the changed data to the new system. And currently in Oracle or HP Nonstop environments. migrations. 13 . application or server upgrades. and/or maintenance.

and is overall easy to maintain over long term.Oracle GoldenGate for Real-Time Data Integration Real-Time Data Integration Real-Time Information Fresher Data Minimal Overhead No Batch Windows Data Integrity Ease of Integration Live Reporting Operational Business Intelligence Transactional Data Integration For our Real-Time Data Integration solutions. it’s about “real-time information” or access to CURRENT operational data. The benefits that Oracle GoldenGate drives here include: • Fresher. • Minimal overhead and impact on your source systems and overall architecture to capture and move real-time data • No requirement for batch windows • Transactional data integrity helps improve overall data quality • Ease of integration – Oracle GoldenGate easily fits into existing and desire architecture. . real-time data available for use and decision-making – remove latency as a technical constraint.

to lower the total cost of ownership and allow organizations to leverage emerging open source technologies. This allows reporting activity to be off-loaded from the production database. faster decision making Remove reporting overhead on source system Reduce cost-to-scale as user demands and data volumes grow Leverage cost-effective systems for reporting needs Oracle GoldenGate's Live Reporting enables both real-time reporting capabilities while improving the performance of operational source systems. 15 .Oracle GoldenGate Fundamentals Student Guide Data Integration: Live Reporting Benefits: Use real-time data for better. The solution also helps increase scalability as user demands and data volumes grow. This secondary database can be a different database and/or platform from the production database. Oracle GoldenGate feeds real-time data from the source to a secondary reporting-only database such as an operational data store (ODS).

no batch windows and moves the data in sub-seconds. This method works best when the ETL product is optimized to perform the transformations within the target database. . Oracle GoldenGate can deliver transactional data to staging tables in real time. In each of these architectures combining real-time change data capture with ETL decreases data latency to real time or near real-time and eliminates the batch window dependency. The latency depends on the ETL product and business requirements but we typically deliver every few minutes to an hour. Our log-based changed data capture has very minimal impact on the source. faster decision making Eliminate batch window dependency Reduce overhead on source system Maintain referential integrity for data quality Leverage its flexibility for transformations and integration with ETL 18 For Real-Time Data Warehousing -. which then would be used by the ETL to extract from and perform transformations and then load user tables.Operational Business Intelligence Benefits: Use real-time data for better. so if needed they can be reapplied to the target and also source system without having to capture the data again. Each transaction’s commit boundaries are maintained for data integrity. However. to improve business intelligence. 3) Third method: Oracle GoldenGate publishes changed data to a messaging system and the ETL solution (that can subscribes to the queue or topic) receives it in realtime. 2) Second method: Oracle GoldenGate provides the data to the ETL engine as flat files and in micro-batches.The Oracle GoldenGate Real-Time Data Warehousing solution enables continuous. Oracle GoldenGate’s trail files that store the changed data are persisted. Transformations or co-existing with ETL: Oracle GoldenGate out-of-the box can support a number of common data transformations often required for data integration. real-time data feeds for data warehouses or operational data stores. where complex transformations are needed Oracle GoldenGate can be used to augment an existing ETL solution in several ways: 1) First. This is an important requirement as data latency decreases in feeding the analytical environment. This is an “ELT” model. Oracle GoldenGate’s architecture also improves data recoverability in case there is an outage during the data movement.

The solution can also integrate with JMS-based messaging systems to enable event driven architecture (EDA) and to support service oriented architecture (SOA). 17 .Oracle GoldenGate Fundamentals Student Guide Transactional Data Integration Benefits: Easily integrate large volumes of real-time data between transaction processing systems Reduce overhead. Eliminate batch windows Improve scalability Enhance SOA and EDA environments (delivery to JMS-based messaging systems) 19 Oracle GoldenGate provides real-time data integration between OLTP systems nonintrusively and with minimal impact. utilize. and act on the most current operational data available. Distributed databases and the applications they support can continuously access.

typically the redo log.Technology Overview How Oracle GoldenGate Works: Modular “Building Blocks” Capture: Committed changes are captured (and can be filtered) as they occur by reading the transaction logs. • Advanced queuing (trail files): To move transactional data efficiently and accurately across systems. Delivery: Applies data with transaction integrity. Oracle GoldenGate only moves changed. Route: Data is compressed.at table. On the target system(s): •A Server Collector process (not shown) reassembles the transactional data into a target trail. Data compression and encryption are supported. Trail files: Stages and queues data for routing. encrypted for routing to targets. Oracle GoldenGate’s unique architecture eliminates any single point of failure and ensures data integrity is maintained – even in the event of a system error or outage. Oracle GoldenGate converts the captured data into a Oracle GoldenGate data format in “trail” files. committed transactional data. Capture Source Trail Network (TCP/IP) Target Trail Delivery Source Database(s) Delivery Target Trail Bi-directional Source Trail Capture Target Database(s) Oracle GoldenGate consists of decoupled modules that are combined to create the best possible solution for your business requirements. On the source system(s): GoldenGate’s Capture (Extract) process reads data transactions as they occur. . without distance limitations. column and/or row level. • Filtering can be performed at the source or target . • Transformations can be applied at the capture or delivery stages. •Oracle Routing: •Data is sent via TCP/IP to the target systems. transforming the data as required. which is only a % of all transactions – therefore operating with extremely high performance and very low impact on the data infrastructure. Thousands of transactions can be moved per second. With both source and target trail files. by reading the native transaction log.

19 . and any ODBC compatible databases ETL products JMS message queues O/S and Platforms Windows 2000. Bi-directional: •In bi-directional configurations/solutions. several data warehouse appliances. this process runs the same in reverse. HP Neoview. ETL servers. We can Deliver that data to an even wider range of targets – including open source databases. We support log-based Capture of changed data from nearly all major database vendors. to concurrently synchronize data between the source and target systems. Netezza. XP Linux Sun Solaris HP NonStop HP-UX HP TRU64 HP OpenVMS IBM AIX IBM z/OS Oracle GoldenGate is ideal for heterogeneous environments – not just supporting different versions of the same database or operation system/hardware.Oracle GoldenGate Fundamentals Student Guide •The Delivery (Replicat) process applies transactional data to the designated target systems using native SQL calls. but replicating and integrating data across vendor systems. Oracle GoldenGate Supports Applications Running On… Databases Capture: Oracle DB2 Microsoft SQL Server Sybase ASE Ingres Teradata Enscribe SQL/MP SQL/MX Delivery: All listed above MySQL. and JMS message queues to support Service Oriented Architectures (SOA) and Event-Driven Architectures (EDA). Manager processes (not shown) perform administrative functions at each node. 2003.

Row. Resolution Dynamic Rollback Incremental TDM Initial Data Load GUI-based Monitoring and Configuration Proactive Alerts Encryption Real-Time Deferred or Batch Event Markers Integration Heterogeneous Data Sources Mapping Transformation Enrichment Decoupled Architecture Table. Local Apply Efficient IO and Bandwidth Usage Bidirectional Group Transactions Bulk Operations Compression One-to-Many. SQL Formats Queue Interface Stored Procedures User Exits ETL Integration Java/JMS Integration Oracle GoldenGate Director Manages. defines. Oracle GoldenGate Director is a value added module to centralize management and improve productivity. manage. and report on Oracle GoldenGate processes. Column Filtering XML.Oracle GoldenGate Advantages Movement Speed – Subsecond Latency Volume – Thousands of TPS Log-based Capture Native. configures. Oracle GoldenGate Director supports all platforms and databases supported by Oracle GoldenGate. ASCII. and reports on Oracle GoldenGate components Key features: Centralized management of Oracle GoldenGate modules Rich-client and Web-based interfaces Alert notifications and integration with 3rd-party monitoring products Real-time feedback Zero-impact implementation Oracle GoldenGate Director is a centralized server-based graphical enterprise application that offers an intuitive way to define. configure. . Many-to-One Cascade Management Transaction Integrity Transparent Capture Guaranteed Delivery Conflict Detection.

or unexpected user behavior.Oracle GoldenGate Fundamentals Student Guide Oracle GoldenGate Veridata A high-speed. companies can audit and verify large volumes of data across a variety of business applications with certainty. SQL Server. low impact data comparison solution Identifies and reports data discrepancies between two databases without interrupting those systems or the business processes they support Supports Oracle. and maintain reliable data synchronization. 21 . configuration errors. or regulatory risks. Oracle GoldenGate Veridata reduces the amount of time and resources required to compare data. it minimizes the impact of human errors. application errors. operator mistakes. financial. companies can eliminate data inconsistencies across different business applications and avoid potential operational. Teradata.due to infrastructure problems. NonStop SQL/MP and Enscribe Supports homogeneous and heterogeneous compares Benefits: Reduce financial/legal risk exposure Speed and simplify IT work in comparing data sources No disruption to business systems Improved failover to backup systems Confident decision-making and reporting Oracle GoldenGate Veridata is a high-speed data comparison solution that identifies and reports data discrepancies between databases without interrupting ongoing business processes. parallel comparison •Offers intuitive Web interface and personalized views •Enables the comparison of databases that are different database versions or on different operating systems •(HP Nonstop only) Supports the comparison of only the data changed since the initial comparison (delta processing) Why would you need Veridata? Data discrepancies arise even without malicious intent -. Key Veridata Features: •Compares large data volumes with high speed and efficiency •Allows both data sources to be online by handling in-flight transactions •Performs selective. and it ensures that potential problems can be instantly identified and addressed. With vigilant verification procedures using Oracle GoldenGate Veridata. Using Oracle GoldenGate Veridata.

On the target system: A Server Collector process reassembles and writes the data to a GoldenGate trail. This can be concurrent with the data capture or performed later. A Replicat process reads the trail and applies it to the target database.Architecture Oracle GoldenGate Data Capture and Delivery Oracle GoldenGate Transactional Data Management: Primarily used for change data capture and delivery from database transaction logs Can optionally be used for initial load directly from database tables Especially useful for synchronizing heterogeneous databases Database-specific methods may be preferable for homogeneous configurations Change Data Capture & Delivery Source Database Network (TCP/IP) Extract Transaction Log Server Collector Replicat Target Database Trail Manager Manager On the source system: An Extract process captures transactional changes from transaction logs The Extract process sends data across a TCP/IP network to the target system. .

23 . This can be concurrent with the data capture or performed later.Oracle GoldenGate Fundamentals Student Guide Manager processes on both systems control activities such as starting. and reporting errors and events. Manager processes on both systems control activities such as starting. On the target system: A Server Collector process reassembles and writes the data to a GoldenGate trail. and reporting errors and events. A second Extract process (called a Data Pump) sends the data across the network to the target system. allocating data storage. Change Data Capture & Delivery using a Data Pump Source Database Network (TCP/IP) Extract Transaction Log Local Trail Data Pump Server Collector Remote Trail Replicat Target Database Manager Manager On the source system: An Extract process captures transactional changes from the database transaction log The Extract process writes the data to a local GoldenGate trail. monitoring and restarting processes. A Replicat process reads the trail and applies it to the target database. This preserves the captured data if the network or target trail fails. allocating data storage. monitoring and restarting processes.

Direct Load.Initial Load Source Database Tables Extract Network (TCP/IP) Replicat Or DB Bulk Load Utility Target Database Server Collector Files Manager Manager GoldenGate initial load methods: Direct Load (Extract sends data directly to Replicat to apply using SQL) Direct Bulk Load (Replicat uses Oracle SQL*Loader API) File to Replicat (Extract writes to a file that Replicat applies using SQL) File to database utility (Extract writes to a file formatted for a DB bulk load utility) On the source system: An Extract process captures source data directly from tables The Extract process sends data in large blocks across a TCP/IP network to the target system. Direct Bulk Load (Oracle). which applies the data to the target database. Manager processes on both systems control activities such as starting. File to Replicat. . On the target system. Server Collector reassembles and writes the data to Extract files. one of the following scenarios: 1. 3. Replicat reads the data stream and concurrently applies the data to the target database using SQL. Server Collector reassembles and writes the data to files formatted for a bulk loader. 4. Replicat can apply the data using the Oracle SQL*Loader API to improve performance. Replicat applies the data to the target database using SQL. File to database utility. and reporting errors and events. 2. monitoring and restarting processes. allocating data storage.

the network. Checkpointing . and they prevent redundant extractions. or a GoldenGate process need to be restarted.Oracle GoldenGate Fundamentals Student Guide Online versus Batch Change data capture & delivery can be run either continuously (online) or as a special run (batch run) to capture changes for a specific period of time.Extract For change data capture. They provide fault tolerance by preventing the loss of data should the system. Extract and Replicat save checkpoints to a checkpoint file so they can recover in case of failure Extract maintains: 2 input checkpoints 1 output checkpoint for each trail it writes to Start of oldest uncommitted transaction in log Input: Transaction Log Last record read from log Checkpoints Output: One or more GoldenGate Trails End of last committed transaction written to trail Checkpoints are used during online change synchronization to store the current read and write position of a process. Initial load is always a special run (batch run). Checkpoints ensure that data changes marked for synchronization are extracted. 25 .

Processes are added and started using the GoldenGate Software Command Interface (GGSCI) with the group name. . GGSCI commands also add trails. check process status. A process group consists of: An Extract or Replicat process Associated parameter file Associated checkpoint file Any other files associated with that process Each process group on a system must have a unique group name. Process Groups and Commands GoldenGate processes are configured by ASCII parameter files. etc.Replicat Best practice is to create a checkpoint table in the target database Checkpoints are maintained in both the checkpoint table (if it exists) and a checkpoint file Replicat maintains 2 input checkpoints: Start of current uncommitted transaction Input: GoldenGate Trail Last record read from trail Checkpoints Parameters.Checkpointing .

heterogeneous and transactional. (a) High availability – live standby. 3. What is the purpose of checkpointing? 1. 27 . active-active. (b) Real-time data integration – real-time data warehousing (operational business intelligence). zero down-time upgrades and migrations. network or system goes down. How is Oracle GoldenGate different from simply replicating database operations? 2. decoupled from database architecture. Real-time. live reporting. transactional data integration. Log-based change data capture. 2. For recovery if a GoldenGate process. What are some use cases for Oracle GoldenGate software? 3.Oracle GoldenGate Fundamentals Student Guide Solutions and Architecture – Discussion Points 1.

Change Delivery Oracle GoldenGate can be deployed quickly and easily in four steps: • Prepare the environment. Initial Load (various methods) Target Database Transaction Log Extract Local Trail 2. Configuring Oracle GoldenGate 1.g. Prepare the Environment 2. Change Capture 3. Change Capture Data Pump Remote Trail Replicat 4. Initial Load 4.Configuring Oracle GoldenGate Configuring Oracle GoldenGate Oracle GoldenGate can be deployed quickly and easily in four steps: 1. Prepare the Environment Source Database 3. Change Delivery Note: You can run log-based change capture after the initial data load if you set the extract begin time to the start of the longest running transaction committed during the initial data load. e. • Install Oracle GoldenGate software on source and target • Enable transaction logging .

Oracle GoldenGate Fundamentals Student Guide • • • (Heterogeneous source/target) Generate source definitions so Replicat can process trail data Configure and start change capture to GoldenGate trail files (Extract processes – primary and data pump) Perform initial load to synchronize databases by database-specific or GoldenGate methods Configure and start change delivery (Replicat process) • Step 1. Prepare the Environment Source Database 3. Prepare the Environment Step 1. Initial Load (various methods) Target Database Transaction Log Extract Local Trail 2. Prepare the Environment Set up each system: Install Oracle GoldenGate software on source and target Configure and start GoldenGate Manager on source and target If heterogeneous source/target. Prepare the Environment 1. Change Capture Data Pump Remote Trail Replicat 4. Change Delivery Step 1. For example: Ensure database access by GoldenGate Enable transaction logging 29 . generate source definitions and copy to target Prepare the database.

Manager must be running on each system before Extract or Replicat can be started. To reconstruct an update operation. GoldenGate needs more information than Oracle and SQL Server transaction logs provide by default. The source definitions file contains the definitions of the source tables and is required on the target system in hetereogeneous configurations. Replicat refers to the file to when transforming data from the source to the target.oracle. .com Identify the proper release of GoldenGate for your source and target environments Database and version Operating system and version A GoldenGate instance is a single installation of GoldenGate. and must remain running while those processes are running so that resource management functions are performed.Installing Oracle GoldenGate installs all of the components required to run and manage GoldenGate processing. and it installs the GoldenGate utilities. Adding supplemental log data forces the logging of the full before and after image for updates. Install Oracle GoldenGate Software Prepare Environment: Installation – Access the Media Pack Access the product media pack (software and documentation) at edelivery.

whether or not they are within quotes. when run 31 . DELETEEVENTS Deletes GoldenGate events from the registry.Oracle GoldenGate Fundamentals Student Guide Prepare Environment: Installation . for example “GoldenGate Software. Prepare Environment: Installation – Windows INSTALL Program On Windows. However. and the operating system does not support path names that contain spaces. an INSTALL program performs the following functions: Installs GoldenGate event messages into the system registry Installs the Manager as a Windows service Syntax: INSTALL <item> [<item> …] Example: C:\GGS> INSTALL ADDEVENTS ADDSERVICE Note: The uninstall command is: INSTALL DELETESERVICE DELETEEVENTS Items (all optional) ADDEVENTS Adds the GoldenGate events to the registry so that event messages appear in the Windows Event Log.zip file to C:\GGS Unzip .Windows Download .” The application references path names. ADDSERVICE Defines the GoldenGate Manager process as a Windows service (Recommended) Manager can run by a local or domain account.zip file into C:\GGS folder Configure a Windows Service Name for Manager process in a GLOBALS parameter file (required only if multiple Managers on the server) C:\GGS> INSTALL ADDSERVICE ADDEVENTS GGSCI> CREATE SUBDIRS For Windows: Do not install Oracle GoldenGate into a folder that contains spaces in its name.

You can configure the Manager service to run as the Local System account or as a specific named account. user name should include the domain name. or GoldenGate with a Veridata C Agent (which uses a Manager) Each Manager service must be assigned a unique name Before installing the service.this way. DELETESERVICE Removes the GoldenGate Manager service. you can install Manager as a Windows service so that it can be operated independently of user connections and can be configured to start either manually or when the system starts. PASSWORD Specifies the user’s password for logon purposes. By using install. Prepare Environment: Installation . AUTOSTART Specifies that the service be started at system boot time (the default). as opposed to runtime parameters for a specific process. USER Specifies a user name to logon as when executing Manager. This file is referenced when installing the Windows service. uses default service name GGSMGR A GLOBALS file stores parameters that relate to the GoldenGate instance as a whole. If specified. a backward slash. This can be changed using the Control Panel Services applet. you can specify the name Create a GLOBALS parameter file for each Manager Specify the one-word name of the service using the MGRSERVNAME <name> parameter INSTALL ADDSERVICE Reads the GLOBALS MGRSERVNAME for the service name If no GLOBALS setting. . MANUALSTART Specifies that the service be started only at user request (with GGSCI or the Control Panel Services applet). The configuration of a service can be changed by using the Services applet of the Windows Control Panel and changing the service Properties. and the user name.Multiple Manager Services GoldenGate supports running multiple Manager services on Windows For two or more GoldenGate instances. so that the correct name is registered. Manager will stop when the user logs out.

z/OS.Oracle GoldenGate Fundamentals Student Guide Prepare Environment: Installation .tar. as directed by the vendor’s documentation.gz file to /ggs gzip –d {filename}. or Linux: Use the gzip and tar options appropriate for your system. so that GoldenGate will fail over properly with the other applications.tar GGSCI> CREATE SUBDIRS Run the ggmxinstall script For a SQL/MX target. The Manager process is the master control program for all GoldenGate operations.tar GGSCI> CREATE SUBDIRS For UNIX. 33 . Linux or z/OS Download . Prepare Environment: Installation – NonStop SQL/MX For a SQL/MX source. make certain that the GoldenGate binaries and files are installed on a file system that is available to all cluster nodes.UNIX.tar. After installing GoldenGate. install Oracle GoldenGate on OSS running on the NonStop source system: Download . install Oracle GoldenGate Either on OSS running on the NonStop target system (as described above) Or on an intermediate Windows system(as described earlier) The ggmxinstall script SQL compiles the Extract program and installs the VAMSERV program in the NonStop Guardian space. A GoldenGate instance is a single installation of GoldenGate.gz tar -xvof {filename}. If you are installing GoldenGate into a cluster environment.gz tar -xvf {filename}. make certain to configure the GoldenGate Manager process within the cluster application.gz file to /ggs gzip –d {filename}.

Do not edit these files. rep1. Written in internal GoldenGate format. Prepare Environment: Installation .cpr dirdat The default location for GoldenGate trail files and extract files created by Extract processes to store records of extracted data for further processing. Examples: ext1.cpe.<ext> where <sequence number> is a sequential number appended to aged files and <ext> is either cpe for Extract checkpoint files or cpr for Replicat checkpoint files. Written in internal GoldenGate format. finance dirdef .GoldenGate Directories Directory dirchk dirdat dirdef dirpcs dirprm dirrpt dirsql dirtmp Contents GoldenGate checkpoint files GoldenGate trail and extract files Data definitions produced by DEFGEN and used to translate heterogeneous data Process status files Parameter files Process report files SQL scripts Temporary storage for transactions that exceed allocated memory dirchk Contains the checkpoint files created by Extract and Replicat processes. Do not edit these files. Examples: rt000001. either by the Replicat process or another application or utility. The file name format is <group name><sequence number>. which store current read and write positions to support data accuracy and fault tolerance. File name format is a user-defined two-character prefix followed by either a six-digit sequence number (trail files) or the user-defined name of the associated Extract process group (extract files).The command to run it is: OSS> ggmxinstall /G/<Guardian vol>/<Guardian subvol> where: <Guardian vol>/<Guardian subvol> is the destination NonStop volume and subvolume in OSS format.

ext.prm or mgr.rpt. Do not edit these files. File name format is <group name/user-defined name>. the port.pcm.rpt dirsql The default location for SQL scripts. They can be edited directly from a text editor or by using the EDIT PARAMS command in GGSCI. dirtmp The default location for storing large transactions when the size exceeds the allocated memory size. Replicat. and Manager processes to report statistical information relating to a processing run.rpt where <sequence number> is a sequential number appended to aged files. If you are unsure of how to edit a definitions file. The file shows the program name. and process ID that is running.dat dirpcs Default location for status files. File name format is <group>.prm. Do not edit these files. Written in external ASCII format. contact technical support. File name format is a user-defined name specified in the DEFGEN parameter file. pcr (Replicat). Written in external ASCII.Oracle GoldenGate Fundamentals Student Guide The default location for data definitions files created by the DEFGEN utility to contain source or target data definitions used in a heterogeneous synchronization environment. finance. Examples: defgen.prm. Do not edit these files. These files may be edited to change GoldenGate parameter values. Examples: mgr. the process name.prm dirrpt The default location for process report files created by Extract. Examples: fin2. Example: defs.<extension> where <group> is the name of the group and <extension> is either pce (Extract). These files may be edited to add definitions for newly created tables. Written in external ASCII format. These files are only created while a process is running. or pcm (Manager). mgr4.pce dirprm The default location for GoldenGate parameter files created by GoldenGate users to store run-time parameters for GoldenGate process groups or utilities. File name format is <group name><sequence number>. 35 .

● Oracle GoldenGate Installation and Setup Guides: There is an installation guide and setup guide for each database that is supported by Oracle GoldenGate.com/technology/documentation/index. and functions for the Windows and UNIX platforms. .oracle. ● Oracle GoldenGate Troubleshooting and Tuning Guide: Provides suggestions for improving the performance of Oracle GoldenGate in different situations. ● Oracle GoldenGate Administration Guide: Introduces Oracle GoldenGate components and explains how to plan for. and provides solutions to common problems.html Windows and UNIX platforms: ● Oracle GoldenGate Quick Install Guide: Describes the structure of the media pack and where to find installation instructions. These include database-specific configuration information. commands.Oracle GoldenGate Documentation Prepare Environment: Oracle GoldenGate Documentation Quick Install Guide Installation and Setup Guides (by database) Administration Guide Reference Guide Troubleshooting and Tuning Guide Note: You can download the documentation from http://www. configure. and implement Oracle GoldenGate on the Windows and UNIX platforms. ● Oracle GoldenGate Reference Guide: Provides detailed information about Oracle GoldenGate parameters.

Overview Performs system management and monitoring tasks Starting GoldenGate processes Starting dynamic Server Collector. If no mgr. including the following.log file The Manager process performs system management and monitoring tasks on Windows and Unix. when Extract falls behind GGSLOG) Purging trails Purging of GGSLOG or GGSLOG_HISTORY data Manager Parameters Enter Manager parameters in the dirprm/mgr.log file in the GoldenGate installation directory. 37 .prm file exists.prm file. Starting Server Collector processes to collect data from remote Extract processes Threshold reporting (for example. or GGSCI processes Error and lag reporting GoldenGate trail management Parameter file mgr. Error and Informational Reporting Manager reports critical and informational events to the ggserr. Replicat. default management parameters are used./dirprm directory Event information written to ggserr.Oracle GoldenGate Fundamentals Student Guide Configure and Start Manager Prepare Environment: Manager .prm file in GGS . under the GoldenGate installation directory.

Configuration Create the parameter file using GGSCI GGSCI> EDIT PARAM MGR Start the Manager using GGSCI GGSCI> START MGR Note: To determine which port Manager is using GGSCI> INFO MGR Starting Manager You must start Manager before most other configuration tasks performed in GGSCI. 8002. MINKEEPDAYS 5 AUTOSTART ER * AUTORESTART EXTRACT *. you can also start and stop Manager through the standard Windows services control applet (in Control Panels). and those in the range 9500 to 9520 will be assigned to the dynamic processes started by Manager.Prepare Environment: Manager . WAITMINUTES 2. 9500–9520 PURGEOLDEXTRACTS /ggs/dirdat/aa*. & USECHECKPOINTS. 8002. Use either START MANAGER or START MGR. It will only recycle the trail once all Extracts . This manager process will recycle GoldenGate trails that match the file name of /ggs/dirdat/aa* and /ggs/dirdat/bb*. Ports 8001. Prepare Environment: Manager – Sample MGR Parameter File PORT 7809 DYNAMICPORTLIST 8001. On Windows systems. RETRIES 5 LAGREPORTHOURS 1 LAGINFOMINUTES 3 LAGCRITICALMINUTES 5 This parameter file has the Manager listening on PORT 7809. USECHECKPOINTS PURGEOLDEXTRACTS /ggs/dirdat/bb*.

Overview The problem Understanding source and target layouts across disparate systems and databases The solution – the DEFGEN utility program DEFGEN produces a file containing layout definitions of the source files and tables This source definition file is used to interpret layouts for data stored in GoldenGate trails . 39 . you must understand both the source and target layouts. The Solution .The DEFGEN Utility Program The DEFGEN utility program produces a file containing a definition of the layouts of the source files and tables. The message will be flagged informational for lags of 3 minutes and critical for any process that has a lag greater than 5 minutes.Oracle GoldenGate Fundamentals Student Guide and Replicats have a checkpoint beyond the file (USECHECKPOINTS). Extract can use a definition file containing the target. Understanding column names and data types is instrumental to GoldenGate’s data synchronization functions. When transformation services are required on the source system. Transforming. but only for processes that have 3 and 5 minutes of latency. The manager will automatically start any Extract and Replicat process at startup and will attempt to restart any Extract process that abends after waiting 2 minutes.At start up Replicat reads the definition file specified with the SOURCEDEFS parameter . however bb* trails will not be purged until there has been no activity for 5 days. and Delivering data across disparate systems and databases. The output definitions are saved in an edit file and transferred to all target systems in text format. rather than source. Generate Source Definitions (Heterogeneous Source/Target) Prepare Environment: Source Definitions . but only up to 5 attempts. The manager will report lag information every hour. layouts. Replicat and Collector read in the definitions at process startup and use the information to interpret the data from the GoldenGate trails.Server Collector uses the –d argument to specify which definition file to read at startup Can also capture target definitions on target system and copy to source system for Extract to use The Problem When Capturing.

Sample DEFGEN Parameters DEFSFILE /ggs/dirdef/source.prm reportfile c:\ggs\dirrpt\defgen. TABLE SALES.PRODUCT.Note: The user should never modify the DEFGEN output.rpt Definitions are saved to the file specified in the parameter file This file needs to be transferred to the target system as a text file Prepare Environment: Source Definitions . Parameter DEFSFILE SOURCEDB USERID TABLE Specifies The output definitions file location and name The database name (if needed) The user ID and password (if needed) to access the database The table(s) to be defined . USERID ggs.ACCOUNT.def. PASSWORD ggs TABLE SALES. Prepare Environment: Source Definitions – Run DEFGEN DEFGEN is initiated from the command prompt: defgen paramfile <paramfile> [ reportfile <reportfile> ] Unix Example: defgen paramfile /ggs/dirprm/defgen. PURGE SOURCEDB mydb.prm reportfile /ggs/dirrpt/defgen.rpt Windows Example: defgen paramfile c:\ggs\dirprm\defgen.

the user must have the same permissions as the GoldenGate user on the source system plus additional privileges to perform DML on the target tables.Oracle GoldenGate Fundamentals Student Guide Prepare the Source Database Prepare Environment: Source Database – Overview Set up the database to: Ensure access by GoldenGate Enable transaction logging Note: the exact steps depend on the database Database access You need to assign a database user for each of the GoldenGate processes. unless the database allows authentication at the operating system level. In general. 41 . To ensure that processing can be monitored accurately. the following permissions are necessary for the GoldenGate user: • On the source system. GoldenGate recommends creating a user specifically for the GoldenGate application. the user must have permissions to select data against the tables. do not permit other users or processes to operate as the GoldenGate user. While not required. • On the target system. the user must have permissions to read the data dictionary or catalog tables. • On the source system.

GoldenGate reads the archived logs by default. GoldenGate recommends archive logging be enabled. . but GoldenGate recommends using ADD TRANDATA.On UNIX. The GoldenGate process will manage the secondary truncation point once it has been established. the script ggmxinstall sets a pointer to the VAM that will work with Extract to capture changes from the TMF audit trail. or the archived logs if an online is not available. each one must be marked for replication. GoldenGate reads the online logs by default.Prepare Environment: Source Database Oracle Add minimal supplemental logging at database level ADD TRANDATA to mark tables for replication DB2 Enter DATA CAPTURE CHANGES at the column for LOB data type ADD TRANDATA to mark tables for replication Sybase Set the secondary truncation point in the logs ADD TRANDATA to mark tables for replication NonStop SQL/MX Special installation steps but no special database preparation Oracle logs . and that you keep the archived logs on the system for the longest time possible. each table to be captured must be configured to capture data for logging purposes. This can be done through the database. DB2 . The secondary truncation point must be established prior to running the GoldenGate Extract process. GoldenGate uses the secondary transaction log truncation point to identify transaction log entries that have not been processed by the Extract process.In addition to enabling logging at a global level. This is accomplished by the DATA CAPTURE CHANGE clause in the CREATE TABLE statement. This prevents the need to resynch data if the online logs recycle before all data has been processed. NonStop SQL/MX During the installation of SQL/MX. On the Windows platform. Sybase –To capture database operations for tables that you want to synchronize with GoldenGate. or the online logs if an archive is not available.

The other preparation is done using Windows and SQL Server utilities. 43 . SQL Server Query Analyzer is used to access the database to turn off log truncation and non-logged bulk copy. SQL Server Enterprise Manager is used to set full recovery mode and back up the database.Oracle GoldenGate Fundamentals Student Guide Prepare Environment: Source Database – SQL Server To prepare the SQL Server source environment for GoldenGate: Create the ODBC data source GoldenGate connects to a SQL Server database through an ODBC connection Extract and Replicat require an established data source name (dsn) Set up transaction logging Log truncation and non-logged bulk copy must be turned off The SQL Server database must be set to full recovery mode Before GoldenGate processes are started. at least one full database backup must be done ADD TRANDATA to mark tables for replication Supplemental logging is enabled using the GoldenGate command interface GGSCI. ODBC Data Source Administrator is used to configure and define the ODBC connection and to define the data source.

GoldenGate does not depend on the Distributor database.The requirement that all tables to be captured from SQL Server 2005 source databases must have a primary key is a requirement of the Microsoft replication component. Use the MANAGESECONDARYTRUNCATIONPOINT option if GoldenGate will not be running concurrently with SQL Server replication. One Distributor can be used for all of these databases. MANAGESECONDARYTRUNCATIONPOINT Required TRANLOGOPTIONS parameters control whether or not GoldenGate maintains the secondary truncation point. Primary Key Requirement . so transaction retention can be set to zero.Prepare Environment: Source Database – SQL Server 2005 Additional considerations for SQL Server 2005 database: Either install Microsoft Cumulative Update package 6 for SQL Server 2005 Service Pack 2 (or later) Set TRANLOGOPTIONS to MANAGESECONDARYTRUNCATIONPOINT Or install SQL Server replication components Create a distribution database Add a replication publication Set transaction retention to zero Disable replication alerts Log full before and after images (no compressed) Set TRANLOGOPTIONS to NOMANAGESECONDARYTRUNCATIONPOINT The Distributor database must be used only for source databases to be replicated by GoldenGate. the GoldenGate extraction process can process at its customary high speed. which is utilized by GoldenGate as part of the logbased capture process. Allows SQL Server replication to manage the secondary truncation point. Because GoldenGate does not depend on the Distributor database. Connecting .Use SQL Server Management Studio for SQL Server 2005/2000 to connect to a MS SQL Server 2005 or 2000 database. Use the NOMANAGESECONDARYTRUNCATIONPOINT option if GoldenGate will be running concurrently with SQL Server replication. Use Enterprise Manager only for MS SQL Server 2000. see the GoldenGate for Windows and UNIX Administrator Guide. . For instructions on installing the replication component and creating a Distributor database. but rather reads the logs directly.

Starting and stopping processes. reporting lag.com 2.Oracle GoldenGate Fundamentals Student Guide Prepare Environment – Discussion Points 1. errors and events. 45 . monitoring processes.oracle. purging trail files. What are the roles and responsibilities of the Manager process? 1. edelivery. Where do you download Oracle GoldenGate software from? 2.

Examples: STATUS EXTRACT FINANCE. Syntax: STATUS EXTRACT <group name> [. ALLPROCESSES] <group name> is the name of a group or a wildcard (*) to specify multiple groups. TASKS] [.GoldenGate Command Interface GGSCI – Starting and Help Start the command interface from the GoldenGate install directory: Shell> cd <GoldenGate install location> Shell> GGSCI For Help Summary page: GGSCI> HELP For Help on a specific command: GGSCI> HELP <command> <object> For example: GGSCI> HELP ADD EXTRACT Help returns overview. ALLPROCESSES displays status of all Extract processes. TASKS displays status of all Extract tasks. STATUS EXTRACT FIN* . The following is an example of the information returned when you enter HELP STATUS EXTRACT: Use STATUS EXTRACT to determine whether or not Extract groups are running. syntax and example Golden Gate Software Command Interface (GGSCI) provides on-line help for all commands. including tasks.

INFO Displays information about an object (status. LAG Displays the lag between when a record is processed by the process and the source record timestamp. REFRESH Refreshes Manager parameters (except port number) without stopping Manager. etc). STATUS Displays whether a process is running.Oracle GoldenGate Fundamentals Student Guide GGSCI Commands MANAGER ADD ALTER CLEANUP DELETE INFO KILL LAG REFRESH SEND START STATS STATUS STOP X X X X X X X X X X X X X X X X X X X X X EXTRACT X X X X X X X REPLICAT X X X X X X X X X X X X X X X X X ER EXTTRAIL X X RMTTRAIL X X X X X X X TRANDATA X CHECKPOINT TABLE X TRACE TABLE X Objects Manager. RMTTRAIL Remote trail. STOP Stops a process gracefully. Commands ADD Creates an object or enables TRANDATA capture. KILL Forces a process to stop (no restart). ALTER Changes the attributes of an object. Replicat GoldenGate processes. 47 . CLEANUP Deletes the run history of a process or removes records from a checkpoint table. TRANDATA Transaction data (from transaction logs). EXTTRAIL Local trail. CHECKPOINTTABLE Checkpoint table (on target database). STATS Displays statistics for one or more processes. DELETE Deletes an object or disables TRANDATA capture. SEND Sends commands to a running process. START Starts a process. ER Multiple Extract and Replicat processes. TRACETABLE Oracle trace table (on target database). Extract.

GGSCI Commands (cont’d)

Commands Parameters Database DDL Miscellaneous SET EDITOR, EDIT PARAMS, VIEW PARAMS DBLOGIN, ENCRYPT PASSWORD, LIST TABLES DUMPDDL [SHOW] !command, CREATE SUBDIRS, FC, HELP, HISTORY, INFO ALL, OBEY, SHELL, SHOW, VERSIONS, VIEW GGSEVT, VIEW REPORT

Parameter commands SET EDITOR Changes the default text editor for the current GGSCI session from Notepad or vi to any ASCII editor. EDIT PARAMS Edits a parameter file. VIEW PARAMS Displays the contents of a parameter file. Database commands DBLOGIN Establishes a database connection through GGSCI. ENCRYPT PASSWORD Encrypts a database login password. LIST TABLES List all tables in the database that match a wildcard string. DDL commands DUMPDDL Saves the GoldenGate DDL history table to file. SHOW option displays the DDL information in standard output format. Miscellaneous commands !command Executes a previous GGSCI command without modification. CREATE SUBDIRS Creates default directories within the GoldenGate home directory. FC Edit a previously issued GGSCI command. HELP Displays information about a GGSCI command. HISTORY List the most recent GGSCI commands issued. INFO ALL Displays the status and lag for all GoldenGate processes on a system. OBEY Runs a file containing a list of GGSCI commands. SHELL Run shell commands from within GGSCI. SHOW Displays the GoldenGate environment. VERSIONS Displays OS and database versions. VIEW GGSEVT Displays the GoldenGate event/error log. VIEW REPORT Displays a process report for Extract or Replicat.

Oracle GoldenGate Fundamentals Student Guide

GGSCI Examples
Start a Manager process GGSCI> START MGR Add an Extract group GGSCI> ADD EXTRACT myext, TRANLOG, BEGIN NOW Add a local trail GGSCI> ADD EXTTRAIL /ggs/dirdat/rt, EXTRACT myext Start an Extract group GGSCI> START EXTRACT myext

Using Obey Files
You can use an Obey file to perform a reusable sequence of commands Save the commands in a text file, for example: START MGR ADD EXTRACT myext, TRANLOG, BEGIN NOW ADD EXTTRAIL /ggs/dirdat/rt, EXTRACT myext START EXTRACT myext Then use the GGSCI OBEY command to run the file: GGSCI> OBEY <obey filename>.oby
Note. An Obey file can have any file extension or none.

49

Running GoldenGate from the OS Shell
You can also start GoldenGate processes from the OS command shell when running a batch job or initial load, for example:

Shell> cd <GoldenGate install location> Shell> extract paramfile <filepath> reportfile <filepath> [-p <port>] Shell> replicat paramfile <filepath> reportfile <filepath>

This is especially useful to schedule GoldenGate batch jobs to run during off-peak hours using a command-line capable scheduler

Manager must be running when you issue these commands. <filepath> specifies the fully qualified name of the parameter and report files. paramfile can be abbreviated to pf. reportfile can be abbreviated to rf.

GoldenGate Commands – Discussion Points
1. What is GGSCI? 2. Where can you view the GoldenGate command syntax? 3. What is an Obey file and why would you use one?

1. GoldenGate Software Command Interface. 2. Help or Reference Guide. 3. A text file containing a sequence of GoldenGate commands; for easy re-use of common command sequences.

Oracle GoldenGate Fundamentals Student Guide

Step 2. Change Capture

Step 2. Change Capture

1. Prepare the Environment Source Database 3. Initial Load (various methods)

Target Database

Transaction Log Extract Local Trail 2. Change Capture Data Pump Remote Trail Replicat 4. Change Delivery

Change Capture - Extract Overview
Extract can be configured to: Capture changed data from database logs Distribute data from local trails to remote systems (data pump) Capture data directly from source tables for initial data load

51

Change Capture - Tasks
On the source system: Add a primary Extract (reading from source transaction logs) with an associated parameter file Optionally, add a local trail and a data pump Extract (reading from the local trail) with an associated parameter file Add a remote trail Start the Extract(s)

To configure Extract to capture changes from transaction logs, perform the following steps: Set up a parameter file for Extract with the GGSCI EDIT PARAMS command. Set up an initial Extract checkpoint into the logs with the GGSCI ADD EXTRACT command. Optionally, create a local trail using the GGSCI ADD EXTTRAIL command and a data pump Extract (and parameter file) reading from the local trail. Set up a remote trail using the GGSCI ADD RMTTRAIL command. Start the Server Collector process on the target system or let the Manager start the Server Collector dynamically. Start Extract using the GGSCI START EXTRACT command. For example: GGSCI> START EXTRACT FINANCE GGSCI sends this request to the Manager process, which in turn starts Extract. Manager monitors the Extract process and restarts it, when appropriate, if it goes down.
Change Capture - ADD EXTRACT Command
Add the initial Extract checkpoint with the GGSCI command ADD EXTRACT:

ADD EXTRACT <group name> , <data source> , <starting point> [, <processing options>] The components of this command are discussed in subsequent slides.

for example c:\ggs\dirdat\extfile. For <trail name>. Make certain that the BSDS name you provide is the one for the DB2 instance to which the Extract process is connected. Use this option for log-based extraction. EXTFILESOURCE <file name> Specifies an extract file as the data source. Use this option with a secondary Extract group (data pump) that acts as an intermediary between a primary Extract group and the target system.Oracle GoldenGate Fundamentals Student Guide Change Capture . GoldenGate does not perform any validations of the BSDS specification.ADD EXTRACT <data source> <data source> SOURCEISTABLE TRANLOG [<bsds name>] EXTFILESOURCE <file name> EXTTRAILSOURCE <trail name> Source (and when used) Database table (initial data load) Transaction log (change capture) [DB2 z/OS] Extract file (data pump) Trail (data pump) SOURCEISTABLE Creates an Extract task that extracts entire records from the database for an initial load. Use this option with a secondary Extract group (data pump) that acts as an intermediary between a primary Extract group and the target system. specify the fully qualified path name of the trail. and one of the other data source options must be specified. For <file name>. specify the fully qualified path name of the file. Task parameters must be specified in the parameter file. ADD EXTRACT creates an online change-synchronization process. TRANLOG requires the BEGIN option. EXTTRAILSOURCE <trail name> Specifies a trail as the data source. do not specify service options. TRANLOG [<bsds name>] Specifies the transaction log as the data source. 53 . Use the <bsds name> option for DB2 on a z/OS system to specify the BSDS (Bootstrap Data Set) file name of the transaction log. When using SOURCEISTABLE. If SOURCEISTABLE is not specified. for example c:\ggs\dirdat\aa.

cccccc]]]. EXTRBA <relative byte address> Valid for DB2 on z/OS. . and for a data pump Extract.the file in a trail in which to begin capturing data (for a data pump). if the trail file is c:\ggs\dirdat\aa000026. Ingres c-tree Sybase LOGNUM <log number>. . . EXTRBA <relative byte address> Valid for a primary Extract for Oracle and NonStop SQL/MX. .sequence number of an Oracle redo log and RBA within that log at which to begin capturing data. Contact GoldenGate Technical Support before using this option.the NonStop SQL/MX TMF audit trail sequence number and relative byte address within that file at which to begin capturing data. Specifies one of the following: . Several parameters specify the position with the log or trail to begin processing: EXTSEQNO <seqno>. NOW specifies the time at which START EXTRACT takes effect. processing begins at the beginning of a trail unless this option is used.ADD EXTRACT <starting point> <starting point> BEGIN {NOW | <datetime> } EXTSEQNO <seqno>. For example.For all databases except DB2 LUW. Together these specify the location in the TMF Master Audit Trail (MAT).For DB2 LUW. ROW <row> The starting point is indicated by one of the following: BEGIN specifies when the Extract begins processing. you would specify EXTSEQNO 26. By default. Specifies the relative byte address within a transaction log at which to begin capturing data. but not any zeroes used for padding. . NOW specifies the time at which the ADD EXTRACT command is issued.Change Capture . Specify the sequence number. LOGPOS <byte offset> PAGE <data page>. SQL/MX DB2 z/OS DB2 LUW SQL Server. EXTRBA <relative byte address> EXTRBA <relative byte address> EOF | LSN <value> LSN <value> Database Any Oracle. <datetime> specifies the start date and time in the format: yyyy-mm-dd [hh:mi:[ss[.

EOF configures processing to start at the active LSN in the log files.For Ingres. . LOGPOS <byte offset> Valid for c-tree. The active LSN is the position at the end of the log files that the next record will be written to. Extract will report the actual starting LSN to the Extract report file. that LSN might not necessarily be the first one that Extract will process. separated by a colon. . to specify an LSN of 1206396546. ROW <row> Valid for Sybase. and the third is the entry number. <log number> is the number of the c-tree log file. Note that.Oracle GoldenGate Fundamentals Student Guide EOF | LSN <value> Valid for DB2 LUW. Any active transactions will not be captured. Specifies the LSN in a SQL Server or Ingres transaction log at which to start capturing data. Specifies a data page and row that together define a start position in a Sybase transaction log. Specifies a start position in the transaction logs when Extract starts. the second is the segment number within the virtual log. . such as DB2 internal log records. LSN <value> Valid for SQL Server or Ingres.An alias for this option is EXTLSN. LSN <value> configures processing to start at an exact LSN if a valid log record exists there. Specifies the location in a c-tree transaction log at which to start capturing data. If one does not exist. you would enter 1206396546:43927. Extract will abend. an LSN is composed of three hexadecimal numbers separated by colons. although Extract might position to a given LSN. 4-byte unsigned integers. There are numerous record types in the log files that Extract ignores. The first is the virtual log file number. LOGNUM <log number>. an LSN is two. For example. PAGE <data page>. The LSN specified should exist in a log backup or the online log.43927 (as viewed in an Ingres utility). <byte offset> is the relative position from the beginning of the file (0 based). 55 .For SQL Server.

Passes the data through without any transformation. 2006. ADD EXTRACT finance. TRANLOG. TRANLOG. ADD EXTRACT finance. Start extracting with records generated at 8:00 on January 31.ADD EXTRACT Examples Create an Extract group named “finance” that extracts database changes from the transaction logs.Change Capture . ADD EXTRACT load. Start extracting with records generated at the time when you add the Extract group. SOURCEISTABLE . ADD EXTRACT finance. BEGIN 2006-01-31 08:00 Create a data-pump Extract group named “finance” that reads from the GoldenGate trail c:\ggs\dirdat\lt. Alternative report file name (fully qualified) REPORT <file name> Change Capture .ADD EXTRACT <processing options> <processing options> DESC “<description>” THREADS <n> Specifies Description of Extract group Number of redo threads when extracting from an Oracle RAC clustered database Alternative parameter file name (fully qualified) PARAMS <file name> PASSTHRU Used only in Data Pumps. EXTTRAILSOURCE c:\ggs\dirdat\lt Create an initial-load Extract named “load”. BEGIN NOW Create an Extract group named “finance” that extracts database changes from the transaction logs.

a trail named /ggs/dirdat/tr would have files named /ggs/dirdat/tr000001. MEGABYTES 10 ADD RMTTRAIL c:\ggs\dirdat\bb. /ggs/dirdat/tr000002. The actual trail name can contain only two characters. and so forth. The default is 10. MEGABYTES <n>] If using a data pump: The primary Extract needs a local trail (EXTTRAIL) The data pump Extract needs a remote trail (RMTTRAIL) Examples: ADD EXTTRAIL c:\ggs\dirdat\aa.Oracle GoldenGate Fundamentals Student Guide Change Capture .Add a Local/Remote Trail Add a local or remote trail with the GGSCI command: ADD EXTTRAIL | RMTTRAIL <trail name> . Only one Extract process can write data to a trail. GoldenGate appends this name with a six-digit sequence number whenever a new file is created. PASSWORD password RMTHOST serverx. Change Capture . of a file in the trail. TABLE SALES.INVENTORY. EXTRACT <group name> [.ORDERS. EXTRACT finance.Edit Extract Parameters Create/edit an Extract parameter file with the GGSCI command: EDIT PARAMS <group name> EXTRACT ODS USERID GoldenUser. MEGABYTES 5 <trail name> The fully qualified path name of the trail. in megabytes. EXTRACT parts. 57 . MEGABYTES <n> The maximum size. <group name> The name of the Extract group to which the trail is bound. For example. MGRPORT 7809 RMTTRAIL /ggs/dirdat/rt TABLE SALES.

Change Capture - Start Extract
Start an Extract process with the GGSCI command: START EXTRACT <group name> If the output trail is remote, this normally triggers the target Manager process to start a Server Collector process with default parameters Users can start a Server Collector statically and modify the parameters, though rarely used. See the Oracle GoldenGate Reference Guide.

Change Capture – Primary Extract Configuration (Oracle)
Source Database Transaction Log

GGSCI> EDIT PARAMS ODS EXTRACT ODS USERID GoldenUser, PASSWORD password EXTTRAIL /ggs/dirdat/rt TABLE SALES.ORDERS; TABLE SALES.INVENTORY; GGSCI> ADD EXTRACT ODS, TRANLOG, BEGIN NOW GGSCI> ADD EXTTRAIL /ggs/dirdat/rt, EXTRACT ODS GGSCI> START EXTRACT ODS

Extract

Trail

/ggs/dirdat/rt000000 /ggs/dirdat/rt000001

Sample Extract parameter file: USERID <login>, PASSWORD <pw> supplies database credentials. (SOURCEDB <dsn> is not required for Oracle). RMTHOST <hostname> specifies the target system. MGRPORT <port> specifies the port where Manager is running. RMTTRAIL <trail id> specifies the GoldenGate trail on the target system. TABLE <table name> specifies a source table for which activity will be extracted. ADD EXTRACT command TRANLOG specifies the transaction log as the data source. BEGIN NOW specifies that the change capture is to begin immediately.

Oracle GoldenGate Fundamentals Student Guide ADD RMTTRAIL Identifies the GoldenGate trail on the target system and the name of the EXTRACT group.

Change Capture – Primary Extract Configuration (DB2 and SQL Server)
Source Database Transaction Log

GGSCI> EDIT PARAMS ODS EXTRACT ODS SOURCEDB dsn, USERID login, PASSWORD pw EXTTRAIL /ggs/dirdat/rt TABLE SALES.ORDERS; TABLE SALES.INVENTORY; GGSCI> ADD EXTRACT ODS, TRANLOG, BEGIN NOW GGSCI> ADD EXTTRAIL ./dirdat/rt, EXTRACT ODS GGSCI> START EXTRACT ODS

Extract

Trail

/ggs/dirdat/rt000000 /ggs/dirdat/rt000001

Sample Extract parameter file: SOURCEDB <dsn> supplies a data source name as part of the connection information. USERID <login>, PASSWORD <pw> supplies database credentials. RMTHOST <hostname> specifies the target system. MGRPORT <port> specifies the port where Manager is running. RMTTRAIL <trail id> specifies the GoldenGate trail on the target system. TABLE <table name> specifies a source table for which activity will be extracted. ADD EXTRACT command TRANLOG specifies the transaction log as the data source. BEGIN NOW specifies that the change capture is to begin immediately. ADD RMTTRAIL Identifies the GoldenGate trail on the target system and the name of the EXTRACT group.

59

Data Pumps - Overview
Data is stored in a local trail on the source system A second Extract, the data pump: Reads this trail and sends it to one or more targets Manipulates the data or passes it through without change Reasons for using A safeguard against network and target failures To break complex data filtering and transformation into phases To consolidate data from many sources To synchronize one source with multiple targets

For most business cases, it is best practice to use a data pump. Some reasons for using a data pump include the following: • Protection against network and target failures: In a basic GoldenGate configuration, with only a trail on the target system, there is nowhere on the source system to store data that Extract continuously extracts into memory. If the network or the target system becomes unavailable, the primary Extract could run out of memory and abend. However, with a trail and data pump on the source system, captured data can be moved to disk, preventing the abend. When connectivity is restored, the data pump extracts the data from the source trail and sends it to the target system(s). • You are implementing several phases of data filtering or transformation. When using complex filtering or data transformation configurations, you can configure a data pump to perform the first transformation either on the source system or on the target system, and then use another data pump or the Replicat group to perform the second transformation. • Consolidating data from many sources to a central target. When synchronizing multiple source databases with a central target database, you can store extracted data on each source system and use data pumps on each system to send the data to a trail on the target system. Dividing the storage load between the source and target systems reduces the need for massive amounts of space on the target system to accommodate data arriving from multiple sources. • Synchronizing one source with multiple targets. When sending data to multiple target systems, you can configure data pumps on the source system for each one. If network connectivity to any of the targets fails, data can still be sent to the other targets.

Oracle GoldenGate Fundamentals Student Guide

Data Pumps – One to Many Trails

Trail

Primary Extract

Trail

Data Pump

Trail

Trail

A data pump can be set up to duplicate or selectively route the data to multiple trails. However, if the trails are on multiple target systems and the communication to one of the systems goes down, the Extract may exhaust its retries and shut down, causing the updates to all targets to stop.
Data Pumps – One to Many Target Systems

Data Pump 1

Trail

Primary Extract

Trail

Data Pump 2

Trail

Data Pump 3

Trail

GoldenGate supports synchronization of a source database to any number of target systems. For this configuration, GoldenGate recommends using data pump Extract groups to ensure that if network connectivity to any of the targets fails, data still can be sent to the other targets.

61

3. EXTTRAIL. EDIT PARAMS ADD EXTRACT ADD {EXTTRAIL | RMTTRAIL |EXTFILE | RMTFILE} START EXTRACT 5. EXTTRAILSOURCE . The MEGABYTE <megabytes> option in the ADD EXTTRAIL or ADD RMTTRAIL commands. It can also save source data from the tables themselves or other GoldenGate trails. 5.Configuration Primary Extract parameters specify a local trail: EXTRACT <primary> <login for your database> EXTTRAIL . 3. 2. 2. Writes the captured data to GoldenGate trails or files./dirdat/<trailid> .Change Capture – Discussion Points 1./dirdat/<rmttrail> <table statements as required>. From transaction logs (or archive logs) – except for Teradata./dirdat/<trailid> <table statements as required>. Data Pumps . Captures incremental changes from database transaction logs. Data pumps are often configured for pass-through: EXTRACT <datapump> PASSTHRU RMTHOST <target >. Add a data pump (source is the local trail from the primary Extract ) ADD EXTRACT <datapump>. RMTFILE or RMTTASK 4. EXTFILE RMTHOST with RMTTRAIL. 4. What does Extract do? Where does Extract capture transactional changes from? What parameters tell Extract where to send data? What commands are used to create and start an Extract group? What command option is used to set how large a GoldenGate trail file may get before it rolls to the next file? 1. MGRPORT <port> RMTTRAIL .

6. 2.Oracle GoldenGate Fundamentals Student Guide PASSTHRU parameter is used on a data pump if you do not need to do any data transformations or user exit processing. To send to multiple target systems (so if one goes down. 6. Data Pumps – Discussion Points 1. RMTHOST is used to identify the name or IP address of the remote system and the port that is being used. The PASSTHRU parameter is used on a data pump (unless you need to perform data transformation or user exit processing). 5. they don’t all). Add the data pump extract with a local trail as source and remote trail as destination. What is a data pump? What is the advantage of using a data pump? Why might you use multiple data pumps for one source trail? What parameter is used to identify the remote target system? What other parameter is commonly used on data pumps? Who can draw a flow chart of change capture & delivery using a data pump? 1. for parallel processing (faster). 3. A secondary Extract process that reads from a local trail and distributes that data to a remote system. Review Architecture slide for change capture & delivery using a data pump. 63 . Allows a local trail on the source system. 3. 5. which is useful for recovery if the network or target system fails. 4. 4. to separate out different tables. 2.

The first time that you start change synchronization will be during the initial load process.Step 3. Initial Load (various methods) Target Database Transaction Log Extract Local Trail 2. and applies it to the target tables so that the movement of transaction data begins from a synchronized state. Change Delivery Initial Load Can use GoldenGate TDM methods: GoldenGate method File to Replicat File to database utility Direct load Direct bulk load Extract writes to Trail (GoldenGate format) Formatted text file Replicat (directly) Replicat (directly) Load method Replicat via SQL Database utility Replicat via SQL Replicat via SQL*Loader API Or database-specific methods like: Backup/Restore Export/Import SQL scripts Break mirror Transportable tablespaces (Oracle) Notes: Run a test initial load early on for timing and sizing Run the actual initial load after starting change capture on the source Initial Load An initial load takes a copy of the entire source data set. Change synchronization keeps track of ongoing transactional changes while the load is being applied. Initial Load 1. Change Capture Data Pump Remote Trail Replicat 4. Initial Load Step 3. . Prepare the Environment Source Database 3. transforms it if necessary.

without locking tables Fetch data in arrays to speed performance Parallel processing using WHERE clauses or RANGE function Distribute data over multiple network controllers Flexible load alternatives. Transportable tablespaces (Oracle) Allows whole tablespaces to be copied between databases in the time it takes to copy the datafiles.Oracle GoldenGate Fundamentals Student Guide Break mirror Break from database mirroring. including native bulk load utilities GoldenGate change delivery can handle collisions with initial load Array fetch GoldenGate 10. Initial Load: Resource Limitations How close are your systems? How large are your tables? What are the outage time constraints? How much disk space do you have to store changes? Initial Load: Advantages of GoldenGate Methods Work across heterogeneous database types and platforms No application downtime required Read directly from source tables.0 and later fetches 1000 rows (except for LOBs) but you can control this by DBOPTIONS FETCHBATCHSIZE 65 .

use RMTTRAIL. Execution You can start Extract by the GGSCI command: START EXTRACT <name> Or from the command shell with syntax: extract paramfile <command file> [ reportfile <out file> ] . Extract parameters SOURCEISTABLE instructs Extract to read the source tables directly rather than the transaction log.Initial Load: File to Replicat Manager Source Database Extract Files Replicat Target Database ADD EXTRACT <name> Extract parameters: SOURCEISTABLE RMTTRAIL<name> File to Replicat Captures data directly from the source tables and writes to an Extract file for Replicat to process. Using Replicat provides the ability to perform additional data transformation prior to loading the data. To format the output for processing by Replicat.

such as SSIS. like BCP or SQLLOADER Execution You can start Extract by the GGSCI command: START EXTRACT <name> Or from the command shell with syntax: extract paramfile <command file> [ reportfile <out file> ] 67 . or SQL*Loader. Extract parameters SOURCEISTABLE instructs Extract to read the source tables directly rather than the transaction log. BCP. To format the output for native bulk utilities.Oracle GoldenGate Fundamentals Student Guide Initial Load: File to Database Utility SQL* Loader BCP Target Database Manager Source Database Extract File File File SSIS ADD EXTRACT <name> Extract parameters: SOURCEISTABLE RMTFILE <name> FORMATASCII BCP or SQLLOADER File to Database Utility Captures data directly from the source tables and outputs the data to files for processing by native bulk loaders. use: RMTFILE FORMATASCII with appropriate options.

The initial data load is then started using the GGSCI command START EXTRACT. The port used by the Replicat process may be controlled using the DYNAMICPORTLIST Manager parameter. SPECIALRUN Direct Load Captures data directly from the source tables and sends the data in large blocks to the Replicat process. SOURCEISTABLE Extract parameters: RMTTASK REPLICAT. •SPECIALRUN on Replicat specifies one-time batch processing where checkpoints are not maintained. . GROUP <name> ADD REPLICAT <name>. RMTTASK instructs the Manager process on the target system to start a Replicat process with a group name specified in the GROUP clause. Execution When you add Extract and Replicat: •SOURCEISTABLE instructs Extract to read the source tables directly rather than the transaction log. Using Replicat provides the ability to perform additional data transformation prior to loading the data. Extract parameters Here you have RMTTASK (instead of RMTFILE in the Queue Data method).Initial Load: Direct Load Manager Source Database Extract Manager Target Database Replicat ADD EXTRACT <name>. The Replicat process will be automatically started by the Manager process.

GROUP <name> ADD REPLICAT <name>. •SPECIALRUN on Replicat specifies one-time batch processing where checkpoints are not maintained. Using Replicat provides the ability to perform additional data transformation prior to loading the data. which communicates directly with SQL*Loaders through an API. SOURCEISTABLE Extract parameters: RMTTASK REPLICAT. It sends data in large blocks to the Replicat process. Replicat parameters The parameter BULKLOAD distinguishes this from the direct load method. RMTTASK instructs the Manager process on the target system to start a Replicat process with a group name specified in the GROUP clause. The port used by the Replicat process may be controlled using the DYNAMICPORTLIST Manager parameter. The Manager process dynamically starts the Replicat process. 69 . The port used by the Delivery process may be controlled using the DYNAMICPORTLIST Manager parameter.Oracle GoldenGate Fundamentals Student Guide Initial Load: Direct Bulk Load (to Oracle) Manager Source Database Source Database Extract Manager Oracle Target Replicat SQL*Loader API ADD EXTRACT <name>. The initial data load is then started using the GGSCI command START EXTRACT. The Replicat process will be automatically started by the Manager process. Execution When you add Extract and Replicat: •SOURCEISTABLE instructs Extract to read the source tables directly rather than the transaction log. SPECIALRUN Replicat parameters: BULKLOAD Direct Bulk Load The Direct Bulk Load method is the fastest method using GoldenGate for initial data load. Extract parameters Here you have RMTTASK (instead of RMTFILE in the Queue Data method).

Initial Load – Discussion Points 1. ADD EXTRACT with SOURCEISTABLE ADD REPLICAT with SPECIALRUN 3. File to Replicat (Extract writes to a file for Replicat to load via SQL) File to database utility (Extract writes to ASCII files formatted for database utilities to load) Direct load (Extract writes directly to Replicat which loads via SQL) Direct bulk load (Oracle only – Extract writes directly to Replicat. What parameter manages conflicts between initial load and change replication? Where is it specified? 1.g. . HANDLECOLLISIONS. for initial load)? 3. What GoldenGate command arguments specify that Extract and Replicat run as batch tasks (e. which loads through the SQL*Loader API) 2. What are the GoldenGate methods for initial load? 2. in the Replicat parameter file for change delivery. turn off after initial load data processed.

row. Replicat uses native calls to the database 71 . updates and deletes that meet your criteria. as well as perform data transformation prior to applying the data. Change Delivery Change Delivery . Change Delivery 1. Initial Load (various methods) Target Database Transaction Log Extract Local Trail 2. operation Perform data transformation Perform database operations just as your application performed them Overview GoldenGate trails are temporary queues for the Replicat process. Change Capture Data Pump Remote Trail Replicat 4.Replicat Overview Replicat can: Read data out of GoldenGate trails Perform data filtering Table. Change Delivery Step 4. and processes inserts. Alternatively.Oracle GoldenGate Fundamentals Student Guide Step 4. you can filter out the rows you do not wish to deliver. As a result. Each record header in the trail provides information about the database change record. Prepare the Environment Source Database 3. Replicat supports a high volume of data replication activity. Replicat reads these trail files sequentially. network activity is block-based not record-at-a-time.

Like Extract. When replicating. processing can be restarted without repetition or loss of continuity. Small transactions can be grouped into larger transactions to improve performance.for optimal performance.Tasks On the target system: Create a checkpoint table in the target database (best practice) DBLOGIN ADD CHECKPOINTTABLE Create a parameter file for Replicat EDIT PARAMS Add your initial Replicat checkpoint into GoldenGate trails ADD REPLICAT Start the Replicat process START REPLICAT Replicat reads the GoldenGate trail and applies changes to the target database. Replicat uses a checkpointing scheme so changes are processed exactly once. You can configure multiple Replicat processes for increased throughput. Change Delivery . Replicat uses checkpoints to store the current read and write position and is added and started using the processing group name. After a graceful stop or a failure. . Replicat preserves the boundaries of each transaction so that the target database has the same degree of integrity as the source.

GGSCI> ADD REPLICAT REPORD.ORDERS.checkpt GGSCI> EDIT PARAMS REPORD REPLICAT REPORD TARGETDB dsn USERID ggsuser PASSWORD ggspass -. Change Delivery . Replicat parameters: TARGETDB identifies the data source name (not required for Oracle) USERID and PASSWORD provide the credentials to access the database ASSUMETARGETS is used when the source and target systems have the same data definition with identical columns. EXTTRAIL /ggs/dirdat/rt GGSCI> START REPLICAT REPORD Replicat Target Database In this example: DBLOGIN USERID and PASSWORD logs the user into the database in order to add the checkpoint table. TARGET SALES. APPEND MAP SALES.Oracle GoldenGate Fundamentals Student Guide Change Delivery – Sample Oracle Configuration Trail GGSCI> DBLOGIN SOURCEDB mydb USERID login PASSWORD pw GGSCI> ADD CHECKPOINTTABLE ggs. MAP SALES. you must either avoid or handle any collisions when updating the target with interim changes Avoiding Collisions If you can backup/restore or clone the database at a point in time.ORDERS.INVENTORY.dsc. you can avoid collisions by starting Replicat to read trail records from a specific transaction Commit Sequence Number (CSN): START REPLICAT <group> ATCSN | AFTERCSN <csn> 73 .INVENTORY.Avoiding Collisions with Initial Load If the source database remains active during an initial load. DISCARDFILE creates a log file to receive records that cannot be processed. ADD REPLICAT names the Replicat group REPORD and establishes a local trail (EXTTRAIL) with the two-character identifier rt residing on directory dirdat.USERID ggsuser. MAP establishes the relationship between source table and the target table. PASSWORD ggspass ASSUMETARGETDEFS DISCARDFILE /ggs/dirrpt/REPORD. TARGET SALES.

Handling Collisions with Initial Load If you cannot avoid collisions by the prior method. All operations in that first transaction are excluded. . After the initial load completes. If you cannot create a temporary primary key or unique index through your application. the source database must be quiesced for the initial load. SKIPTRANSACTION Causes Replicat to skip the first transaction in the trail upon startup. 3. <csn> must be in the format that is native to the database. it writes the change record over the initial data load record When Replicat encounters a missing-record error for an update or delete. e.g. 2. The CSN varies by database. use the KEYCOLS argument of the TABLE or MAP parameter to designate columns as a substitute key. Otherwise. Change Delivery . you must handle collisions Use the Replicat HANDLECOLLISIONS parameter: When Replicat encounters a duplicate-record error on an insert.Avoiding Collisions using the CSN 1. AFTERCSN <csn> Causes Replicat to skip transactions in the trail until it finds the first transaction after the one that contains the specified CSN. note the highest CSN number of the standby database. for Oracle it is the SCN. Start Replicat to read from the next CSN: START REPLICAT <group> ATCSN <csn> | AFTERCSN <csn> | SKIPTRANSACTION ATCSN <csn> Causes Replicat to skip transactions in the trail until it finds a transaction that contains the specified CSN. the change record is discarded Handling Collisions using HANDLECOLLISIONS Parameter HANDLECOLLISIONS processing requires that each target table have a primary key or unique index. Use a standby copy of the source database for the initial load.

turn off HANDLECOLLISIONS: GGSCI > SEND REPLICAT <group> NOHANDLECOLLISIONS GGSCI > EDIT PARAMS <group> to remove parameter Change Delivery – Discussion Points 1. 75 . When is ASSUMETARGETDEFS valid? 3. 6. What is the purpose of the DISCARDFILE? 7. Review Architecture slide for change capture & delivery (without data pump). Identifies operations that could not be processed by Replicat. Reads change data from GoldenGate trails and applies them to a target database via SQL commands. 7. data type and length) are identical. It uses the source definitions created by DEFGEN. 4. ADD CHECKPOINTTABLE (must be logged into database). When the source and target table structures (column order. 2. 3.Oracle GoldenGate Fundamentals Student Guide Note: Once all of the change data generated during the load has been replicated. What commands are used to create and start a Replicat group? 5. What does Replicat do? 2. How does Replicat know the layout of the source tables when source and target schemas differ? 4. Who can draw a flow chart of basic change capture and delivery? 1. What GGSCI command creates a GoldenGate checkpoint table on the target database? 6. ADD CHECKPOINTTABLE (optional) EDIT PARAMS ADD REPLICAT START REPLICAT 5.

Extract Trails and Files Extract Trails and Files Introduction GoldenGate data format Alternative trail formats Viewing in Logdump Reversing the sequence Extract Trails and Files . with variable length records I/O performed using large block writes Extract writes checkpoints for trails during change capture: Guarantees no data lost during restart Multiple Replicat processes may process the same trail Extract does not write checkpoints for files 120 Trails can reside on any platform that GoldenGate supports.Overview Extract writes data to any of: Remote trail (RMTTRAIL) Remote file (RMTFILE) Local trail (EXTTRAIL) Local file (EXTFILE) Extract trails and files are unstructured. .

writes. in the order they were applied By default.Contents Each record in the trail contains an operation that has been committed in the source database Transactions are output in commit order Operations in a transaction are grouped together.Distribution Extract can write: To local trails.For distribution multiple systems/disk storage devices .Oracle GoldenGate Fundamentals Student Guide Extract Trails and Files . then distribute over IP with a data pump to remote trails To multiple trails .For parallel processing by downstream processes Trails and files can be transported online using TCP/IP or sent in batch using any file transfer method 121 When transporting trails via TCP/IP. and checkpoints blocks of records in one or more extract files. only the primary key and changed columns are recorded Flags indicate the first and last records in each transaction 77 . a Server Collector process on the target platform collects. Extract Trails and Files .

your temporary storage requirements for trails can be very low. If multiple Replicat processes are configured against a single trail. As long as replication processes keep pace. temporary storage requirements can be kept quite low. . you can instruct the Manager purge data trail data as soon as all checkpoints have been resolved.Cleanup Trail files can be purged once consumed Temporary storage requirement is small if processes keep pace Configure Manager to purge used trail data (best practice) Trail cleanup If one Replicat is configured to process the trail.Extract Trails and Files . As long as Replicat remains current. you can instruct the Replicat to purge the data once it has been consumed.

Each trail can then be processed by one or many Replicat processes.Oracle GoldenGate Fundamentals Student Guide GoldenGate Data Format GoldenGate Data Format By default. GoldenGate Data Format . One Extract can write to one to many trails. version and character set 79 . They are unstructured and written to in large blocks for best performance. Each process resumes where the last checkpoint was saved guaranteeing no data is lost.File Header Each trail file has a file header that contains: Trail file information Compatibility level Character set Creation time File sequence number File size First and last record information Timestamp Commit sequence number (CSN) Extract information GoldenGate version Group name Host name Hardware type OS type and version DB type. Checkpoints Both Extract and Replicat maintain checkpoints into the trails. Checkpoints provide persistent processing whenever a failure occurs. trails are formatted in the GoldenGate Data Format Each trail file has a trail file header and trail records GoldenGate Trails Trail files are unstructured files containing variable length records.

The default is the current version of the process that writes to this trail. EXTTRAIL. The release version is programmatically mapped back to the appropriate trail format compatibility level.x).Compatibility Level Identifies the trail file format by GoldenGate <major>. RMTFILE or RMTTRAIL parameter. trail files and Replicat together Set in Extract EXTFILE. <major> is the major version number and <minor> is the minor version number.<minor> version numbers Allows customers to use different versions of GoldenGate Extract. for example: RMTTRAIL /ggs/dirdat/ex. Note: To ensure that the correct file version is applied.<minor> Specifies the version of the trail to which this Extract will write.GoldenGate Data Format . FORMAT RELEASE 10. RELEASE specifies a GoldenGate release version. . If full audit recovery (FAR) mode is not enabled for Extract. FORMAT is a required keyword. unless the version that you downloaded instructs you otherwise. Valid values are 7 through the current GoldenGate version number.0 The input and output trails of a data pump must have the same compatibility level FORMAT RELEASE <major>. the file version number automatically defaults to 9 (GoldenGate version 9. FAR is controlled by the RECOVERYOPTIONS parameter. it is best practice to use RELEASE to match the trail to the version of the Extract or Replicat that will be reading it.

which uniquely identifies that transaction. which are padded with leading zeroes as required to fill the fixed length. because the CSN is processed in a platform-independent manner.Commit Sequence Number (CSN) Identifies the sequence in which transactions were committed: More efficient for deciding which transaction completed first than using heterogeneous database-supplied transaction identifiers The CSN is based on various database identifiers. The two components together comprise the Ingres LSN. for example: For Oracle. the sequence ID Each database management system generates some kind of unique serial number of its own at the completion of each transaction. each of which is bound to a transaction commit record in the same log stream. Example: 1206396546:43927 Oracle <system change number> Where: <system change number> is the Oracle SCN value. DB2 LUW. and DB2 z/OS have fixed-length CSNs. it supports faster. All database platforms except Oracle. A CSN captures this same identifying information and represents it internally as a series of bytes. Example: 6488359 81 . However. such as the Sybase CSN. <LSN-low> is the oldest log file in the range. reliably indicates the order in which the two transactions completed. Up to 4 bytes padded with leading zeroes. CSNs that contain multiple fields can be padded within each field. Up to 4 bytes padded with leading zeroes. The valid range of a 4-byte integer is 0 to 4294967295.Oracle GoldenGate Fundamentals Student Guide GoldenGate Data Format . A comparison of any two CSN numbers. more efficient heterogeneous replication than using the database-supplied identifier. the system change number (SCN) For Teradata. CSN values for different databases: Ingres <LSN-high>:<LSN-low> Where: <LSN-high> is the newest log file in the range.

<row> is the row.65535. <page> is the data page.<row> Where: <time_high> and <time_low> comprise a sequence number representing the time when the transaction was committed.4294967295. left padded with zeroes. both without leading zeroes.Decimal string Where the first value is the virtual log file number. Examples: 0X00000d7e:0000036b:01bd 0000003454:0000000875:00445 0Xd7e:36b:1bd 3454:875:445 3454000000087500445 c-tree <log number>. and the third is the entry number. Example: 12245.67330. <time_high> is 2-bytes and <time_low> is 4-bytes.12.Colon separated decimal string (10:10:5) padded with leading zeroes . depending on how the database returns it: .Colon separated hex string (8:8:4) padded with leading zeroes and 0X prefix .Colon separated decimal string without leading zeroes . without leading zeroes. it is: 0 .Sybase <time_high>. Example: 1274565892 SQL Server Can be any of these. The valid range of a 2-byte integer for a timestamp-high is 0 . For a 4-byte integer for a timestamp-low.<time_low>.345 DB2 LUW <LSN> Where: <LSN> is the decimal-based DB2 log sequence number.<page>.1234567890 DB2 z/OS <RBA> Where: <RBA> is a 6-byte relative byte address of the commit record within the transaction log. without leading zeroes.Colon separated hex string with 0X prefix and without leading zeroes . the second is the segment number within the virtual log.<byte offset> Where: <log number> is the 10-digit decimal number of the c-tree log file. Example: 2008-01-01 10:30:00. without leading zeroes. It is stored in the header of each database log page. .

RecLength: The length. Example: 0x0800000000000000D700000021 GoldenGate Data Format . then UndoFlag will be set to 1.<RBA> Where: <sequence number> is the 6-digit decimal NonStop TMF audit trail sequence number.0000004682 SQL/MX <sequence number>. indicating that the record was created by the Extract process. left padded with zeroes. column value Record Header Use the Logdump utility to examine the record header. but if the record is the backout of a previously successful operation. in bytes.Oracle GoldenGate Fundamentals Student Guide <byte offset> is the 10-digit decimal relative byte position from the beginning of the file (0 based). UndoFlag: (NonStop) Normally. left padded with zeroes. of the record buffer. Together these specify the location in the TMF Master Audit Trail (MAT). IOType: The type of operation represented by the record. 83 . UndoFlag is set to zero. left padded with zeroes.0000068242 Teradata <sequence ID> Where: <sequence ID> is the generic VAM fixed-length printable sequence ID. <RBA> is the 10-digit decimal relative byte address within that file.Records Each trail record contains: Eye-catchers for each section GoldenGate record header (50 bytes plus length of table name) Contains metadata of the change Table or File name I/O type Before/After indicator Transaction information –Transaction time –Transaction group Length of data area Plus other information - Optional user token area Token ID. Here is a layout of the header record: Hdr-Ind: Always E. token value Data area Column ID. Example: 0000000068. Example: 000042.

Values are 0 for the first record in transaction. RecCount: (Windows and UNIX) Used to reassemble LOB data when it must be split into 2K chunks to be written to the GoldenGate file. AuditRBA: The relative byte address of the commit record. Partition: Depends on the record type and is used for NonStop records. the value can be either 0 or 4. and 3 for the only record in the transaction. OrigNode: (NonStop) The node number of the system where the data was extracted. FormatType: Identifies whether the data was read from the transaction log (R) or fetched from the database (F). . such as LOBs. Continued: (Windows and UNIX) Identifies (Y/N) whether or not the record is a segment of a larger piece of data that is too large to fit within one record.TransInd: The place of the record within the current transaction. BeforeAfter: Identifies whether the record is a before (B) or after (A) image of an update operation. In the case of BulkIO operations. 1 for neither first nor last record in transaction. 2 for the last record in the transaction. For other non-bulk NonStop operations. Partition indicates the number of the source partition on which the bulk operation was performed. SyskeyLen: (NonStop) The length of the system key (4 or 8 bytes) if the source is a NonStop file and has a system key. AuditPos: Identifies the position of the Extract process in the transaction log. A value of 4 indicates that the data is in FieldComp format.

SQLLOADER Data cannot be processed by GoldenGate Replicat extfile 85 . BCP FORMATASCII.Alternative Formats Alternative output formats can be specified by the Extract parameters: FORMATASCII FORMATSQL FORMATXML Alternative Formats: FORMATASCII Output is in external ASCII format Can format data for popular database load utilities FORMATASCII.Oracle GoldenGate Fundamentals Student Guide Alternative Formats Extract Trails and Files .

U. • A before or after image indicator: B or A. D) Before/After Indicator (B/A) Table name Field name. the output includes: Operation Type (I. • The timestamp at which the transaction committed. • The relative byte address (RBA) of the commit record within the transaction log. D. the following tab-delimited list: • The operation-type indicator: I. • A newline character (starts a new line). Line 3. compressed update). Line 1. defaults to Tab New Line Indicator after each row Additional information surrounds operations in a transaction Begin Indicator Transaction time Sequence number and RBA Default output Without options. column name. U/V. delete. Field value. • The sequence number of the commit in the transaction log. • A column name. B. the following tab-delimited commit record: • The commit character C. column value. update. FORMATASCII generates records in the following format.Alternative Formats: FORMATASCII (cont’d) By default. the following tab-delimited begin-transaction record: • The begin transaction indicator. • A newline character. Line 2. Field delimiter. . V (insert. and so forth. column value. • The table name. ….

and the file or table name. DELIMITER <delimiter> ] [. EXTRACOLS Includes placeholders for additional columns at the end of each record. COLHDRS Outputs the table’s column names before the data.Oracle GoldenGate Fundamentals Student Guide Alternative Formats: FORMATASCII Syntax FORMATASCII [. the operation type character. NOTRANSSTMTS ] [. DATE |TIME |TS Specifies one of the following: Date: Year to Day Time: Year to Second TransTime: Year to Fraction DELIMITER Use an alternative field delimiter (the default is tab). NOHDRFIELDS Suppresses output of transaction information. NOQUOTE ] [. Use this when a target table has more columns than the source. COLHDRS takes effect only when the extract is directly from the table. NONAMES ] [. For compressed records. NAMES ] [. DATE | TIME | TS ] [. NULLISPACE ] [. BCP] [. NAMES | NONAMES Excludes column names from the output. the before or after image indicator. EXTRACOLS ] [. NOQUOTE 87 . COLHDRS ] [. column names are included unless you also specify PLACEHOLDERS. SQLLOADER ] BCP Formats the output for compatibility with SQL Server’s BCP (Bulk Copy Program) or SSIS high-speed load utility. NOHDRFIELDS ] [. PLACEHOLDERS ] [.

100. 'San Fran'. PLACEHOLDERS Outputs a placeholder for missing fields or columns.1997-02-17:14:09:46.CUSTNAME. DELIMITER '|' produces the following: B|1997-02-17:14:09:46. The default is to output null fields as the word NULL.421335|8|1873474| I|A|CUSTOMER|'Eric'|'San Fran'|550| V|A|CUSTOMER|CUSTNAME|'Eric'|BALANCE|100| C| Note: The last record returns column names for the CUSTNAME and BALANCE columns because the record is a compressed update and PLACEHOLDERS was not used.LOCATION. FORMATASCII. C. COMMIT..TEST.123.1873474. V. SQLLOADER Generates a file compatible with the Oracle SQL*Loader high-speed data load utility. Alternative Formats: FORMATASCII Sample Output The transaction that is the subject of the examples: INSERT INTO CUSTOMER VALUES ("Eric".550.BALANCE.A. For example. the data might look like: ‘ABC’. Example 1.421335.8. I. NOTRANSSTMTS Excludes transaction information..'Eric'.'Eric'. NONAMES.BALANCE.CUSTOMER. if The second and fourth columns are missing in a four column table. Example 2. UPDATE CUSTOMER SET BALANCE = 100 WHERE CUSTNAME = "Eric".A. . NULLISPACE Outputs NULL fields as empty fields. ASCII-formatted file.CUSTOMER. SQLLOADER produces a fixed-length. 550).TEST.CUSTNAME.Excludes quotation marks from character-type data (default is surrounded by singlequotes). "San Fran". FORMATASCII without options produces the following: B.

Each combination of commit timestamp and RBA is unique. ORACLE 89 .Oracle GoldenGate Fundamentals Student Guide Alternative Formats: FORMATSQL Output is in external SQL DML format Data cannot be processed by Replicat Default output for each transaction includes: Begin transaction indicator. because inserts contain all column names. B Timestamp at which the transaction was committed Sequence number of transaction log containing commit RBA of commit record within transaction log SQL Statement Commit indicator. ORACLE ] NONAMES Omits column names for insert operations. C Newline indicator Scope of a transaction Every record in a transaction is contained between the begin and commit indicators. By default (without NOPKUPDATES). This option conserves file size. NONAMES ] [. Alternative Formats: FORMATSQL Syntax FORMATSQL [. the output is a standard UPDATE operation. NOPKUPDATES ] [. NOPKUPDATES Converts UPDATE operations that affect columns in the target primary key to a DELETE followed by an INSERT.

.'1995-1111:13:52:00'.ORDER_ID.ORDER_ID.'144'.PRODUC T_AMOUNT. INLINEPROPERTIES | NOINLINEPROPERTIES ] [.TRANSACTION_ID) VALUES ('JANE'.NAME.133300. C. INSERT INTO TEST.1.TCUSTMER WHERE CUST_CODE='JANE'.'CAR'. INSERT INTO TEST. Alternative Formats: FORMATXML Output is in XML format Data cannot be processed by Replicat Syntax FORMATXML [.000000.STATE) VALUES ('JANE'.'DENVER'.TCUSTMER (CUST_CODE.ORDER_DATE.1226440129.2008-11-11:13:48:49. INSERT INTO TEST.ORDER_DATE.NAME.TCUSTORD (CUST_CODE.PRODUCT_CODE.'.TCUSTORD WHERE CUST_CODE='WILL' AND ORDER_DATE='1994-09-30:15:33:00' AND PRODUCT_CODE='CAR' AND ORDER_ID='144'.CITY.STATE) VALUES ('WILL'. DELETE FROM TEST.TCUSTMER WHERE CUST_CODE='WILL'. TRANS | NOTRANS ] INLINEPROPERTIES | NOINLINEPROPERTIES Controls whether or not properties are included within the XML tag or written separately.'YYYY-MM-DD' Alternative Formats: FORMATSQL Sample Output B.'100').3.00.PRODUCT_PRICE.'PLANE'.PRODUC T_AMOUNT.'SEATTLE'. TRANS | NOTRANS Controls whether or not transaction boundaries and commit timestamps should be included in the XMLoutput. DELETE FROM TEST.TRANSACTION_ID) VALUES ('WILL'. DELETE FROM TEST.'WA').155.'100').TCUSTMER (CUST_CODE.Formats records for compatibility with Oracle databases by converting date and time columns to a format accepted by SQL*Plus.'. TRANS is the default. DELETE FROM TEST.PRODUCT_CODE. For example: TO_DATE('1996-0501'.TCUSTORD WHERE CUST_CODE='JANE' AND ORDER_DATE='1995-11-11:13:52:00' AND PRODUCT_CODE='PLANE' AND ORDER_ID='256'.CITY.00.TCUSTORD (CUST_CODE.'BG SOFTWARE CO.'256'.'ROCKY FLYER INC. INLINEPROPERTIES is the default.PRODUCT_PRICE.'1994-0930:15:33:00'.'CO'). INSERT INTO TEST.17520.

000000"> <dbupdate table="TEST.</column> <column name="CITY">ABERDEEN</column> <column name="STATE">WA</column> </columns> </dbupdate> <dbupdate table="TEST.TCUSTMER" type="insert"> <columns> <column name="CUST_CODE" key="true">VAN</column> <column name="NAME">VAN'S BICYCLESS</column> <column name="CITY">ABERDEEN</column> <column name="STATE">WA</column> </columns> </dbupdate> </transaction> 91 .TCUSTMER" type="insert"> <columns> <column name="CUST_CODE" key="true">ZEKE</column> <column name="NAME">ZEKE'S MOTION INC.Oracle GoldenGate Fundamentals Student Guide Alternative Formats: FORMATXML Sample Output <transaction timestamp="2008-11-11:14:33:12.TCUSTMER" type="insert"> <columns> <column name="CUST_CODE" key="true">ZOE</column> <column name="NAME">ZOE'S USED BICYCLES</column> <column name="CITY">ABERDEEN</column> <column name="STATE">WA</column> </columns> </dbupdate> <dbupdate table="TEST.

Edit previous command . known as the GGS Header (unless the NOHEADERS Extract parameter was used).Viewing in Logdump Logdump The Logdump utility allows you to: Display or search for information that is stored in GoldenGate trails or files Save a portion of a GoldenGate trail to a separate trail file onlog Logdump overview Logdump provides access to GoldenGate Trails. Logdump – Starting and Getting Online Help To start Logdump . and the data area. an optional user token area. unstructured file with a variable record length.from the GoldenGate installation directory: Shell> logdump To get help: Logdump 1 > help The Logdump utility is documented in the: Oracle GoldenGate Troubleshooting and Tuning Guide The following is an excerpt from the HELP output: FC [<num> | <string>] . Each record in the trail contains a header.

] [END[time] <timestr>.Exit the program FILES | FI | DIR .Sets max output length EXIT | QUIT .] [FILE <wildcard-template>.Skip down <count> records COUNT .Count the records in the file [START[time] <timestr>.Show current settings Logdump – Opening a Trail Logdump> open dirdat/rt000000 Logdump responds with: Current LogTrail is /ggs/dirdat/rt000000 Opening a trail The syntax to open a trail is: OPEN <file_name> Where: <file_name> is either the relative name or fully qualified name of the file.Display filenames ENV .] [DETAIL ] <timestr> format is [[yy]yy-mm-dd] [hh[:mm][:ss]] POSITION [ <rba> | FIRST ] .] [LOG[trail] <wildcard-template>. including the file sequence number.Display next data record SKIP [ <count> ] .] [INT[erval] <minutes>.Oracle GoldenGate Fundamentals Student Guide HISTORY .Display audit record NEXT [ <count> ] .List previous commands OPEN | FROM <filename> .Set position in file RECLEN [ <size> ] . 93 .Open a Log file RECORD | REC .

the name of the token and its length are displayed.Logdump – Setting up a View To view the trail file header: Logdump 1> fileheader on To view the record header with the data: Logdump 2> ghdr on To add column information: Logdump 3> detail on To add hex and ASCII data values to the column list: Logdump 4> detail data To control how much record data is displayed: Logdump 5> reclen 280 Setting up a view in Logdump fileheader [on | off | detail] Controls whether or not the trail file header is displayed. length.DATA adds hex and ASCII data values to the column list. Data beyond the specified length is truncated. Without arguments. and value in hex and ASCII. GHDR displays the status of header display (ON or OFF). Each record contains a header that includes information about the transaction environment. . You can use RECLEN to control the amount of scrolling that must be done when records are large. reclen Controls how much of the record data is displayed. . detail {on | off | data} . . usertoken By default.DETAIL ON displays a list of columns that includes the column ID. ghdr [on | off] Controls whether or not the record header is displayed with each record. while still showing enough data to evaluate the record. Use the USERTOKEN DETAIL option to show the actual token data.DETAIL OFF turns off detailed display.

x4. use the ghdr on command to show record headers........q1.. Logdump – Viewing Trail Records To go to the first record..8.f...@9.2... .034. /dirdat/er0000007. The detail option displays the data.......?4. Adding the prev option will display the previous header.q1...631 FileHeader Name: *FileHeader* 3000 0008 0037 6f6d 4f72 2f64 0138 012f 0000 0031 653a 6163 6972 0000 3000 0016 7572 6d63 6c65 6461 0800 0008 3300 693a 6361 3a73 742f 01e2 660d 000c 7465 7267 6f75 6572 4039 0a71 02f1 6c6c 6172 7263 3030 0000 3100 7834 7572 3a67 6536 3030 0c00 0006 eac7 6961 6773 0000 3030 0000 0001 7f3f 6e3a 3a67 1700 3700 0000 3200 3400 3a68 6773 112e 0005 001d | | | | | | | 0......... scanforheader | sfh [prev] Use scanforheader to go to the next record header.7. . GroupID x30 '0' TrailInfo Info x00 Length 303 3000 012f 3000 0008 660d 0a71 3100 0006 0001 3200 | 0.3..../0.2. etc. 95 .f.Oracle GoldenGate Fundamentals Student Guide Logdump – Viewing the Trail File Header fileheader [ on | detail ] displays the file header: Logdump Logdump Reading Logdump 14662 >fileheader detail 14663 >pos 0 forward from RBA 0 14664 >n Length Length Length Length Length Length Length 587 303 103 88 85 4 587 Len 587 RBA 0 TokenID x46 'F' Record Header Info x00 TokenID x30 '0' TrailInfo Info x00 TokenID x31 '1' MachineInfo Info x00 TokenID x32 '2' DatabaseInfo Info x00 TokenID x33 '3' ProducerInfo Info x00 TokenID x34 '4' ContinunityInfo Info x00 TokenID x5a 'Z' Record Trailer Info x00 2008/07/18 13:40:26.1uri:tellurian::h ome:mccargar:ggs:ggs Oracle:source6.../0........... ... Before using this command. and to move from one record to another in sequence: Logdump 6 > pos 0 Logdump 7 > next (or just type n) To position at an approximate starting point and locate the next good header record: Logdump 8 > pos <approximate RBA> Logdump 9 > scanforheader (or just type sfh) position | pos [ <RBA> | 0 | FIRST ] You can position on the first record using 0 or FIRST or on a relative byte address...

in hex Length of record and its RBA position in the trail file Record data. or delete The transaction indicator (TransInd): 00 beginning. such as the transaction group and commit timestamp The time that the change was written to the GoldenGate file The type of database operation The length of the record The relative byte address within the GoldenGate file The table name The change data is shown in hex and ASCII format. The GoldenGate record header provides metadata of the data contained in the record and includes the following information. then a before image also would appear in the record. update. 01 middle. . such as an insert. The operation type. I/O type Operation type and time the record was written Source table Image type: could be a before or after image Column information Record data. for example to enable a procedure to compare before values in the WHERE clause. If before images are configured to be captured. in ASCII GoldenGate trail files are unstructured. Below the header is the data area.Logdump – Viewing Trail Records Record header: contains transaction information. 02 end or 03 whole of transaction The before or after indicator for updates Transaction information.

.The number of records in the file . shows the following: . 8 COUNT output The basic output. 22661 Records/Trans .Information about the transactions Logdump – Counting Records in the Trail (cont’d) TCUSTMER Total Data Bytes Avg Bytes/Record Delete Insert FieldComp Before Images After Images TCUSTORD Total Data Bytes Avg Bytes/Record Delete Insert Field Comp Before Images After Images 10562 55 300 1578 12 300 1590 229178 78 600 2324 14 600 2338 COUNT Syntax: COUNT [. FILE <specification>] [..... 193 Files/Trans . INT[ERVAL] <minutes>] 97 ..The total data bytes and average bytes per record ..The RBA where the count began .. END[TIME] <time_string>] [. without options. DETAIL] [.Oracle GoldenGate Fundamentals Student Guide Logdump .Information about the operation types .Counting the Records in the Trail Logdump> count LogTrail /ggs/dirdat/rt000000 has 4828 records Total Data Bytes 334802 Avg Bytes/Record 69 Delete 900 Insert 3902 FieldComp 26 Before Images 900 After Images 3928 Average of 25 Transactions Bytes/Trans ...

(x00) BeforeAfter: A (x41) RecLength : 56 (x0038) IO Time : 2002/04/30 15:56:40. MATCH ALL Without arguments. separating each one with a semi-colon. trail file. (x01) FormatType : F (x46) SyskeyLen : 0 (x00) Incomplete : . For example. FILTER RECTYPE 5. FILTER displays the current filter status (ON or OFF) and any filter criteria that are in effect. filter the count for a table.act*. data file. LOG] <wildcard>] [. transind 00: 1st -> SCN 01: middle 02: last -> SCN 03: only -> SCN • • FILENAME specifies a SQL table.act*. NonStop data file or group of tables/files using a wildcard. FILTER MATCH ALL To avoid unexpected results. RECTYPE 5. as in: FILTER INCLUDE FILENAME fin. and specify a time interval for counts. • • . or extract file. You can string multiple FILTER commands together. avoid stringing filter options together with one FILTER command. (x00) UndoFlag : .[.814 Insert Len 56 Log RBA 1230 File: TCUSTMER Partition 0 After Image: 3220 2020 4A61 6D65 7320 2020 2020 4A6F 686E 736F| 2 James Johnso 6E20 2020 2020 2020 2020 2020 2020 4368 6F75 6472| n Choudr 616E 7420 2020 2020 2020 2020 2020 4C41 | LA Filtering suppressed 18 records Use FILTER to filter the display based on one or more criteria. START[TIME] <time_string>] COUNT options allow you to show table detail without using the DETAIL command first. Logdump – Filtering on a Filename Logdump 7 >filter include filename TCUST* Logdump 8 >filter match all Logdump 9 >n ________________________________________________________________ Hdr-Ind : E (x45) Partition : . the following would be incorrect: FILTER INCLUDE FILENAME fin. set a start and end time for the count. (x00) AuditRBA : 105974056 2002/04/30 15:56:40.814 IOType : 5 (x05) OrigNode : 108 (x6c) TransInd : .

205 : 3 (x03) OrigNode : 108 (x6c) : .<text> [<column_range>]] [..] INT16 <16-bit_integer> | INT32 <32-bit_integer> IOTYPE <operation type> [. (x00) : .. (x00) BeforeAfter: B (x42) : 56 (x0038) IO Time : 2002/04/30 16:22:14. <operation type>] MATCH {ANY | ALL} OFF ON PROCESS <process_name> RBA <byte address> [<comparison operator>] [. <name>] HEX <hex_string> [<byte_range>] [.] SYSKEY <system key> [<comparison operator>] [. (x01) FormatType : F (x46) : 0 (x00) Incomplete : ..<text> [<column_range>] [[B].Oracle GoldenGate Fundamentals Student Guide Logdump – Locating a Hex Data Value Logdump 27 >filter inc hex /68656C20/ Logdump 28 >pos 0 Current position set to RBA Logdump 29 >n __________________________________________________________ Hdr-Ind UndoFlag RecLength IOType TransInd SyskeyLen AuditRBA : E (x45) Partition : . ... The FILTER command can INCLUDE | EXCLUDE the following options: AUDITRBA <rba> [<comparison operator>] CLEAR {<filter_spec> | ALL} ENDTIME <time_string> FILENAME <name> [. (x00) : 109406324 show type²é¸÷ ‚€´ú´a 2002/04/30 16:22:14..205 Delete Len 56 Log RBA 64424 File: TCUSTMER Partition 0 Before Image: 3620 2020 4A61 6D65 7320 2020 2020 4A6F 686E 736F | 6 James Johnso 6E20 2020 2020 2020 2020 2020 2020 4574 6865 6C20 | n Ethel 2020 2020 2020 2020 2020 2020 2020 4C41 | LA Filtering suppressed 545 records The example includes a hex range.] TRANSIND <indicator> [<comparison operator>] TYPE <type> UNDOFLAG <type> [<comparison operator>] 99 .] RECLEN <length> [<comparison operator>] RECTYPE {<type_number> | <type_name>} SHOW STARTTIME <time_string> STRING [BOTH] [B]...

only). Syntax SAVE <file_name> [!] {<n> records | <n> bytes}[NOCOMMENT] [OLDFORMAT | NEWFORMAT] [TRANSIND <indicator>] [TRUNCATE] Logdump – Keeping a Log of Your Session Logdump> log to MySession. and clean out an existing file before writing new data to it. you can work with a smaller file. use the old or new trail format. end. middle. save a specified number of records or bytes. while excluding records that may be causing errors. Options allow you to overwrite an existing file. Use SAVE to write a subset of the records to a new trail or extract file. By saving a subset to a new file. Saving to another file also enables you to extract valid records that can be processed by GoldenGate. suppress comments. set the transaction indicator (first.Logdump – Saving Records to a New Trail Logdump> save newtrail 10 records The 10 records are taken forward from the current position in the file.txt When finished… Logdump> log stop .

OBEY. NOTIFY. trail position. LOG. X show env: ï@ʾĿ Ç°Ëù¿´µÄtrail file Working with files: CD Sets the default directory LOG Writes a session log NEXTTRAIL Closes the current file and opens the next file in the trail sequence OPEN Open a log file POSITION Sets the read position in the file SAVE Writes record data to another file WRITELOG Writes text to a session log Viewing information: COUNT Displays record count information FILES Displays names of files in the current subvolume ENV Displays current Logdump settings NOTIFY Displays the number of records scanned. TRAILFORMAT. logging remains in effect for all sessions of Logdump until disabled with the LOG STOP command. HISTORY. FILEHEADER. OPEN. FILES. SCANFORTIME. SCANFORHEADER. When enabled. HEADERTOKEN. FILTER. DECRYPT. INTERPRETTIMESTAMP ASCIIDATA|EBCDICDATA. TIME DUMP. LOG displays the status of logging (ON or OFF). Syntax LOG {<file_name> | STOP} Logdump Commands Purpose Working with files Viewing information Selecting data and records Making conversions Controlling the environment Miscellaneous Examples CD. WRITELOG COUNT. ENV. NEXTTRAIL. RECLEN. INTERPRETINTERVAL. SHOW Displays based on the following options: <OPEN>: open files <ENV>: current Logdump environment <RECTYPE>: list of GoldenGate record types <FILTER>: current filter settings TIME Displays the current time in local and GMT formats 101 . GHDR. TIMEOFFSET. NEXT. SCANFORTYPE. Without arguments.Oracle GoldenGate Fundamentals Student Guide Use LOG to start and stop the logging of Logdump sessions. DETAIL. POSITION. FC. USERTOKEN EXIT. SAVE. and record timestamp. SHOW. ENCRYPT. CTIME. An alias for LOG is OUT. SCANFORRBA. SCANFORENDTRANSACTION. HELP. SKIP COMPUTETIMESTAMP.

Selecting data and records: DUMP Displays the specified number of bytes of data from the current position in the file FILTER Filters the record display NEXT Displays the next or <nn> record in the file SCANFORENDTRANSACTION Finds a record that is the last or only record in a transaction and displays the next record SCANFORHEADER Finds the start of the next record header SCANFORRBA Finds a specified relative byte address SCANFORTIME Finds the next record with a specified timestamp SCANFORTYPE Finds the next record of a specified type SKIP Skips a specified number of records Making conversions: COMPUTETIMESTAMP CTIME DECRYPT ENCRYPT INTERPRETINTERVAL INTERPRETTIMESTAMP Converts a datetime string to a Julian timestamp Converts a C timestamp to an ASCII timestamp Decrypts data before displaying it Encrypts file data Displays a 64-bit Julian interval as: days-hh:mm:ss:ms:us Displays a 64-bit Julian timestamp in ASCII format Controlling the environment: ASCIIDATA | EBCDICDATA Controls whether data is displayed in ASCII or EBCDIC format on the IBM mainframe ASCIIDUMP | EBCDICDUMP Sets the character set on an IBM mainframe ASCIIHEADER | EBCDICHEADER Controls whether the table name is displayed in ASCII or EBCDIC format on an IBM mainframe DETAIL Controls how much detail is displayed FILEHEADER Controls the display of the trail file header GHDR Controls the display of record header information HEADERTOKEN Controls the display of header token indicators RECLEN Sets the maximum data output length SCANSCROLLING Controls whether count notification displays on one line or multiple lines TIMEOFFSET Sets the time offset from GMT TRAILFORMAT Sets the trail format to the old version (pre-GoldenGate 6.0) or the new version TRANSBYTELIMIT Sets a byte-count threshold TRANSHIST Sets the size of the transaction history TRANSRECLIMIT Sets a record-count threshold USERTOKEN Controls the display of user token data Miscellaneous: EXIT Exits Logdump FC Edits a previous command HELP Shows syntax for Logdump commands .

Oracle GoldenGate Fundamentals Student Guide HISTORY OBEY X Lists previously issued commands Executes a series of commands stored in a file Executes a specified program from within Logdump 103 .

A before image is required to reverse update and delete operations. • Run the Reverse utility to perform the reversal of the transactions.Reversing the Trail Sequence Reverse . GoldenGate might not be able to roll back those columns. reverses file sequence .Overview The Reverse utility reorders operations within GoldenGate trails in reverse sequence: Provides selective back out of operations Selectively back out corrupt data or accidental delete operations while keeping the rest of the application alive Can be used to restore a database to a specific point in time Use to back out all operations during regression testing to restore the original test baseline To use GoldenGate Reverse: • Run Extract to extract the before data. Reverse .Overall Process Source Transaction Log or GoldenGate Trails Extract ext1 Write to a single file or a series of files File input Reverse File output Replicat rep1 Source Database SPECIALRUN TRANLOG BEGIN END GETUPDATEBEFORES NOCOMPRESSDELETES Filter criteria (if any) EXTFILE or RMTFILE (Table statements) Operation sequence is reversed Inserts become deletes Deletes become inserts Update Before Images become After Images Begin and end transaction indicators are reversed If input is a series of files. • Tables with XMLTYPE columns are not supported by GoldenGate Reverse. • Run Replicat to apply the restored before data to the target database. GoldenGate Reverse has the following restrictions: • If the database does not store the before images of LONG or LOB columns.

Enables deletes to be converted back to inserts. SPECIALRUN indicates a one-time batch process that will run from BEGIN date and time until END date and time.dat ASSUMETARGETDEFS MAP HR. instead of only the primary key. TRANLOG SOURCDB dsn.prm) SPECIALRUN.prm) SPECIALRUN END RUNTIME TARGETDB dsn. MAP HR. TARGET HR. TRANLOG specifies the transaction log as the data source. MGRPORT 7809 RMTFILE /ggs/dirdat/input. TABLE HR. GETUPDATEBEFORES is used to include before images of update records.ACCOUNTS.dat TABLE HR.SALES. which contain record details before an update (as opposed to after images). NOCOMPRESSDELETES causes Extract to send all column data to the output. USERID user. PASSWORD password BEGIN 2004-05-30 17:00 END 2004-05-30 18:00 GETUPDATEBEFORES NOCOMPRESSDELETES RMTHOST target. Replicat Parameters (dirprm/rep1.ACCOUNTS.Oracle GoldenGate Fundamentals Student Guide Reverse – Sample Parameter Files Extract Parameters (dirprm/ext1. END RUNTIME causes the Extract or Replicat to terminate when it reaches process startup time.ACCOUNTS. TARGET HR. PASSWORD password EXTFILE /ggs/dirdat/output. USERID user.SALES.SALES. 105 .

GoldenGate trail format. Run Replicat to back out operations $ ggs/> replicat paramfile dirprm/rep1. ASCII. 2. Logdump . SQL.dat 3. Run Reverse to produce the reordered output $ ggs/> reverse dirdat/input. What formats are Extract trails and files written in? 3.prm The Reverse utility is run from the OS shell.prm 2. What GoldenGate utility allows you to view trail contents 1.dat dirdat/output. What is a trail? 2. Syntax: REVERSE <source file or trail> <target file or trail> Example: C:\GGS> reverse dirdat\rt dirdat\nt Trails – Discussion Points 1. A trail is a series of files on disk where GoldenGate stores data for further processing.Reverse – Overall Process 1. Run Extract from either GoldenGate trails or the source database transaction logs $ ggs/> extract paramfile dirprm/ext1. XML 3.

/GLOBALS Manager and utility parameter files are identified by keywords GGSCI> EDIT PARAMS MGR GGSCI> EDIT PARAMS DEFGEN Extract and Replicat parameter files are identified by the process group name GGSCI> EDIT PARAMS <group name> 107 .Overview Editing parameter files GLOBALS versus process parameters GLOBALS parameters Manager parameters Extract parameters Replicat parameters Editing Parameter Files Edit parameter files to configure GoldenGate processes The GLOBALS parameter file is identified by its file path GGSCI> EDIT PARAMS .Oracle GoldenGate Fundamentals Student Guide Parameters Parameters .

only the last instance of the parameter is active. A global parameter can appear anywhere in the parameter file. Table-specific parameters These control processing for tables specified with a TABLE or MAP statement. Adding the parameter within MAP statement so it applies only to that table or file. Extract. There are two implementations for file-specific parameters: Toggling the parameter on and off around one or more TABLE or MAP statements. Tablespecific parameters enable you to designate one set of processing rules for some tables. Table-specific parameters take effect in the order that each parameter is listed in the parameter file. and it should only be listed in the file once.GLOBALS versus Process Parameters GLOBALS parameters apply to all processes Set when Manager starts Reside in <GoldenGate install directory>/GLOBALS Process parameters apply to a specific process (Manager. All other instances are ignored. The Effective Range of Process Parameters Process-wide parameters These apply to all tables specified in the parameter file for the process. Replicat. while designating other rules for other tables. Utilities) Set when the process starts Override GLOBALS settings Reside by default in the dirprm directory in files named <processname>. Server Collector. When listed more than once. allowing you to customize your data management environment to suit your needs.prm Most apply to all tables processed but some can be specified at the table level Parameters manage all GoldenGate components and utilities. .

ggschkpt Defines the table name used for Replicat’s checkpoint table CHECKPOINTTABLE MGRSERVNAME Defines the table name used for Replicat’s checkpoint table. DDLTABLE Specifies a non-default name for the DDL history table that supports DDL synchronization for Oracle. 109 . MARKERTABLE Specifies a non-default name for the DDL marker table that supports DDL synchronization for Oracle. rarely changed Parameters most commonly used MGRSERVNAME ggsmanager1 Defines a unique Manager service name on Windows systems CHECKPOINTTABLE dbo.Oracle GoldenGate Fundamentals Student Guide GLOBALS Parameters GLOBALS Parameters Control things common to all processes in a GoldenGate instance Can be overridden by parameters at the process level Must be created before any processes are started Stored in <GoldenGate install directory>/GLOBALS (GLOBALS is uppercase. Defines the name of the Manager Service used for starting or stopping the Manager process. Parameters for Oracle DDL replication GGSCHEMA Specifies the name of the schema that contains the database objects that support DDL synchronization for Oracle. Valid for Windows only. no extension) Must exit GGSCI to save Once set. This service name will also be used when running the INSTALL utility to add the Windows Service.

LAGCRITICALMINUTES specifies the interval at which Extract and Replicat will send a critical message to the event log. LAGREPORTHOURS sets the interval in hours at which Manager checks lag for Extract and Replicat processing. WAITMINUTES 2. AUTORESTART specifies processes to be restarted after abnormal termination.Manager Parameters Sample Manager Parameter File PORT 7809 DYNAMICPORTLIST 9001–9100 AUTOSTART ER * AUTORESTART EXTRACT *. . PURGEOLDEXTRACTS purges GoldenGate trails that are no longer needed based on the option settings. Alternately can be set in seconds or hours. Alternately can be set in seconds or hours. LAGINFOMINUTES specifies the interval at which Extract and Replicat will send a informational message to the event log. USECHECKPOINTS PORT establishes the TCP/IP port number on which Manager listens for requests. Alternately can be set in minutes. AUTOSTART specifies processes that are to be automatically started when Manager starts. DYNAMICPORTLIST specifies the ports that Manager can dynamically allocate. RETRIES 5 LAGREPORTHOURS 1 LAGINFOMINUTES 3 LAGCRITICALMINUTES 5 PURGEOLDEXTRACTS /ggs/dirdat/rt*.

USETHREADS | NOUSETHREADS To perform background tasks. Specifies processes to be restarted by Manager after a failure. Determines how often process heartbeat messages are reported. BOOTDELAYMINUTES Determines how long after system boot time MANAGER delays until performing main processing activities. Specifies a data source name as part of the login information. Controls the frequency of reporting stopped processes. DYNAMICPORTLIST AUTOSTART. Port Management DYNAMICPORTLIST Specifies the ports that Manager can dynamically allocate. 111 . Process Management AUTOSTART AUTORESTART Specifies processes to be started when Manager starts. PORT Establishes the TCP/IP port number on which Manager listens for requests. Specifies a lag time threshold at which an informational message is reported to the event log.Oracle GoldenGate Fundamentals Student Guide Manager Parameters Purpose General Port management Process management Event management Database login Maintenance Examples COMMENT PORT. USERID PURGEOLDEXTRACTS COMMENT Indicates comments in a parameter file. DYNAMICPORTREASSIGNDELAY Specifies a time to wait before reassigning a port. AUTORESTART LAGREPORT. Sets an interval for reporting lag time to the event log. Specifies a lag time threshold at which a “critical” message is reported to the event log. USETHREADS causes a thread to be used on Windows systems or a child process to be spawned on a UNIX system. LAGCRITICAL SOURCEDB. Event Management DOWNCRITICAL DOWNREPORT LAGCRITICAL LAGINFO LAGREPORT UPREPORT Database login SOURCEDB Reports processes that stopped gracefully or abnormally. LAGINFO.

PURGEDDLHISTORY Purges rows from the Oracle DDL history table when they are no longer needed. Determines how often Manager cycles through maintenance activities. PURGEOLDTASKS Purges Extract and Replicat tasks after a specified period of time. PURGEMARKERHISTORY Purges Oracle marker table rows that are no longer needed. STARTUPVALIDATIONDELAY[CSECS] Sets the delay time after which Manager checks the status of a process it started.USERID Maintenance CHECKMINUTES Provides login information for Manager when it needs to access the database. . PURGEOLDEXTRACTS Purges trail data that is no longer needed.

update and delete operations Committed data only Full image for inserts Only primary key and changed columns for updates Only primary key for deletes Only after-image of update Send data without transformation Buffer transactions Until a block is full or Until time elapses Based on average transaction volumes 113 .Oracle GoldenGate Fundamentals Student Guide Extract Parameters Extract Parameter Overview Extract parameters specify: Group name – associates with a checkpoint file Where to send the data Local system Multiple remote systems One to many GoldenGate trails What is being captured Which tables Which rows and columns Which operations Which column mapping to apply Which data transformations to apply Extract Parameter Defaults All Extract parameters assume a default value: Capture all insert.

END. INCLUDE. TABLE EXTTRAIL. CHECKPOINTSECS. .Sample Extract Parameter File EXTRACT ODS USERID GoldenUser. then terminates. OBEY Processing method BEGIN. DECRYPTTRAIL General CHECKPARAMS COMMENT ETOLDFORMAT GETENV Performs parameter check. REPORTROLLOVER ENCRYPTTRAIL.ORDERS. Allows insertion of comments in parameter file. USERID and PASSWORD supply database credentials.0. Retrieves variables that were set with the SETENV parameter. RMTTRAIL FORMATASCII. TABLE SALES. FORMATSQL.INVENTORY. GETUPDATEBEFORES. FORMATXML. STATOPTIONS DISCARDFILE. Extract Parameters Purpose General Database login Selecting and mapping data Routing data Formatting data Reporting Error handling Tuning Maintenance Security Examples SETENV. PASSWORD password RMTHOST manhattan. REPORTCOUNT. TABLE specifies a source table for which activity will be extracted. DBOPTIONS PURGEOLDEXTRACTS. GETENV. Generates trails in a format that is compatible with Replicat versions prior to GoldenGate version 6. NOHEADERS Custom processing CUSEREXIT. PASSTHRU SOURCEDB. MACRO. RMTHOST. RMTTRAIL specifies the GoldenGate trail on the target system. SQLEXEC REPORT. MGRPORT 7809 RMTTRAIL /ggs/dirdat/rt TABLE SALES.) RMTHOST specifies the target system while the MGRPORT option specifies the port where Manager is running. DDLERROR ALLOCFILES. USERID IGNOREINSERTS. (SOURCEDB is not required for Oracle.

Selecting and Mapping Data COLMATCH Establishes global column-mapping rules. Not required unless SPECIALRUN is used. 115 . DDLSUBST Enables string substitution in DDL processing. DSOPTIONS Specifies Extract processing options when a Vendor Access Module (VAM) is being used. TRACETABLE | NOTRACETABLE Causes Extract to ignore database changes generated by Replicat during bidirectional synchronization.Oracle GoldenGate Fundamentals Student Guide Processes parameter statements contained in a different parameter file. VAM Indicates a Vendor Access Module (VAM) is being used to provide transactional data to Extract. COMPRESSDELETES | NOCOMPRESSDELETES Controls whether GoldenGate writes all columns or only the key for delete operations. Database Login SOURCEDB USERID OBEY Specifies the data source as part of the login information. DDL Enables and filters the capture of DDL operations. Processing Method BEGIN Specifies when to begin a processing run. TCPSOURCETIMER | NOTCPSOURCETIMER Adjusts timestamps of rows transferred to other systems to account for system clock differences (not time zone differences). SPECIALRUN Used for one-time processing tasks that do not checkpoint from run to run. Specifies database connection information. COMPRESSUPDATES | NOCOMPRESSUPDATES Causes only primary key columns and changed columns to be logged for updates. Online processing is implied if END is in the future or unspecified. Supports Oracle. GETREPLICATES | IGNOREREPLICATES Controls whether or not replicated operations are captured by an Extract on the same system. END Specifies when to end a processing run. EXTRACT Defines an Extract group as an online process. SOURCEISTABLE Extracts entire records from source tables. GETAPPLOPS | IGNOREAPPLOPS Controls whether or not operations from all processes except Replicat are captured. SETENV Specifies a value for a UNIX environment variable from within the GGSCI interface. RMTTASK Creates a processing task on the target system. PASSTHRU | NOPASSTHRU Controls whether tables will be processed by a data-pump Extract in pass-through mode (data definitions not required). RECOVERYOPTIONS Controls the recovery mode of the Extract process.

Formats extracted data into equivalent XML syntax. GETDELETES | IGNOREDELETES Controls the extraction of delete operations. GETTRUNCATES | IGNORETRUNCATES Controls the extraction of truncate statements. Specifies a trail to which extracted data is written on the local system. Controls column mapping and conversion. TRIMSPACES | NOTRIMSPACES Controls whether or not trailing spaces are removed when mapping CHAR to VARCHAR columns. SEQUENCE (Oracle) Specifies sequences for synchronization.Controls certain aspects of how GoldenGate fetches data from the database. . Specifies the target system and Manager port number for a remote file or trail. Accepts a decimal value from 1 to 127. Custom Processing CUSEREXIT Invokes customized user exit routines at specified points during processing. REPLACEBADCHAR Replaces invalid character values with another value. Formats extracted data in external ASCII format. TARGETDEFS Specifies a file containing target table definitions for target databases that reside on the NonStop platform. Route Data EXTFILE EXTTRAIL RMTHOST RMTFILE RMTTRAIL Formatting Data FORMATASCII FORMATSQL FORMATXML INPUTASCII NOHEADERS FETCHOPTIONS Specifies an extract file to which extracted data is written on the local system. Formats extracted data into equivalent SQL statements. Specifies an extract file to which extracted data is written on the target system. GETINSERTS | IGNOREINSERTS Controls the extraction of insert operations. GETUPDATEAFTERS | IGNOREUPDATEAFTERS Controls the extraction of update after images. TABLE Specifies tables for synchronization. Prevents record headers from being written to the trail. WILDCARDRESOLVE Defines rules for processing wildcard table specifications in a TABLE statement. TABLEEXCLUDE Excludes tables from the extraction process. representing an ASCII character. GETUPDATEBEFORES | IGNOREUPDATEBEFORES Controls the extraction of update before images. Several of the options are specific to Oracle databases. Specifies a trail to which extracted data is written on a remote system. GETUPDATES | IGNOREUPDATES Controls the extraction of update operations. such as what to do when a row is missing.

REPORTCOUNT Reports the number of records processed. DYNAMICRESOLUTION | NODYNAMICRESOLUTION Suppresses the metadata lookup for a table until Extract encounters transactional data for it. DBOPTIONS Specifies database options. CACHEMGR Controls the virtual memory cache manager. VARWIDTHNCHAR | NOVARWIDTHNCHAR Controls whether length information is written to the trail for NCHAR columns. Used to control the incremental amount of memory structured allocated once the initial allocation specified by NUMFILES parameter is reached. STATOPTIONS Specifies information to include in statistical displays. DDLOPTIONS Specifies DDL processing options. WARNLONGTRANS Defines a long-running transaction and controls the frequency of checking for and reporting them. 117 . Makes Extract start faster when there is a large number of tables specified for capture. unless under direction from GoldenGate Support. Defines macro character other than the default of #. GROUPTRANSOPS Controls the number of records that are sent to the trail in one batch. TLTRACE Traces transaction log extraction activity. FUNCTIONSTACKSIZE Controls the number of arguments permitted in a parameter clause. CHECKPOINTSECS Controls how often Extract writes a checkpoint. REPORT Schedules a statistical report. Error Handling DDLERROR DISCARDFILE Tuning ALLOCFILES Controls error handling for DDL extraction. Defaults to 500. Reporting CMDTRACE LIST | NOLIST Displays macro expansion steps in the Extract report file. Defines a GoldenGate macro.Oracle GoldenGate Fundamentals Student Guide INCLUDE MACRO MACROCHAR SQLEXEC Invokes a macro library. EOFDELAY | EOFDELAYCSECS Determines how long Extract delays before searching for more data to process. Contains records that could not be processed. but other options are best defaulted. TRACE/TRACE2 Shows Extract processing information to assist in revealing processing bottlenecks. FLUSHSECS | FLUSHCSECS Determines the amount of time that record data remains buffered before being written to a trail. Suppresses or displays the listing of macros in the Extract report file. Executes a stored PL/SQL procedure or query during Extract processing. You can set the CACHEDIRECTORY <path> option.

Security DECRYPTTRAIL ENCRYPTTRAIL | NOENCRYPTTRAIL Decrypts data in a trail or extract file. Controls encryption of data in a trail or extract file. TARGET <table spec>] [. Defaults to 1000. Purges trails after they have been consumed. {COLS | COLSEXCEPT} (<column specification>)] [. Specifies the way that trail files are aged. FILTER (<filter specification>)] [. Note: You must use a semicolon to terminate the TABLE statement. Supports Oracle. THREADOPTIONS Controls aspects of the way that Extract operates in an Oracle Real Application Cluster environment. TARGETDEF <definitions template>] [. TRIMSPACES | NOTRIMSPACES] [. SQLEXEC (<SQL specification>)] [. NUMFILES Used to control the initial amount of memory structured allocate for the storage of tables structures. TOKENS (<token specification>)] [.MAXFETCHSTATEMENTS Controls the maximum number of prepared queries that Extract can use to fetch data from the database. FETCHBEFOREFILTER] [. WHERE (<where clause>)] . COLMAP (<column mapping expression>)] [. Specifies when to create new report files. {FETCHCOLS | FETCHCOLSEXCEPT} (column specification)] [. TRANSMEMORY (DB2 z/OS and NonStop SQL/MX only) Controls the amount of memory and temporary disk space available for caching uncommitted transaction data. DEF <definitions template>] [. KEYCOLS (<column specification>)] [. TRANLOGOPTIONS Supplies log-processing options. EVENTACTIONS <action>] [. Maintenance DISCARDROLLOVER PURGEOLDEXTRACTS REPORTROLLOVER ROLLOVER Controls when to create a new discard file. You can use TABLE options to do the following: •Select and filter records •Select and map columns •Transform data •Designate key columns •Define user tokens . RMTHOSTOPTIONS Specifies connection attributes other than host information for a TCP/IP connection used by a passive Extract group. {FETCHMODCOLS | FETCHMODCOLSEXCEPT} (<column spec>)] [. EXITPARAM “<parameter string>”] [. Extract – TABLE Parameter TABLE <table spec> [. SQLPREDICATE “WHERE <where clause>”] [.

DEF <definitions template> Specifies a source-definitions template. to reflect the structure of the record that is reflected in the definitions file or the column map. EVENTACTIONS (<action>) Triggers an action based on a record that satisfies a specified filter criterion or (if no filter condition) on every record. TABLE <table spec> Specifies the source table. rather than that of the source. it could be easier to manage one target definitions file that is transferred to each source. Column mapping and conversion can be performed on the target system to prevent added overhead on the source system. and when the COLMAP option is used. Using TARGET identifies the extracted data by the target structure. 119 . Otherwise. however. FETCHCOLS | FETCHCOLSEXCEPT Enables the fetching of column values from the source database when the values are not in the transaction record. In that case. FETCHBEFOREFILTER Directs the FETCHCOLS or FETCHCOLSEXCEPT action to be performed before a filter is executed. it can be omitted. Replication from a Windows or UNIX system to a NonStop system require these functions to be performed on the source. In addition. EXITPARAM Passes a parameter in the form of a literal string to a user exit. COLMAP Maps records between different source and target columns.Oracle GoldenGate Fundamentals Student Guide •Trim trailing spaces •Pass a parameter to a user exit •Execute stored procedures and queries There must be a TABLE statement for each source table from which you will be extracting data. TARGETDEF <definitions template> Specifies a target-definitions template. TARGET <table spec> Specifies a target table to which the source table will be mapped. for example: TABLE acct*. rather than having to manage source definitions for each source database that must be transferred to the target. especially when there are frequent application changes that require new files to be generated. it may be preferrable to perform the mapping and conversion on the source when there are multiple sources and one target. COLS | COLSEXCEPT Selects or excludes columns for processing. Use wildcards to specify multiple tables with one TABLE statement. TARGET is required for TABLE statements when Extract must refer to a target definitions file (specified with the TARGETDEFS parameter) to perform conversions.

SQLEXEC Executes stored procedures and queries. Extract – TRANLOGOPTIONS Parameter Use the TRANLOGOPTIONS parameter to control database-specific aspects of log-based extraction Examples: Controlling the archive log TRANLOGOPTIONS ALTARCHIVEDLOGFORMAT log_%t_%s_%r. TRIMSPACES | NOTRIMSPACES Controls whether trailing spaces are trimmed or not when mapping CHAR to VARCHAR columns. .arc Specifies an alternative archive log format. FILTER provides more flexibility than WHERE. SQLPREDICATE Enables a WHERE clause to select rows for an initial load.FETCHMODCOLS | FETCHMODCOLSEXCEPT Forces column values to be fetched from the database when the columns are present in the transaction log. TRANLOGOPTIONS ARCHIVEDLOGONLY Causes Extract to read from the archived logs exclusively. FILTER Selects records based on a numeric value. TOKENS Defines user tokens. WHERE Selects records based on conditional operators. TRANLOGOPTIONS ALTARCHIVELOGDEST /oradata/archive/log2 Specifies an alternative archive log location. KEYCOLS Designates columns that uniquely identify rows.

Oracle GoldenGate Fundamentals Student Guide Extract – TRANLOGOPTIONS Parameter (cont’d) Examples: Loop prevention TRANLOGOPTIONS EXCLUDEUSER ggsrep Specifies the name of the Replicat database user so that those transactions are not captured by Extract. TRANLOGOPTIONS EXCLUDETRANS “ggs_repl” Specifies the transaction name of the Replicat database user so that those transactions are not captured by Extract. 121 . Operations on the checkpoint table will be ignored by the local Extract. TRANLOGOPTIONS FILTERTABLE <table_name> Specifies the Replicat checkpoint table name.

and processes the inserts. You can configure multiple Replicat processes for increased throughput and identify each by a different group name.Replicat Parameters Replicat Parameter Overview Replicat parameters specify: Group name – associated with a checkpoint file List of source to target relationships Optional row-level selection criteria Optional column mapping facilities Optional transformation services Optional stored procedure or SQL query execution Error handling Various optional parameter settings The Replicat process runs on the target system. Parameters control the way Replicat processes – how it maps data. as well as perform data transformation prior to replicating the data. you can filter out the rows you do not wish to deliver. Replicat reads extract and log files sequentially. uses functions. Replicat reads extracted data in blocks to maximize throughput. Optionally. . and replicates it to the target tables. reads the extracted data. and handles errors. updates and deletes specified by selection parameters.

TARGET HR.ORDERS. update.STUDENT. Sample Replicat Parameter File REPLICAT SALESRPT USERID ggsuser. checkpoints. Replicat uses checkpoints so that after a graceful stop or a failure. Replicat preserves the boundaries of each transaction while processing . MAP HR. MAP SALES. APPEND MAP HR.Oracle GoldenGate Fundamentals Student Guide Replicat Parameter Defaults All Replicat parameters assume a default value: Apply all inserts.CODES. delete operations Smart transactional grouping 100 source operations are grouped into a single target transaction Process abends on any operational failure Roll back transaction to last good checkpoint Optional error handling Optional mapping to secondary table for exceptions Replicat supports a high volume of data replication activity. but small transactions can be grouped into larger transactions to improve performance. As a result. USERID.CODES. network activity is block-based rather than a record-at-a-time. PASSWORD provide credentials to access the database. and log files. REPLICAT names the group linking together the process. Like Extract. PASSWORD ggspass ASSUMETARGETDEFS DISCARDFILE /ggs/dirrpt/SALESRPT. 123 . WHERE (STATE = “CA” AND OFFICE = “LA”). TARGET SALES. resulting in virtually the same performance as pre-compiled operations. ASSUMETARGETDEFS specifies that the table layout is the identical on the source and target. SQL operations used to replicate operations are compiled once and execute many times.STUDENT WHERE (STUDENT_NUMBER < 400000). processing can be restarted without repetition or loss of continuity.ORDERS. TARGET HR.dsc.

Required when SPECIALRUN is used. STATOPTIONS DISCARDFILE. SPECIALRUN SOURCEDB. BATCHSQL. Records will be appended or the file will be purged at the beginning of the run depending on the options. BULKLOAD Loads data directly into the interface of Oracle’s SQL*Loader bulkload utility. General CHECKPARAMS COMMENT GETENV OBEY . REPORTCOUNT. converting COLMATCH. Allows insertion of comments in parameter file. EXTTRAIL CUSEREXIT. INCLUDE. MAP links the source tables to the target tables and applies mapping. DBOPTIONS PURGEOLDEXTRACTS. END Specifies when Replicat stops processing. selection. OBEY BEGIN. Required when using SPECIALRUN. DEFERAPPLYINTERVAL. then terminates. Processing Method BEGIN Specifies when Replicat starts processing. SPECIALRUN Used for one-time processing that does not require checkpointing from run to run. Replicat Parameters Purpose General Processing method Database login Examples SETENV. HANDLECOLLISIONS ALLOCFILES. error handling. GENLOADFILES Generates run and control files that are compatible with bulk-load utilities. Retrieves a value for a variable set by SETENV. Processes parameter statements contained in a different parameter file. SOURCEDEFS. MAP. IGNOREUPDATES. USERID Selecting. REPORTROLLOVER DECRYPTTRAIL Performs parameter check. GETENV. SETENV Specifies a value for a UNIX environment variable from within the GGSCI interface. MACRO. SQLEXEC REPORT. GROUPTRANSOPS.DISCARDFILE identifies the file to receive records that cannot be processed. ASSUMETARGETDEFS and mapping data Routing data Custom processing Reporting Error handling Tuning Maintenance Security EXTFILE. OVERRIDEDUPS. and data transformation depending on options. REPLICAT Links this run to an online Replicat process. TRACETABLE | NOTRACETABLE Defines a trace table in an Oracle database to which Replicat adds a record whenever it updates the target database. END.

MAP Specifies a relationship between one or more source and target tables and controls column mapping and conversion. REPLACEBADNUM Replaces invalid numeric values with another value. DB2. including before and after images. GETINSERTS | IGNOREINSERTS Controls the replication of insert operations. MAPEXCLUDE Excludes tables from being processed by a wildcard specification supplied in MAP statements. ASCIITOEBCDIC Converts incoming ASCII text to EBCDIC for DB2 on z/OS systems running UNIX System Services. COLMATCH Establishes global column-mapping rules. and Informix. GETUPDATES | IGNOREUPDATES Controls the replication of update operations. Default is IGNORETRUCATES. Converting and Mapping data ALLOWDUPTARGETMAP | NOALLOWDUPTARGETMAP Allows the same source-target MAP statement to appear more than once in the parameter file.Oracle GoldenGate Fundamentals Student Guide Database Login TARGETDB USERID Specifies the target database. Selecting. GETTRUNCATES | IGNORETRUNCATES Includes or excludes the processing TRUNCATE TABLE operations. Sybase. REPLACEBADCHAR Replaces invalid character values with another value. as inserts into the target databases. GETUPDATEBEFORES | IGNOREUPDATEBEFORES Controls the replication of update before images. INSERTUPDATES | NOINSERTUPDATES Converts updates to inserts. 125 . GETUPDATEAFTERS | IGNOREUPDATEAFTERS Controls the replication of update after images. Specifies a database user ID and password for connecting to the target database. Support SQL Server. SOURCEDEFS Specifies a file that contains source table data definitions created by the DEFGEN utility. GETDELETES | IGNOREDELETES Includes (default) or excludes delete operations from being replicated. DDL Enables and filters the capture of DDL operations. ASSUMETARGETDEFS Assumes the source and target tables have the same column structure. DDLSUBST Enables string substitution in DDL processing. INSERTALLRECORDS Inserts all records. FILTERDUPS | NOFILTERDUPS Controls the handling of anomalies in data that is sent out of order from NSK. INSERTDELETES | NOINSERTDELETES Converts deletes to inserts. INSERTMISSINGUPDATES | NOINSERTMISSINGUPDATES Converts an updates to an insert when a target row does not exist.

DISCARDFILE Contains records that could not be processed. Reporting CMDTRACE LIST | NOLIST REPORT REPORTCOUNT SHOWSYNTAX STATOPTIONS TRACE | TRACE2 Displays macro expansion steps in the report file. as required by Teradata databases. USETIMEPREFIX Prefixes data values for TIME datatypes with a TIME literal. INCLUDE References a macro library in a parameter file. . UPDATEDELETES | NOUPDATEDELETES Changes deletes to updates. Causes Replicat to print its SQL statements to the report file. Shows Replicat processing information to assist in revealing processing bottlenecks. Error Handling CHECKSEQUENCEVALUE | NOCHECKSEQUENCEVALUE (Oracle) Controls whether or not Replicat verifies that a target sequence value is higher than the one on the source and corrects any disparity that it finds. Reports the number or records processed. Schedules a statistical report at a specified date or time. Specifies information to include in statistical displays. SQLEXEC Executes a stored procedure. as required by Teradata databases. Suppresses or displays the listings of the parameter file to the report file. as required by Teradata databases. USETIMESTAMPPREFIX Prefixes data values for TIMESTAMP datatypes with a TIMESTAMP literal. MACRO Defines a GoldenGate macro. Routing Data EXTFILE EXTTRAIL Defines the name of an extract file on the local system that contains data to be replicated. DEFERAPPLYINTERVAL Specifies a length of time for Replicat to wait before applying replicated operations to the target database.SPACESTONULL | NOSPACESTONULL Controls whether or not a target column containing only spaces is converted to NULL on Oracle. USEDATEPREFIX Prefixes data values for DATE data types with a DATE literal. query or database command during Replicat processing. DDLERROR Controls error handling for DDL replication. Defines a trail containing data to be replicated Used for one-time processing. TRIMSPACES | NOTRIMSPACES Controls if trailing spaces are preserved or removed for character or variable character columns. Used for one-time processing. TABLE (Replicat) Specifies a table or tables for which event actions are to take place when a row satisfies the given filter criteria. Custom Processing CUSEREXIT Invokes customized user exit routines at specified points during processing.

SQLDUPERR When OVERRIDEDUPS is on. DBOPTIONS Specifies database options. OVERRIDEDUPS | NOOVERRIDEDUPS Overlays a replicated insert record onto an existing target record whenever a duplicate-record error occurs. GROUPTRANSOPS Groups multiple transactions into larger transactions.Oracle GoldenGate Fundamentals Student Guide HANDLECOLLISIONS | NOHANDLECOLLISIONS Handles errors for duplicate and missing records. INSERTAPPEND | NOINSERTAPPEND Controls whether or not Replicat uses an APPEND hint when applying INSERT operations to Oracle target tables. RESTARTCOLLISIONS | NORESTARTCOLLISIONS Controls whether or not Replicat applies HANDLECOLLISIONS logic after GoldenGate has exited because of a conflict. LOBMEMORY Controls the memory and disk space allocated to LOB transactions. MAXDISCARDRECS Limits the number of discarded records reported to the discard file. specifies the database error number that indicates a duplicate-record error. DYNAMICRESOLUTION | NODYNAMICRESOLUTION Makes Replicate start faster when there is a large number of tables specified for synchronization. NUMFILES Used to control the initial amount of memory structured allocate for the storage of tables structures. EOFDELAY | EOFDELAYSECS Determines how many seconds Replicat delays before looking for more data to process. DYNSQL | NODYNSQL Causes Replicat to use literal SQL statements rather than a compile-once. REPERROR Determines how Replicat responds to database errors. Reconciles the results of changes made to the target database by an initial load process with those applied by a change-synchronization group. FUNCTIONSTACKSIZE Controls the number of arguments permitted when using GoldenGate column-conversion functions. execute-many strategy. REPFETCHEDCOLOPTIONS Determines how Replicat responds to operations for which a fetch from the source database was required. BATCHSQL Increases the throughput of Replicat processing by arranging similar SQL statements into arrays and applying them at an accelerated rate. MAXSQLSTATEMENTS Controls the number of prepared SQL statements that can be used by Replicat. WARNRATE Determines how often database errors are reported. HANDLETPKUPDATE Prevents constraint errors associated with replicating transient primary key updates. Tuning ALLOCFILES Used to control the incremental amount of memory structured allocated once the initial allocation specified by NUMFILES parameter is reached. MAXTRANSOPS Divides large transactions into smaller ones. CHECKPOINTSECS Controls how often Replicat writes a checkpoint when checkpoints are not being generated as a result of transaction commits. DDLOPTIONS Specifies DDL processing options. Defaults to 1000. 127 . Defaults to 500.

COLMAP (<column mapping expression>)] [. FILTER (<filter specification>)] [. you can replicate particular subsets of data to the target table. WILDCARDRESOLVE Alters the rules by which wildcard specifications in a MAP statement are resolved. EXCEPTIONSONLY] [. HANDLECOLLISIONS | NOHANDLECOLLISIONS] [. Specifies when to create new report files. In addition. With MAP. Note: You must use a semicolon to terminate the MAP statement. You can also include a FILTER command to evaluate data provided built-in functions for more complex filtering criteria. TARGETDEF <definitions template>] [. INSERTALLRECORDS] [. TRIMSPACES | NOTRIMSPACES] [. saving them for when the entire source transaction is ready to be applied. MAP enables the user to map certain fields or columns from the source record into the target record format (“column mapping”). WHERE (STATE = “CA”). The first <table spec> is the source table. Purges GoldenGate trail files once consumed. EXITPARAM “<parameter string>”] [. update and delete records originating in the source table are replicated in the target table. REPERROR (<error> . Replicat – MAP Parameter MAP <table spec> . for example. DEF <definitions template>] [. KEYCOLS (<column specification>)] [. TRANSACTIONTIMEOUT Specifies a time interval after which Replicat will commit its open target transaction and roll back any incomplete source transactions that it contains. Maintenance DISCARDROLLOVER PURGEOLDEXTRACTS REPORTROLLOVER Security DECRYPTTRAIL RETRYDELAY Specifies when to create new discard files. TARGET <table spec> [. INSERTAPPEND | NOINSERTAPPEND] [. TRANSMEMORY (DB2 z/OS and NonStop SQL/MX only) Controls the amount of memory and temporary disk space available for caching uncommitted transaction data. Insert. SQLEXEC (<SQL specification>)] [.Specifies the delay between attempts to retry a failed SQL operation. <response>)] [. . The MAP parameter establishes a relationship between one source and one target table. WHERE (<where clause>)] . Decrypts data in a trail or extract file. EVENTACTIONS <action>] [.

TARGET <table spec> Specifies the target object. FILTER Selects records based on a numeric operator. For example. depending on some value or type of operation.Oracle GoldenGate Fundamentals Student Guide A table can appear in multiple maps as either source or target. TRIMSPACES | NOTRIMSPACES Controls whether trailing spaces are trimmed or not when mapping CHAR to VARCHAR columns. HANDLECOLLISIONS | NOHANDLECOLLISIONS Reconciles the results of changes made to the target table by an initial load process with those applied by a change-synchronization group. SQLEXEC Executes stored procedures and queries. 129 . EXITPARAM Passes a parameter in the form of a literal string to a user exit. COLMAP Maps records between different source and target columns. FILTER provides more flexibility than WHERE. INSERTALLRECORDS Applies all row changes as inserts. INSERTAPPEND | NOINSERTAPPEND Controls whether or not Replicat uses an APPEND hint when applying INSERT operations to Oracle target tables. MAP <table spec> Specifies the source object. TARGETDEF <definitions template> Specifies a target-definitions template. EVENTACTIONS (<action>) Triggers an action based on a record that satisfies a specified filter criterion or (if no filter condition) on every record. EXCEPTIONSONLY Specifies error handling within an exceptions MAP statement. WHERE Selects records based on conditional operators. KEYCOLS Designates columns that uniquely identify rows. REPERROR Controls how Replicat responds to errors when executing the MAP statement. one might replicate a “sales” file to either the “east sales” or “west sales” tables. DEF <definitions template> Specifies a source-definitions template.

… 3. Database login parameters. SOURCEDEFS or ASSUMETARGETDEFS. PURGEOLDEXTRACTS. DYNAMICPORTLIST. EXTRACT with group name. DISCARDFILE. TABLE. PORT. MAP. 4. AUTORESTART. What are some typical Manager parameters? What are some typical Extract parameters? What are some typical Replicat parameters? Where are GoldenGate parameters documented? 1. Database login parameters. AUTOSTART. LAG parameters. 3. EXTTRAIL or RMTHOST and RMTTRAIL. … 4.Parameters – Discussion Points 1. REPLICAT with group name. . Reference Guide. 2. … 2.

MAP sales.Overview Data selection and filtering Column mapping Functions SQLEXEC Macros User tokens User exits Oracle Sequences Data Selection and Filtering Data Selection . TARGET sales. ROWS selection 131 . Operation.Oracle GoldenGate Fundamentals Student Guide Data Mapping and Transformation Data Mapping and Transformation .Overview GoldenGate provides the ability to select or filter out data based on a variety of levels and conditions Parameter / Clause TABLE or MAP WHERE FILTER TABLE COLS | COLSEXCEPT Selects Table Row Row.tord.tcustord. Range Columns TABLE selection The MAP (Replicat) or TABLE (Extract) parameter can be used to select a table.

for example: TABLE sales. TARGET sales.tord. Use COLS to select columns for extraction.tcustord. WHERE (PRODUCT_AMOUNT > 10000). MAP sales. OPERATIONS selection The following can be used with MAP or TABLE to select rows with amounts greater than zero only for update and delete operations.tcustord.tord. . amount > 0). ON DELETE. COLSEXCEPT (facility_number).tcustord. WHERE (PRODUCT_TYPE = “AUTO”).The following WHERE option can be used with MAP or TABLE to select rows for “AUTO” product type. Data Selection – WHERE Clause The WHERE clause is the simplest form of selection WHERE clause appears on either the MAP or TABLE parameter and must be surrounded by parenthesis WHERE clause cannot: perform arithmetic operations refer to trail header and user token values Use the FILTER clause for more complex selections with built-in functions Examples using the WHERE clause: MAP sales.tord. TARGET sales. COLUMNS selection The COLS and COLSEXCEPT options of the TABLE parameter allow selection of columns as shown in the example below. and use COLSEXCEPT to select all columns except those designated by COLSEXCEPT. WHERE (PRODUCT_TYPE = “AUTO”). FILTER (ON UPDATE. TARGET sales.

123 "AUTO". WHERE (AMOUNT @PRESENT AND AMOUNT <> @NULL). the result is false. 5500.@PRESENT. WHERE (STATE = “CA”). <. Note that if amount was not part of the update. Only rows where the amount was part of the operation and it has value that is not null. Data Selection – WHERE Clause Examples Only rows where the state column has a value of CA are returned.Oracle GoldenGate Fundamentals Student Guide Data Selection – WHERE Clause WHERE can perform an evaluation for: Element Description Columns Comparison operators Numeric values Literal strings Field tests Conjunctive operators Example PRODUCT_AMT =. <= -123. 133 . >=. Only rows where the amount column has a value of NULL.@ABSENT AND. <>. WHERE (ACCOUNT_ID > “CORP-ABC”). "Ca" @NULL. OR Arithmetic operators and floating-point data types are not supported by WHERE. >. Only rows where the account identifier is greater than CORP-ABC. WHERE (AMOUNT = @NULL).

FILTER (ON UPDATE. the entire filter clause fails Include multiple option clauses. for example (on insert/ update) Raise a user-defined Error for exception processing When multiple filters are specified per a given TABLE or MAP entry. The failure of any filter results in a failure for all filters.If any filter fails. In the following example error 9999 is generated when the BEFORE timestamp is earlier than the CHECK timestamp. RAISEERROR 9999). This also selects only update operations. updates and deletes.Selection – FILTER Clause The FILTER clause provides complex evaluations to include or exclude data selection FILTER clause appears on either the MAP or TABLE parameter and must be surrounded by parenthesis With FILTER you can: Deploy other GoldenGate built-in functions Use multiple FILTERs on one statement . .TIMESTAMP. The FILTER RAISEERROR option creates a user-defined error number if the filter clause is true. Filters can be qualified with operation type so you can specify different filters for inserts. the filters are executed until one fails or until all are passed.TIMESTAMP < CHECK. BEFORE.

RAISEERROR can be used to control what happens in the event that a filter is not passed (the operation can be discarded. ON UPDATE. In combination with REPERROR. ON DELETE executes on updates and deletes but not inserts).Oracle GoldenGate Fundamentals Student Guide Data Selection – FILTER Clause Syntax FILTER (<option> [. Why is the example above not constructed like the one below? The filter below will fail! FILTER(NAME = “JOE”). IGNORE INSERT | UPDATE | DELETE Specifically ignores the specified type of operation. <option]) ] [. More than one ON clause can be specified (for example.). The following example includes rows containing a string “JOE”: FILTER (@STRFIND(NAME. <option]) . update or delete. RAISEERROR <error num> RAISEERROR causes an error to be raised as if there was a database error in the map (RAISEERROR has no effect in the Extract program).000: FILTER ((PRODUCT_PRICE*PRODUCT_AMOUNT)>10000). posted to an exceptions table. …] Where <option> is one of : <column specification> <field conversion function> <ON INSERT | UPDATE | DELETE > <IGNORE INSERT | UPDATE | DELETE> <RAISEERROR <error number> > ON INSERT | UPDATE | DELETE Specifically limits the filter to be executed on an insert. reported. Data Selection – FILTER Clause Examples The following example includes rows where the price multiplied by the amount exceeds 10. [FILTER (<option> [. "JOE")>0). etc. 135 .

3)). .. FILTER (@RANGE (1. @RANGE helps divide workload into multiple. and the total number of ranges (generally the number of processes).]]) Example TABLE SALES. For example.Data Selection – RANGE Function Divides workload into multiple. or if no columns are specified. randomly distributed groups of data. <column> [. Restriction: @RANGE cannot be used if primary key updates are performed on the database. Note that the total number of ranges will be adjusted internally to optimize even distribution across the number of ranges. while guaranteeing that the same row will always be processed by the same process. . the primary key columns of the source table. randomly distributed groups of data Guarantees the same row will always be processed by the same process Determines which group that range falls in by computing a hash against the primary key or user defined columns Syntax @RANGE (<my range>. <total ranges> [.ACCOUNT. @RANGE can be used to split the workload different key ranges for a heavily accessed table into different Replicat processes.. A remainder of the hash and the total number of ranges is compared with the ownership range to determine whether or not @RANGE determines true or false. The user specifies both a range that applies to the current process. @RANGE computes a hash value of all the columns specified.

REP_ID)). TABLE SALES.REP. the example below shows three Replicat groups. TABLE SALES.ACCOUNT. The example above demonstrates three Replicat processes. FILTER (@RANGE (2.REP_ID)). Replicat #2 MAP SALES.3)).REP_ID)). REP and ACCOUNT.ACCOUNT. Data Selection – RANGE Function Examples Two tables. so this Replicat is processing the first range for both the ORDER table and the TRANSACTION table. Both of these MAP statements select the first of 2 ranges. each processing one-third of the data Hashing each operation by primary key to a particular Replicat guarantees the original sequence of operations Replicat #1 MAP SALES. FILTER (@RANGE (3. TABLE SALES.3. related rows will always be processed to the same Replicat RMTTRAIL /ggs/dirdat/aa TABLE SALES. 137 . FILTER (@RANGE (1. with each Replicat group processing one-third of the data in the GoldenGate trail based on the primary key. RMTTRAIL /ggs/dirdat/cc TABLE SALES. RMTTRAIL /ggs/dirdat/bb TABLE SALES. TARGET SALES.3.REP. FILTER (@RANGE (2. related by REP_ID. Replicat #3 MAP SALES. FILTER (@RANGE (2.ACCOUNT. TARGET SALES.ACCOUNT.ACCOUNT. TARGET SALES.3)).ACCOUNT.REP.3.ACCOUNT.3)).Oracle GoldenGate Fundamentals Student Guide Data Selection – RANGE Function Examples For transaction volume beyond the capacity of a single Replicat. require three Replicats to handle the transaction volumes By hashing the REP_ID column.3)). FILTER (@RANGE (1. Another Replicat would include parameters to process the second of the ranges.3)). FILTER (@RANGE (3.ACCOUNT. FILTER (@RANGE (1.ACCOUNT.3)). FILTER (@RANGE (3.

or string literals enclosed in quotes. If the scale of the source is larger than that of the target. and datetime fields. These features are implemented with the COLMAP clause in the TABLE and MAP Parameters. If the target scale is larger than the source. Varchar and character fields can accept other character.Column Mapping Column Mapping . If the target character field is smaller than that of the source.Overview GoldenGate provides the capability to map columns from one table to another Data can be transformed between dissimilar database tables Using COLMAP to map target columns from your source columns GoldenGate automatically matches source to target column names with USEDEFAULTS Mapping can be applied either when extracting or replicating data Extract and Replicat provides the capability to transform data between two dissimilarly structured database tables or files. group. the character field is truncated on the right. the number is padded with zeros. varchar. Data Type Conversions Numeric fields are converted from one type and scale to match the type and scale of the target. . the number is truncated on the right.

.TABLE. <target field> = <source expression>] [.YY A function expression. such as “ABCD” The name of a source field or column. and begin with the at sign (@).. This can be useful when the source and target definitions are similar but not identical. the process maps columns in the source table to columns in the target with the same name.. COLMAP ( [USEDEFAULTS.] <target field> = <source expression> [.TABLE. For COLMAP: <target field> is the name of a column/field in the target table <source expression> is one of the following: Numeric constant. TARGET TARGET. such as DATE1. you can map columns with different names to each other using default mapping.Oracle GoldenGate Fundamentals Student Guide Column Mapping . 3) Note: Function expressions are used to manipulate data. such as @STREXT (COL1. 139 .] ).Syntax Syntax for the COLMAP clause: MAP SOURCE. Default Mapping When you specify USEDEFAULTS.1. Note: If you set up global column mapping rules with COLMATCH parameters. such as 123 String constant.

The initial insert and subsequent updates and deletes are maintained as point-in-time snapshots.PHONE columns that have the same name. INSERTALLRECORDS causes Replicat to insert every change operation made to a record as a new record in the database. PH_PREFIX. Column Mapping – Building History This example uses special values to build history of operations data INSERTALLRECORDS MAP SALES. BEFORE_AFTER_IND = @GETENV(“GGHEADER”. AREA_CODE. TRAN_TIME = @GETENV(“GGHEADER”.PHONE. “BEFOREAFTERINDICATOR”). PH_PREFIX and PH_NUMBER with quote and hypen literals to derive the PHONE_NUMBER column value Automatically maps other HR. COLMAP uses the @GETENV function to get historical data from the GoldenGate trail header – TRAN_TIME picks up the commit timestamp for the date of the . TARGET REPORT.Column Mapping – Example MAP HR. COLMAP (USEDEFAULTS. OP_TYPE = @GETENV(“GGHEADER”.CONTACT CUST_NAME column value to the HR. ).ACCOUNT.CONTACT AREA_CODE. COLMAP (USEDEFAULTS. PHONE_NUMBER = @STRCAT( “(”.CONTACT columns to the HR.ACCTHISTORY. TARGET HR. NAME = CUST_NAME. This example: Moves the HR.”COMMITTIMESTAMP”). PH_NUMBER ) ).CONTACT. “OPTYPE”).PHONE NAME column Concatenates the HR. “-”. “)”.

you also have the ability to call your own logic through user exits Functions . and other column values to determine the appropriate value and format for target columns Functions are identified with the @ prefix 141 . OP_TYPE stores whether it is an insert. Functions Functions .Data Transformation GoldenGate provides the capability to transform columns by using a set of built-in functions Transformation functions can be applied either for Extract or Replicat If you require more.Overview Using column conversion functions. and BEFORE_AFTER_IND indicates whether it is storing a “before” or “after” image. update. strings. you can: Perform string and number conversion Extract portions of strings or concatenate columns Compare strings or numbers Perform a variety of date mappings Use single or nested IF statements to evaluate numbers. or delete operation.Oracle GoldenGate Fundamentals Student Guide transaction.

PHONE_PREFIX = @STREXT (PHONE-NO. 6). TRANSACTION_DATE = @DATE (“YYYY-MM-DD”.ACCOUNT. NULL or invalid Tests whether a column value is present. The syntax for the @STREXT function is: @STREXT (<column or literal string>. AREA_CODE = @STREXT (PHONE-NO. and MONTH in the format MM to a target date with the format YYYY-MM-DD. <source col>] [. and 7 to 10 for the PHONE_NUMBER.]) The example uses @STREXT to extract portions of a string field into 3 different columns. COLMAP ( USEDEFAULTS. 1.. “<in descriptor>”. 10) ). MONTH.. “<in descriptor>”. . PHONE_NUMBER = @STREXT (PHONE-NO. <end position>) Functions – Performing Tests on Column Values Function CASE EVAL IF COLSTAT COLTEST VALONEOF Description Allows user to select a value depending on a series of value tests Allows a user to select a value depending on a series of independent tests Selects one of two values depending on whether a conditional statement returns TRUE or FALSE Returns whether a column value is missing. It takes the first through the third characters from the source’s PHONE-NO to populate the target’s AREA_CODE. “MM”. characters 4 through 6 for the PHONE_PREFIX. <source col> [. “YY”.ACCOUNT.Functions – Example MAP SALES. DAY in the format DD. 7. NULL or invalid Returns true if a column contains one of a list of values . DAY). The example uses @DATE to derive the TRANSACTION_DATE by converting source date columns YEAR in the format YY. “DD”. 3). missing. The syntax for the @DATE function is: @DATE (“<out descriptor>”. TARGET REPORT. 4. YEAR. <begin position>.

What IF clause would you use to set the target column AMOUNT_COL to AMT only if AMT is greater than zero. PRICE * QUANTITY. AMT. <value if expression is non-zero>. 1. <value if expression is zero>) Non-zero is considered true. 0) Discussion Points: IF Function 2. What IF clause would you use to set ORDER_TOTAL to PRICE*QUANTITY if both PRICE and QUANTITY are greater than zero. 0) 143 .Oracle GoldenGate Fundamentals Student Guide Functions that perform tests These functions select a value based on tests against the current value. otherwise return zero? ORDER_TOTAL = @IF (PRICE > 0 AND QUANTITY > 0. and zero (0) is considered false. and otherwise return zero? AMOUNT_COL = @IF (AMT > 0. Discussion Points: IF Function Syntax: @IF (<conditional expression>.

1. Discussion Points: DATE Function Syntax @DATE (“<output format>”.]) Supported input and output formats are in the notes... 001. date1_mm. 365) DD numeric day of month. HH Hour..g. DDD numeric day of the year (e. month and day columns into a date? date_col = @DATE ("YYYY-MM-DD". YYYY four-digit year. “<input format>”. such as APR.Functions – Working with Dates Function DATE Description Returns a date from a variety of sources in a variety of output formats Returns the difference between two dates or times Returns the current date and time DATEDIFF DATENOW Functions that work with dates These functions return dates in various formats and calculate the difference between two dates. <source column>] [. “<input format>”. "DD". YY two-digit year. date1_yy. MMM alphanumeric month. "YY". MM numeric month. "MM". <source column> [. . date1_dd) Formats that are supported for both input and output are: CC century. What DATE expression would you use to convert year. MI minute.

(e. JUL Julian day. JTSGMT and JTS Julian timestamp. it can be hard-coded or the @IF function can be used to set a condition. FFFFFF fraction (up to microseconds).Oracle GoldenGate Fundamentals Student Guide SS seconds. "YYYYMMDDHHMISS". DOW1 numeric day of the week (Sunday = 1). Calculating the century: When a two-digit year is supplied. CDATE C timestamp in seconds since the Epoch. Discussion Points: DATE Function 2. What DATE expression would you use to convert a numeric column stored as YYYYMMDDHHMISS to a Julian timestamp? julian_ts_col = @DATE ("JTS". STRATUS Application timestamp. SUN. but a four-digit year is required in the output. DOWA alphanumeric day of the week. numeric_date) 145 . Formats supported for input are: TTS NonStop 48-bit timestamp PHAMIS Application date format. the system can calculate the century (as 20 if the year is < 50).g. DOW0 numeric day of the week (Sunday = 0). JTSLCT Julian timestamp that is already local time. or to keep local time when converting to a Julian timestamp.

or if the first is less or greater than the second Tests to see if two strings are equal.Functions – Working with Strings and Numbers Function COMPUTE NUMBIN NUMSTR STRCAT STRCMP STREQ STREXT STRFIND STRLEN Description Returns the result of an arithmetic expression Converts a binary string into a number Converts a string into a number Concatenates two or more strings Compares two strings to determine if they are equal. compare. trim and otherwise manipulate strings and numbers. Returns 1 for equal and 0 if not equal Extracts selected characters from a string Finds the occurrence of a string within a string Returns the length of a string Functions that work with strings and numbers These functions convert.) Function STRLTRIM STRNCAT STRNCMP STRNUM STRRTRIM STRSUB STRTRIM STRUP Description Trims leading spaces in a column Concatenates one or more strings up to a specified number of characters per string Compares two strings up to a certain number of characters Converts a number into a string. Functions – Working with Strings and Numbers (cont. extract. with justification and zero-fill options Trims trailing spaces in a column Substitutes one string for another within a column Trims both leading and trailing spaces in a column Changes a string to uppercase .

What STRCAT expression would you use to concatenate the columns LASTNAME and FIRSTNAME.FIRSTNAME) Discussion Points: STRCAT Function 2." .Oracle GoldenGate Fundamentals Student Guide Discussion Points: STRCAT Function Syntax @STRCAT (<string1>..]) The strings can be column names or literal values in quotes. 1. LOCAL_PHONE) 147 . What STRCAT expression would you use to concatenate a country code. "-". area code and local phone number into an international phone number with hyphens between the components? INTL_PHONE = @STRCAT (COUNTRY_CODE. <string2> [. AREA_CODE. . separated by a semicolon? NAME = @STRCAT (LASTNAME.. ". "-".

Further information GETENV and TOKEN are discussed further in User Tokens. 10) Functions . 6). last replicated operation and lag. Converts a hexadecimal string to a binary string. Extracts parameters from a stored procedure as input to a FILTER or COLMAP clause. <begin position>. RANGE is discussed in Data Selection. What STREXT expressions would you use to split a long-distance phone number into three columns (area code. phone no)? AREA_CODE = @STREXT (PHONE. GoldenGate for NonStop version 10 does not write a file header but can retrieve file header values from Open Systems trails using GETENV with the GGFILEHEADER option. . 7. PREFIX = @STREXT (PHONE.Other Function BINARY BINTOHEX GETENV Description Keeps source data in its original binary format in the target when source column is defined as character. Emulate COBOL functions that allow you to set a numeric limit on string or binary datatypes. while ensuring the same row will always be sent to the same process. Converts a binary string to a hexadecimal string. trail file header. <end position>) 1. 1. Maps environmental values that are stored in the user token area to the target column. Can retrieve the commit timestamp in local time or GMT. Returns information on the GoldenGate environment. LOWVAL RANGE TOKEN GETENV with Open Systems trails GoldenGate for Open Systems version 10 and beyond writes a trail file header. PHONE_NO = @STREXT (PHONE.Discussion Point: STREXT Function Syntax @STREXT (<column or literal string>. 4. prefix. Divides workload into multiple groups of data. 3). See the GoldenGate for Mainframe v10 Reference Guide. Range uses a hash against primary key or user defined columns. GETVAL is discussed in SQLEXEC. GETVAL HEXTOBIN HIGHVAL. trail record header.

Extract and Replicat can execute specified database queries that either return results (SELECT statements) or update the database (INSERT. using languages such as Oracle’s PL/SQL and Microsoft’s Transact-SQL. SQL Server and DB2. denormalizing or normalizing data. Tying together industry-standard stored procedure languages with extraction and replication functions brings a familiar. Stored procedures can also be used as an alternative method for inserting data into the database. DB2. aggregating data.Overview SQLEXEC advantages: Extends GoldenGate capabilities by enabling Extract and Replicat to communicate with the application database through SQL queries or run stored procedures Extends data integration beyond what can be done with GoldenGate functions The SQLEXEC option enables both Extract and Replicat to communicate with the user’s database. SQL Query Capabilities In addition to stored procedures.Oracle GoldenGate Fundamentals Student Guide SQLEXEC SQLEXEC . Stored Procedure Capabilities Stored procedures extend the functionality of popular databases such as Oracle. or any other function that requires database operations as input. UPDATE. Output parameters can be captured and used in subsequent map and filter operations. and DELETE statements). powerful interface to virtually unlimited functionality. Extract and Replicat can support stored procedures that only accept input. or procedures that produce output as well. Extract and Replicat enables stored procedure capabilities to be leveraged for Oracle. either via SQL queries or stored procedures. Users write stored procedures in order to perform custom logic. typically involving the database in some way. SQL Server and Teradata. SQLEXEC can be used to interface with a virtually unlimited set of the functionality supported by the underlying database. 149 .

When supplying at least one SQLEXEC entry for a given Replicat map entry. a database logon must be established.SQLEXEC – Basic Functionality Execute a stored procedure or SQL query using the SQLEXEC clause of the TABLE or MAP parameter Optionally extract output parameters from the stored procedure or SQL query as input to a FILTER or COLMAP clause using the @GETVAL function Use SQLEXEC at the root level (without input/output parameters) to call a stored procedure.DBMS and Data Type Support SQLEXEC is available for the following databases: Oracle SQL Server Teradata Sybase DB2 ODBC The stored procedure interface supports the following data types for input and output parameters: Oracle CHAR VARCHAR2 DATE All Numeric types LOBS up to 200 bytes DB2 CHAR VARCHAR DATETIME All Numeric types BLOB data types SQL Server / Sybase / Teradata v12+ CHAR VARCHAR DATE All Numeric types Database and Data Type Support The stored procedure interface for Oracle currently supports the following input and output parameter types: CHAR . a target table is not required. When using SQLEXEC. This is done via the SOURCEDB or USERID parameter for Extract. run a SQL query or issue a database command Before defining the SQLEXEC clause. a mapping between one or more input parameters and source columns or column functions must be supplied. SQLEXEC . and the TARGETDB or USERID parameter for Replicat.

Database Transaction Considerations When specifying a stored procedure or query that updates the database. As with direct table updates. but you can specify other data types for parameters and convert the data to TIMESTAMP format within the stored procedure The stored procedure interface for DB2 currently supports the following input and output parameter types: CHAR VARCHAR DATE All available numeric data types BLOB data types The stored procedure interface for Sybase currently supports data types except TEXT.Oracle GoldenGate Fundamentals Student Guide VARCHAR2 DATE All available numeric data types LOB data types (BLOB and CLOB) where the length is less than 200 bytes The ANSI equivalents of the above types The stored procedure interface for SQL Server currently supports the following input and output parameter types: CHAR VARCHAR DATETIME All available numeric data types Image and text data types where the length is less than 200 bytes TIMESTAMP parameter types are not supported natively. IMAGE. and UDT. Otherwise. database operations initiated within the stored procedure will be committed in the same context as the original transaction. DATE and all available numeric data types. 151 . Doing so ensures that any database updates are committed to the database properly. The stored procedure interface Teradata version 12 and later supports CHAR. you must supply the DBOPS option in the SQLEXEC clause. VARCHAR. database operations can potentially be rolled back.

DESC_PARAM OUT VARCHAR2) BEGIN SELECT DESC_COL INTO DESC_PARAM FROM LOOKUP_TABLE WHERE CODE_COL = CODE_PARAM. Using the lookup procedure This example illustrates how a stored procedure can be used for mapping in a Replicat parameter file. This example illustrates the stored procedure to do a table lookup. SQLEXEC (spname lookup. newacct_val = @GETVAL(lookup. Table lookup using a stored procedure Mapping can be augmented with a simple database lookup procedure in Extract or Replicat. newacct_id = account_id. END.desc_param)). Extract performs the LOOKUP stored procedure prior to executing the column map Maps values returned in desc_param to the newacct_val column using the @GETVAL function MAP HR.ACCOUNT. COLMAP (USEDEFAULTS.SQLEXEC – Using with Lookup Stored Procedure The following stored procedure performs a query to return a description given a code: CREATE OR REPLACE PROCEDURE LOOKUP (CODE_PARAM IN VARCHAR2. . params (code_param = account_code)). TARGET HR. SQLEXEC – Using with Lookup Stored Procedure (cont’d) The following parameter entry: Maps data from the ACCOUNT table to the NEWACCT table When processing any rows from ACCOUNT.NEWACCT.

newacct_val = @GETVAL(lookup. COLMAP (USEDEFAULTS. MAXVARCHARLEN <num bytes>] [.ACCOUNT. This name can be used when extracting values from the procedure. Table lookups using SQL queries The example parameter file entries illustrates a mapping using a simple SQL query to lookup the account description. SQLEXEC (id lookup. ERROR <action>] ) The SQLEXEC option is specified as an option in TABLE and MAP statements within EXTRACT and REPLICAT parameter files. 153 . ALLPARAMS <option>] [. PARAMBUFSIZE <num bytes>] [. SQLEXEC . params (code_param = account_code)).desc_param)). TARGET HR. the syntax is: SQLEXEC ( { SPNAME <sp name> | QUERY “<sql query>” } [. BEFOREFILTER | AFTERFILTER] [. @GETVAL is used to retrieve the return parameter: MAP HR. ID <logical name>] { PARAMS <param spec> | NOPARAMS} [. newacct_id = account_id. DBOP] [.Syntax within a TABLE or MAP Statement When the SQLEXEC parameter is used within a TABLE or MAP statement. Use either SPNAME (for stored procedure) or QUERY (for SQL query).Oracle GoldenGate Fundamentals Student Guide SQLEXEC – Using with SQL Query The following example (for Oracle) performs a SQL query directly to return the description. TRACE <option>] [. EXEC <frequency>] [. SPNAME <sp name> Is the name of the stored procedure in the database. query “select desc_param from lookup_table where code_col = :code_param”.NEWACCT.

MAP is the default. AFTERFILTER Use AFTERFILTER (the default) to cause the stored procedure or query to execute after applying filters to a particular map. for example. This enables you to skip stored procedure or query processing unless the map is actually executed.QUERY “<sql query>” Is a query to execute against the database. it is specified as param1 in the PARAMS clause. NOPARAMS Specifies there are no parameters. MAP Executes the stored procedure or query once for each source-target table map for which it is specified. upon the first invocation of the associated FILE or MAP . For an Oracle SQL query. For example. <sp param name> is the name of any parameter in the stored procedure or query that can accept input. BEFOREFILTER Use BEFOREFILTER to cause the stored procedure or query to execute before applying filters to a particular map. For example. DBOP Use DBOP if the stored procedure or query updates the database and you want the process to execute transaction commit logic. ID <logical name> ID is required with the QUERY parameter (to reference the column values returned by the query) or when you can invoke several instances of a stored procedure (to reference each instance separately. PARAMS <param spec> <param spec> is [OPTIONAL | REQUIRED] <sp param name> = <source column> | <source function> For a stored procedure. the results would only be valid for the first source-target map. stored procedures and queries are executed after filtering logic has been applied. EXEC <frequency> Determines the frequency of execution for the stored procedure or query. ONCE Executes the stored procedure or query once during the course of a GoldenGate run. <sp param name> is the name of any input parameter in the query without the leading colon. if a source table is being synchronized with more than one target table. MAP renders the results invalid for any subsequent maps that have the same source table. By default. The query must be a legitimate SQL statement for the database in question. if the parameter :param1 appears in the query. to invoke the same stored procedure to populate two separate target columns).

The default is 200 bytes. so that the results of the procedure or stored procedure or query are invoked for each source-target mapping.Oracle GoldenGate Fundamentals Student Guide statement. For stored procedures requiring more room. ERROR <action> Requires one of the following arguments: IGNORE Database error is ignored and processing continues.000 bytes of space for input and output. OPTIONAL enables the stored procedure or query to execute without all parameters present (the default). FATAL Database processing abends. FINAL Database error is handled as a table replication error. ALLPARAMS {REQUIRED | OPTIONAL} REQUIRED specifies that all parameters must be present in order for the stored procedure or query to execute. TRANSACTION Executes the stored procedure or query once per source transaction. RAISE Database error is handled just as a table replication error. TRACE [ALL|ERROR] If TRACE or TRACE ALL is specified. REPORT Database error is written to a report. Use this option when you are synchronizing a source table with more than one target table. SOURCEROW Executes the stored procedure or query once per source row operation. If TRACE ERROR is specified. parameters are output only after an error occurs in the stored procedure or query. but does not process any additional queries. each stored procedure or query is assigned 10. MAXVARCHARLEN <num bytes> Determines the maximum length allocated for any output parameter in the stored procedure or query. 155 . specify a <num bytes> with an appropriate amount of buffer space. PARAMBUFSIZE <num bytes> By default. The results remain valid for all operations of the transaction. The results remain valid for as long as the process remains running. the input and output parameters for each invocation of the stored procedure or query are output to the report file.

Enclose the query within quotes. the syntax is: SQLEXEC {“call <sp name> ()” | “<sql query>” | “<database command>”} [EVERY <n> {SECONDS | MINUTES | HOURS | DAYS}] [ONEXIT] Examples: SQLEXEC SQLEXEC SQLEXEC SQLEXEC SQLEXEC “call prc_job_count ()” “ select x from dual ” "call prc_job_count ()" EVERY 30 SECONDS “call prc_job_count ()” ONEXIT “SET TRIGGERS OFF” “call <sp name> ()” Specifies the name of a stored procedure to execute. Example: SQLEXEC “call prc_job_count ()” “<sql query>” Specifies the name of a query to execute. for example: SQLEXEC "call prc_job_count ()" EVERY 30 SECONDS ONEXIT Executes the SQL when the Extract or Replicat process stops gracefully. . The statement must be enclosed within double quotes. For best results.SQLEXEC . use quotes on each line. type a space after each begin quote and before each end quote (or at least before each end quote). EVERY <n> {SECONDS | MINUTES | HOURS | DAYS} Causes a standalone stored procedure or query to execute at defined intervals. Example: SQLEXEC “ select x from dual ” “<database command>” Executes a database command.Syntax as a Standalone Statement When a SQLEXEC parameter is used at the root level. For a multi-line query.

param1)). ID is required for multiple executions of a procedure.Oracle GoldenGate Fundamentals Student Guide SQLEXEC – Error Handling There are two types of potential errors that must be considered when implementing SQLEXEC: 1.For multiple executions. ID is a required SQLEXEC argument for queries. When using SQLEXEC to execute the procedure or query. use the actual stored procedure name.For a single execution. PARAMS (param1 = srccol)). <parameter> Valid values are one of the following: 157 . When an error is raised by the database: Error handling allows the error to be ignored or reported These options are controlled with the ERROR option in the SQLEXEC clause SQLEXEC – Using the GETVAL Function to Get Result The GETVAL function supplies a mechanism to: Extract stored procedure and query output parameters Subsequently map them or use in a COLMAP or FILTER clause Syntax @GETVAL (<name>. depending on how many times the procedure is to be executed within a TABLE or MAP statement: .<parameter>) Example MAP schema. SQLEXEC (SPNAME lookup. Stored procedures: Use one of the following.tab1. <name> The name of the stored procedure or query. .tab2. COLMAP (USEDEFAULTS. TARGET schema. use the logical name defined by the ID clause of the SQLEXEC statement. valid values are as follows: Queries: Use the logical name specified with the ID option of the SQLEXEC clause. An error is raised by the database (either the query or stored procedure) The procedure map requires a column that is missing from the source database operation (likely in an update statement) 2. targcol = @GETVAL (lookup.

2. and functions. commands.The name of the parameter in the stored procedure or query from which the data will be extracted and passed to the column map. if extracting values returned by a stored procedure or query. The stored procedure or query executing successfully. and map an alternative value if desired..Overview Macros enable easier and more efficient building of parameters Write once and use many times Consolidate multiple statements Eliminate the need for redundant column specifications Use macros to invoke other macros Create macro libraries and share across parameter files By using GoldenGate macros in parameter files you can easily configure and reuse parameters. The stored procedure or query results have not yet expired. Whether or not the parameter value can be extracted depends on: 1. When a value cannot be extracted. GoldenGate macros work with the following parameter files: • Manager • Extract • Replicat Note: Do not use macros to manipulate data for tables being processing by a data pump Extract in pass-through mode. Rules for determining expiration are defined by the SQLEXEC EXEC option. Usually this means that the column is not mapped. you can use macros for a variety of operations to enable easier and more efficient building of parameters. Macros Macros . the @GETVAL function results in a “column missing” condition.RETURN_VALUE. You can also use the @COLTEST function to test the result of the @GETVAL function to see if it is missing. . . As detailed in the slide.

more complex statements that include parameters. or invocations of other macros. #sourcecol). #<param2>.Oracle GoldenGate Fundamentals Student Guide Macros . as in #macro1. <macro body> represents one or more statements to be used as parameter file input. PARAMS (<p1>. END ends the macro definition. …) BEGIN <macro body> END.. <macro name> must begin with the # character. it must include a value for each parameter named in the PARAMS statement. When the macro is invoked.. If the # macro character is used elsewhere in the parameter file. such as in a table name. It can include simple parameter statements. such as COL1 = COL2. you can change it to something else with the MACROCHAR parameter. Must be specified before the macro body. such as #colmap(COL1. Macro names are not case-sensitive. Parameter names are optional and not case-sensitive. The macro and parameter identifier ‘#’ can be changed to alternative value MACROCHAR $ Syntax <macro name> is the name of the macro. Names must begin with the macro character.<p2>.) describes each of the parameters to the macro. 159 . BEGIN indicates the beginning of the body of the macro.Creating Macros can be defined in any parameter file or library Macro statements include the following Macro name Optional parameter list Macro body Syntax MACRO #<macro name> PARAMS (#<param1>. such as #param1. such as COL1 = #val2.

and INSERTDELETES may be referenced as a macro within multiple MAP statements as shown in the slide. 20. #month. . MAP SALES.Order_DAY).TARGTAB2. Invoking Macros The example above demonstrates defining a macro named #make_date.SRCTAB2. TARGET SALES. “DD”. “MM”. with each instance sending a different set of source column values to determine the target column values. #option_defaults () MAP SALES. For example.Ship_MO. GETUPDATES. #month. TARGET SALES.SRCTAB.Invoking Reference the macro and parameters anywhere you want the macro to be invoked EXTRACT EXSALES MACRO #make_date PARAMS (#year.Macros .ACCOUNT. Macros . Ship_Date = #make_date(Ship_YR. “YY”. GETDELETES. @IF(#year < 50.Ship_DAY) ). Invoke the macro: #option_defaults () IGNOREUPDATES MAP SALES.TARGTAB. 19). “CC”. Note that the order and ship dates are determined as the result of calling the make_date routine to populate the target columns. #year. calling the macro two different times. Reusing parameter sets Another use of macros is to create a set of frequently used commands. Order_Date = #make_date(Order_YR. #day) END.Order_MO.Example Consolidating Multiple Parameters Define the macro: MACRO #option_defaults BEGIN GETINSERTS GETUPDATES GETDELETES INSERTDELETES END. TARGET REPORT. COLMAP ( TARGETCOL1 = SOURCECOL1. GETINSERTS.ACCT. #day) BEGIN @DATE(“YYYY-MM-DD”.

TARGTAB.lib LIST Macro libraries To use a macro library.TARGTAB2. 161 . GETINSERTS GETUPDATES GETDELETES INSERTDELETES MAP SALES.SRCTAB. Macros – Libraries Macros can be built in a library and referenced into your parameter file EXTRACT EXTACCT INCLUDE /ggs/dirprm/macro.SRCTAB2. TARGET SALES. use the INCLUDE parameter at the beginning of a parameter file. TARGET SALES. Note that the macro’s result is altered by the IGNOREUPDATES parameter for the first MAP statement.Oracle GoldenGate Fundamentals Student Guide Macros – Example (contd) The macro expands to the following: GETINSERTS GETUPDATES GETDELETES INSERTDELETES IGNOREUPDATES MAP SALES.lib Macros Listing can be suppressed NOLIST include /ggs/dirprm/large. The syntax is: INCLUDE <macro name> You may toggle the listing or suppression of listing of the output of libraries by using the LIST and NOLIST parameters.

Macros – Expansion Macro Processor enables tracing of macro expansion with the CMDTRACE option Syntax CMDTRACE [ ON | OFF | DETAIL ] Default is OFF Example EXTRACT EXTACCT INCLUDE /ggs/dirprm/macro. #maptranfields () ).ACCOUNT_HISTORY. COLMAP (USEDEFAULTS. When CMDTRACE is enabled.ACCOUNT. OFF disables it. Macro expansion The macro processor enables tracing of macro expansion for debugging purposes via the CMDTRACE command.lib CMDTRACE ON MAP SALES. the macro processor will display macro expansion steps in the process’s report file. . TARGET REPORT. The ON option enables tracing. and DETAIL produces additional details.

Oracle GoldenGate Fundamentals Student Guide User Tokens User Tokens . Use token values to populate target columns through a MAP COLMAP clause and @TOKEN functions. TARGET SALES. or macros. Tokens enable you to extract and store data within the user token area of a trail record header. Set token values through a TABLE TOKENS clause and @GETENV functions. Using user tokens You can use token data in column maps. stored procedures called by SQLEXEC.PRODUCT. values from the GoldenGate header or environment).PRODUCT. use the @TOKEN function in the COLMAP clause of a Replicat MAP statement to map a token to a target column. OSUSER = @TOKEN(“TKN1"). 163 . You can set tokens to values returned by the @GETENV function (for example. for example: MAP SALES. for example: TABLE SALES. TKN2 = @GETENV(“GGHEADER". TRANSTIME = @TOKEN(“TKN2") ). COLMAP (USEDEFAULTS.PRODUCT_HISTORY. For example.Overview GoldenGate provides the ability to store environmental values in the user token area of the GoldenGate record header.“COMMITTIMESTAMP") ). TOKENS (TKN1 = @GETENV(“GGENVIRONMENT".“OSUSERNAME"). Saving user tokens Use the TOKENS option of the Extract TABLE parameter to define a user token and associate it with data.

“<unit>”) “SEC” Returns the lag in seconds. “<return value>”) “DBERRNUM” Returns the database error number associated with the failed operation. “MIN” Returns the lag in minutes. “ERRTYPE” Returns the type of error: DB (for database errors) or MAP (for mapping errors). “OPTYPE” Returns the operation type that was attempted. “GROUPTYPE” Returns the type of process. This is the default when a unit is not explicitly provided for LAG. “MSEC” Returns the lag in milliseconds. “GROUPDESCRIPTION” The description of the group (if any) taken from the checkpoint file. @GETENV (“LAG”.User Tokens . @GETENV (“JULIANTIMESTAMP”) @GETENV (“RECSOUTPUT”) @GETENV (“GGENVIRONMENT”. “GROUPNAME” Returns the name of the process group. a NULL value will be returned. “<return value>”) “DOMAINNAME” (Windows only) Returns the domain name associated with the user that started the process. . @GETENV (“LASTERR”. either EXTRACT or REPLICAT. operating system.Environmental Values Available to @GETENV Syntax: @GETENV (“<option>”. or GoldenGate version does not provide information that relates to a given token. [“<return value”]) Example: @GETENV (“GGENVIRONMENT”. “DBERRMSG” Returns the database error message associated with the failed operation. “HOSTNAME”) Source General Option “LAG” “LASTERR” “JULIANTIMESTAMP” “RECSOUTPUT” “GGENVIRONMENT” “GGFILEHEADER” “GGHEADER” “RECORD” “DBENVIRONMENT” “TRANSACTION” “OSVARIABLE” Returns values for/from Lag (in unit specified) Last failed operation Julian timestamp Number of records written to trail GoldenGate environment Trail file header Trail record header Trail record location Database environment Source transaction OS environmental variable GoldenGate Database Operating System Environmental values available with @GETENV Note: If a given database.

“LASTRECCSN” Returns the commit sequence number (CSN) of the last record in the trail file. @GETENV (“GGFILEHEADER”.FFFFFF. in local GMT Julian time in INT64. “FILESIZE” Returns the size of the trail file when the file is full and the trail rolls over. NULL until the trail file is completed. “<return value>”) “BEFOREAFTERINDICATOR” Returns BEFORE (before image) or AFTER (after image). “TRANSACTIONINDICATOR” Returns the transaction indicator: BEGIN. “COMMITTIMESTAMP” Returns the transaction timestamp (when committed) in the format of YYY-MM-DD HH:MI:SS. “FILESEQNO” Returns the sequence number of the trail file. UPDATE. TYPE n. which supports file headers that contain file versioning information. END. TRUNCATE. “OBJECTNAME” | “TABLENAME” Returns the table name or object name (if a sequence). WHOLE. “LOGPOSITION” Returns the sequence number in the data source. NULL until the trail file is completed. PK UPDATE. “FILEISTRAIL” Returns a True/False flag indicating whether the trail file is a single file (such as one created for a batch run) or a sequentially numbered file that is part of a trail for online. “<return_value>”) “COMPATIBILITY” Returns the GoldenGate compatibility level of the trail file. For example: WCP1252-1 “CREATETIMESTAMP” Returns the time that the trail was created. 165 . Information about the trail file “CHARSET” Returns the global character set of the trail file. MIDDLE. SQL COMPUPDATE. NULL until the trail file is completed.0 or later.0. “OSUSERNAME” Returns the operating system user name that started the process. continuous processing. “LOGRBA” Returns the relative byte address in the data source. ENSCRIBE COMPUPDATE. File headers are not supported in those releases. •1 means that the trail file is of GoldenGate version 10. “FILENAME” Returns the name of the trail file. “FIRSTRECIOTIME” Returns the time that the first record was written to the trail file. The 0 value is used for backward compatibility to those GoldenGate versions. •0 means that the trail file is of a GoldenGate version that is older than 10. “OPTYPE” Returns the type of operation: INSERT.Oracle GoldenGate Fundamentals Student Guide “HOSTNAME” Returns the name of the system running the Extract or Replicat process. “RECORDLENGTH” Returns the record length in bytes. “FIRSTRECCSN” Returns the commit sequence number (CSN) of the first record in the trail file. “PROCESSID” The process ID that is assigned by the operating system. Can be an absolute or relative path. DELETE. @GETENV (“GGHEADER”. without any leading zeros.

“GGBUGFIXLEVEL” Returns the patch version of the process (xx. “GGMINORVERSION” Returns the minor version of the Extract process that created the trail.xx). “GGMAINTENANCELEVEL” Returns the maintenance version of the process (xx. “HARDWARETYPE” Returns the type of hardware of the machine where the Extract that wrote the trail is running.3.” “DATASOURCE” Returns the data source that was read by the process. “DBMAJORVERSION” Returns the major version of the database that produced the data in the trail file. “DBINSTANCE” Returns the name of the database instance. “URI” Returns the universal resource identifier of the process that created the trail file.xx. “DBNAME” Returns the name of the database. NULL until the trail file is completed. “OSRELEASE” Returns the release version of the operating system of the machine where the Extract that wrote the trail is running. if a version is 1.xx). Information about the local host of the trail file “HOSTNAME” Returns the DNS name of the machine where the Extract that wrote the trail is running. “DBMINORVERSION” Returns the minor version of the database that produced the data in the trail file. expressed as an integer. The group name is that which was given in the ADD EXTRACT command.3. it returns 2. expressed as an integer. in the format: <host_name>:<dir>:[:<dir>][:<dir_n>]<group_name> “URIHISTORY” Returns a list of the URIs of processes that wrote to the trail file before the current process. expressed as an integer. “OSTYPE” Returns the type of operating system of the machine where the Extract that wrote the trail is running. “GGBUILDNUMBER” Returns the build number of the process. Information about the GoldenGate process that created the trail file “GROUPNAME” Returns the droup name associated with the Extract process that created the trail. “ggext. Information about the database that produced the data in the trail file. For example.xx.2. “DBTYPE” Returns the type of database that produced the data in the trail file. it returns 3.3. if a version is 1. if applicable to the database type. “GGMAJORVERSION” Returns the major version of the Extract process that created the trail. . for example findb.“LASTRECIOTIME” Returns the time that the last record was written to the trail file. For example.2. “DBCHARSET” Returns the character set that is used by the database that produced the data in the trail file. for example ORA1022A.2. if a version is 1. For example. it returns 1.xx. “OSVERSION” Returns the major version of the operating system of the machine where the Extract that wrote the trail is running. “GGVERSIONSTRING” Returns the maintenance (or patch) level of the Extract process that created the trail. For example.

167 . “SERVERNAME” Returns the name of the server. “RSN” Returns the record sequence number. "DBUSER" Returns the database login user. “LASTCSN” Returns recovery information for internal GoldenGate use. The plan name is included in the begin unit of recovery log record. “DBCLIENTVERSIONSTRING” Returns the maintenance (patch) level of the database client. “FILERBA” Returns the relative byte address of the record within the FILESEQNO file. “LASTCOMPLETECSN” Returns recovery information for internal GoldenGate use. “<variable>”) “<variable>” The name of the variable. The search is case-sensitive if the operating system supports casesensitivity. “USERID” (Oracle) Returns the Oracle user-id of the database user that committed the last transaction.Oracle GoldenGate Fundamentals Student Guide “DBVERSIONSTRING” Returns the maintenance (patch) level of the database that produced the data in the trail file. “NAME” Returns the transaction name. @GETENV (“OSVARIABLE”. “LASTCOMPLETEXIDS” Returns recovery information for internal GoldenGate use. “LASTXID” Returns recovery information for internal GoldenGate use. “TIMESTAMP” Returns the commit timestamp of the transaction. “DBVERSION” Returns the database version. if available. @GETENV (“TRANSACTION”. The search is an exact match of the supplied variable name. “<return value>”) “DBNAME” Returns the database name. “CSN” Returns the commit sequence number (CSN). @GETENV (“RECORD”. “PLANNAME” (DB2 on z/OS) Returns the plan name under which the current transaction was originally executed. “LASTCSNTS” Returns recovery information for internal GoldenGate use. Recovery information carried over from the previous trail file “RECOVERYMODE” Returns recovery information for internal GoldenGate use. “USERNAME” (Oracle) Returns the Oracle user-name of the database user that committed the last transaction. @GETENV (“DBENVIRONMENT”. “<return value>”) “TRANSACTIONID” | “XID” Returns the transaction ID number. “<environment value>”) “FILESEQNO” Returns the sequence number of the trail file without any leading zeros. “DBCLIENTCHARSET” Returns the character set that is used by the database client.

OP_TYPE = @TOKEN (“TKN-OP-TYPE”). TARGET REPORT. “DBVERSION").Setting Values are stored in the GoldenGate record header using a TOKENS clause and @GETENV functions: EXTRACT EXTDEMO TABLE SALES. Using the TOKENS clause of the TABLE parameter. Using the @TOKEN function on the MAP parameter. “RECORDLENGTH"). COLMAP (USEDEFAULTS. TKN_NUMRECS = @TOKEN ("TKN-NUMRECS"). Storing values in the trail header This example demonstrates how to store the details in the GoldenGate trail header. TKN-OSUSER TKN-DOMAIN TKN-COMMIT-TS TKN-BA-IND TKN-TABLE TKN-OP-TYPE TKN-LENGTH TKN-DB-VER TOKENS ( = @GETENV = @GETENV = @GETENV = @GETENV = @GETENV = @GETENV = @GETENV = @GETENV (“GGENVIRONMENT".Using Tokens are retrieved through a MAP COLMAP clause and @TOKEN functions: MAP SALES. the user defines a token identifier (e. TKN-OSUSER) and specifies the environment category and value using the @GETENV function.CUSTOMER_HISTORY. MAP SALES. “DOMAINNAME").ORDER. “TABLENAME"). “OPTYPE"). “OSUSERNAME"). (“GGHEADER". (“GGENVIRONMENT". . “COMMITTIMESTAMP"). (“GGHEADER". TRAN_TIME = @TOKEN ("TKN-COMMIT-TS"). User Tokens . COLMAP (USEDEFAULTS.CUSTOMER. Retrieving values from tokens This example demonstrates how to retrieve values that have been stored as tokens in the GoldenGate trail header.PRODUCT. BEFORE_AFTER_IND = @TOKEN (“TKN-BA-IND”). TKN_ROWID = @TOKEN ("TKN-ROWID")). (“DBENVIRONMENT".g. (“GGHEADER".User Tokens . “BEFOREAFTERINDICATOR).ORDER_HISTORY. TARGET REPORT. (“GGHEADER". (“GGHEADER".

CUSTOMER : INSERT : 57 : BEGIN : 1 : 0 : 1229 : 8 : ORA901 : GGOODRIC : 9.g. Logdump can display them when the USERTOKEN ON option is used.0.000000 : 3604496 : 4058 : SOURCE. TKN-GROUP-NAME) value to use for the target column specification.Oracle GoldenGate Fundamentals Student Guide specify the token identifier (e.0 : ora901 : AAABBAAABAAAB0BAAF LOGDUMP example Once environment values have been stored in the trail header.0. 169 . User Tokens – Viewing in Logdump logdump 2> usertoken on logdump 3> usertoken detail logdump 4> next User tokens: TKN-HOST TKN-GROUP TKN-BA_IND TKN-COMMIT_TS TKN-POS TKN-RBA TKN-TABLE TKN-OPTYPE TKN-LENGTH TKN-TRAN_IND TKN-LAG_SEC TKN-LAG_MIN TKN-LAG_MSEC TKN-NUMRECS TKN-DBNAME TKN-DB_USER TKN-DB_VER TKN-INAME TKN-ROWID : jemhadar : EXTORA : AFTER : 2003-03-24 17:08:59.1. The USERTOKEN DETAIL option provides additional information.

functions. When to implement user exits You can employ user exits as an alternative to. . data is processed once (when extracted) rather than twice (extracted and then read again to perform the transformation). or in conjunction with. with a user exit.User Exits User Exits – What are they? Custom logic written in C or C++ by the customer Invoked at different points in Extract or Replicat processing (through CUSEREXIT parameter) Allows you to extend or customize the functionality of data movement and integration beyond what is supported through mapping. or SQLEXEC Can perform an unlimited number of functions User exits overview At different points during Extract and Replicat processing. routines you create in C can be invoked to perform an unlimited number of functions. the columnconversion functions that are available within GoldenGate. User exits cannot be used for tables being processing by a data-pump Extract in passthrough mode. User exits can be a better alternative to the built-in functions because.

for example.Oracle GoldenGate Fundamentals Student Guide User Exits – Applications Perform arithmetic operations or data transformations beyond those provided with GoldenGate built-in functions Perform additional table lookups or clean up invalid data Respond to events in custom ways. • Accept or reject records for extraction or replication based on complex criteria. • Normalize a database during conversion. by sending a formatted e-mail message or paging a supervisor based on some field value Accumulate totals and gather statistics Perform conflict detection. or custom handling of errors or discards Determine the net difference in a record before and after an update (conflict resolution technique) Additional applications of user exits: • Implement record archival functions off-line. User Exits – High-Level Processing Logic Accepts different events and information from Extract or Replicat Passes the information to the appropriate paragraph/routine for processing Returns a response and information to the caller 171 .

EXIT_CALL_FATAL_ERROR . EXIT_CALL_DISCARD_ASCII_RECORD . during processing.In Extract. Extract and Replicat call the shell routine with the following calls: EXIT_CALL_START .Called just before an Extract or Replicat checkpoint is written.User Exits . and before writing to the marker history file. invoked just before the start of a transaction. In Replicat.Set by the user exit routines to instruct the caller how to respond when each exit call completes (see below).Parameters EXIT_CALL_TYPE indicates when. invoked before a record buffer is output to an Extract file. The user exit can perform completion work.In Extract. end transaction. EXIT_CALL_RESULT .Called during Extract or Replicat processing just before GoldenGate terminates after a fatal error. invoked just before a replicated operation is performed. discard record. stop processing. EXIT_CALL_PROCESS_MARKER .Called during Replicat processing before a record is written to the discard file. In Replicat. EXIT_CALL_BEGIN_TRANS .Invoked at the start of processing. ignore.Called during Replicat processing when a marker from a NonStop server is read from the trail. . the Extract or Replicat process calls the user exit: at start processing. EXIT_CALL_PROCESS_RECORD . stop. begin transaction.Invoked before the caller stops or ends abnormally. This call is the basis of most user exit processing.In Extract and Replicat . EXIT-CALL_DISCARD_RECORD . Callback routines retrieve record and GoldenGate context information and modify the contents of data records EXIT_CALL_TYPE indicates the processing point of the caller and determines the type of processing to perform. process marker. EXIT_CALL_CHECKPOINT . EXIT_CALL_END_TRANS . process record. “more records” indicator ERCALLBACK implements a callback routine. invoked just before the output of the first record in a transaction. invoked just after the last record in a transaction is processed.Called during Extract processing before an ASCII input record is written to the discard file. The user exit can perform initialization work. EXIT_CALL_STOP . abend or skip record EXIT_PARAMS supplies information to the routine: calling program path and name. function parameter. fatal error or call result EXIT_CALL_RESULT provides a response to the routine: OK.

set MORE_RECS_IND to CHAR_NO_VAL or CHAR_YES_VAL. To request the same record again. for example \ggs\extract or \ggs\replicat. FUNCTION_PARAM can also be used at exit call startup to pass the parameters that are specified in the PARAMS option of the CUSEREXIT parameter. <function_code> The function to be executed by the callback routine. If the call specified PROCESS_RECORD or DISCARD_RECORD and OK_VAL is returned. EXIT_PARAMS supplies information to the user exit routine. OK is assumed.Instructs the caller to STOP immediately. the caller processes the record buffer returned by the user exit and uses the parameters set by the exit .Oracle GoldenGate Fundamentals Student Guide EXIT_CALL_RESULT is set by the user exit routines and instructs the caller how to respond when each exit call completes. EXIT_ABEND_VAL . For database records. MORE_RECS_IND Set on return from an exit. <buffer>.Specifies the full path and name of the calling process.Reject records for further processing. Specify the parameter with the EXITPARAM option of a TABLE or MAP statement. The following results can be specified by the operator’s routines: EXIT_OK_VAL . EXIT_PROCESSED_REC_VAL . ERCALLBACK executes a callback routine. when the call type is one of the following: EXIT_CALL_PROCESS_RECORD EXIT_CALL_DISCARD_RECORD EXIT_CALL_DISCARD_ASCII_RECORD Syntax: ERCALLBACK (<function_code>. EXIT_STOP_VAL . such as the program name and user-defined parameters.Instructs Extract or Replicat to skip the record. You can process a single data record multiple times: PROGRAM_NAME . 173 . Use this parameter when loading a GoldenGate callback routine using the Windows API or to identify the calling program when user exits are used with both Extract and Replicat processing.Instructs the caller to ABEND immediately. The user callback routine behaves differently based on the function code passed to the callback routine.Allows you to pass a parameter that is a literal string to the user exit. EXIT_IGNORE_VAL . including the record itself. a common function when converting Enscribe to SQL (data normalization). A user callback routine retrieves context information from the Extract or Replicat process and its context values. determines whether Extract or Replicat processes the record again. <result_code>). but update the statistics that are printed to the eport file for that table and for that operation type. the validity of the function in one process or the other is dependent on the input parameters that are set for that function during the callback routine. FUNCTION_PARAM . While some functions can be used for both Extract and Replicat.If the routine does nothing to respond to an event. This allows the user exit to output many records per record processed by Extract. <buffer> A void pointer to a buffer containing a predefined structure associated with the specified function code.

On Windows: create a user exit DLL in C and export a routine to be called from Extract or Replicat. . The result code returned by the callback routine indicates whether or not the callback function was successful. On Unix: create a shared object in C and create a routine to be called from GoldenGate. In the source for the DLL/shared object. Callback routines retrieve record and application context information. See the Oracle GoldenGate Reference Guide for function codes and result codes. and a number of other definitions. return status values.h file. callback function codes. exit_result_def *exit_call_result. but it must accept the following user exit parameters: EXIT_CALL_TYPE EXIT_CALL_RESULT EXIT_PARAMS Example export syntax for MyUserExit routine __declspec(dllexport) void MyUserExit ( exit_call_type_def exit_call_type. This routine is the communication point between Extract or Replicat and your routines. 3. include the “usrdecs. include the usrdecs. User Exits – Implementing On Windows: create a DLL in C and create a routine to be called from Extract or Replicat On UNIX: Create a shared object in C and create a routine to be called from Extract or Replicat The routine must accept the following parameters: EXIT_CALL_TYPE EXIT_CALL_RESULT EXIT_PARAMS In the source for the DLL/shared object. You can define the name of the routine. and modify the contents of data records. perform the following steps: 1. Include callback routines in the user exit when applicable. exit_params_def *exit_params) 2.h” file (in the GoldenGate install directory) Call the ERCALLBACK function from the shared object to retrieve record and application context information To implement user exits on Windows.<result_code> The status of the function executed by the callback routine. This file contains type definitions.

175 . and modify data. issue callbacks at given exit points. The resulting fetched values from the target are mapped as the target record when it enters the user exit. exitdemo_pk_befores. as well as the before images of regular updates (nonkey updates). The demo is not specific to any database type.txt file.c shows an example of how to get read access to LOB data.Oracle GoldenGate Fundamentals Student Guide Extract and Replicat export an ERCALLBACK function to be called from the user exit routine. exitdemo_passthru. exitdemo_more_recs.c shows how to access the before and after image portions of a primary key update record.c shows an example of how to use the same input record multiple times to generate several target records.c file as well as makefiles and a readme.c shows how to initialize the user exit. User Exits .Samples Sample user exit files are located in <GoldenGate installation directory>/ UserExitExamples Each directory contains the . Sample User Exits exitdemo.c shows how the PASSTHRU option of the CUSEREXIT parameter can be used in an Extract data pump. It also shows how to get target row values with SQLEXEC in the Replicat parameter file as a means for conflict detection. exitdemo_lob. The user exit must explicitly load the callback function at run-time using the appropriate Windows/Unix API calls.

Instead of a reply status of EXIT_OK_VAL. only the after image is passed to the user exit.Calling You can call a user exit from Extract or Replicat by the CUSEREXIT parameter Syntax CUSEREXIT <DLL or shared object name> <routine name> [. Extract will perform all of the required data mapping before passing the record to the user exit. always use the GETUPDATEBEFORES parameter for the primary Extract process. Otherwise. PARAMS "<startup string>”] Examples CUSEREXIT userexit. INCLUDEUPDATEBEFORES. GETUPDATEBEFORES causes both the before image and the after image to be sent to the user exit as separate EXIT_CALL_PROCESS_RECORD events. INCLUDEUPDATEBEFORES] [. INCLUDEUPDATEBEFORES Passes the before images of column values to a user exit. written to the trail. PASSTHRU Valid only for an Extract data pump. you must explicitly request the before image by setting the requesting_before_after_ind flag to BEFORE_IMAGE_VAL within a callback function that supports this flag. All process statistics are updated as if the records were processed by GoldenGate. PASSTHRU] [. When using this parameter. the reply will be EXIT_PROCESSED_REC_VAL.dll MyUserExit CUSEREXIT userexit. <routine name> The name of the exit routine to be executed. and that no output trail is allowed. . It expects that the user exit will perform all of the processing and that Extract will skip the record.dll MyUserExit.properties" <DLL or shared object name> The name of the Windows DLL or UNIX shared object that contains the user exit function. In a case where the primary Extract also has a user exit. and causes a process record event in the user exit.User Exits . By default. so that the before image is captured. When using INCLUDEUPDATEBEFORES for a user exit that is called from a data pump or from Replicat. & PASSTHRU. It assumes that no database is required. GoldenGate only works with after images. PARAMS "init.

in the way that sequences are maintained by the database. Can be used to pass a properties file. the target values will always be greater than those of the source. 177 . and expected. GETUPDATEBEFORES is not needed in this case.employees_seq. INCLUDEUPDATEBEFORES does not cause before images to be written to the trail. startup parameters.Oracle GoldenGate Fundamentals Student Guide If the user exit is called from a primary Extract (one that reads the transaction log). However. from a trail corruption or process failure) and you want to improve the performance of GoldenGate • GoldenGate online and batch (SPECIALRUN) change synchronization methods support the replication of sequence values. or other string.g. Data in the string is passed to the user exit in the EXIT_CALL_START exit_params_def.employees_seq. Oracle Sequences Oracle Sequences GoldenGate supports the replication of Oracle sequence values Use the Extract SEQUENCE parameter to extract sequence values from the transaction log. the exit_params_def. Use the Replicat MAP parameter to apply sequence values to the target. • GoldenGate does not support the replication of sequence values in a bi-directional configuration. The string must be enclosed within double quote marks. unless the NOCHECKSEQUENCEVALUE parameter is used.function_param. Note: Gaps are possible in the values of the sequences that GoldenGate replicates because gaps are inherent. PARAMS "<startup string>” Passes the specified string at startup. If no quoted string is specified with PARAMS. only INCLUDEUPDATEBEFORES is needed for that Extract. The default Replicat CHECKSEQUENCEVALUE parameter ensures that target sequence values are: higher than the source values (if the increment interval is positive) or lower than the source values (if the increment interval is negative) Note: Change this default only if you know there will be no gaps in the sequence updates (e. TARGET payroll. for example: MAP hr.employees_seq.function_param is NULL. for example: SEQUENCE hr. • GoldenGate initial load methods (configurations containing SOURCEISTABLE) do not support the replication of sequence values. unless other GoldenGate processes downstream will need the before image to be written to the trail.

Overview BATCHSQL Compression Encryption Bidirectional considerations Event actions Oracle DDL replication .Configuration Options Configuration Options .

If referential dependencies exist for statements that are in different batches. and executed many times with different variables Referential integrity is preserved Can be used with change capture or initial loads Operations containing the same table. more than one statement per batch may be required to maintain the referential integrity. SQL Server and Sybase Batches similar SQL statements into arrays. the following would each be an example of a batch: Inserts to table A Inserts to table B Updates to table A Updates to table B Deletes from table A Deletes from table B GoldenGate analyzes parent-child foreign key referential dependencies in the batches before executing them. as opposed to individual operations Operations containing the same table. cached. and column list are grouped into a batch Each statement type is prepared once. D). operation type (I. For example. U. 179 .Oracle GoldenGate Fundamentals Student Guide BATCHSQL Options: BATCHSQL – Overview Supported for Oracle. DB2 on z/OS. Teradata. operation type (I. U. and column list are grouped into a batch. DB2 LUW. D).

•In BATCHERRORMODE. The default is 20 megabytes. The default is 1200. By default. The default is 50. but you can change this with NUMTHREADS. Replicat attempts to resolve errors without reverting to normal mode.Options: BATCHSQL – Syntax Implemented with the Replicat BATCHSQL parameter Syntax BATCHSQL [BATCHERRORMODE | NOBATCHERRORMODE] [BATCHESPERQUEUE <n>] [BATCHTRANSOPS <n>] [BYTESPERQUEUE <n>] [OPSPERBATCH <n>] [OPSPERQUEUE <n>] [TRACE] BATCHERRORMODE | NOBATCHERRORMODE Set the response of Replicat to errors. Set to the default of 1000 or higher. •Requires HANDLECOLLISIONS to prevent Replicat from exiting on an error. BATCHESPERQUEUE <n> Sets a maximum number of batches per queue before flushing all batches. BATCHTRANSOPS <n> Controls the size of a batch. Replicat aborts the transaction on an error. BYTESPERQUEUE <n> Sets the maximum number of bytes to hold in a queue before flushing batches. and retries in normal mode. temporarily disables BATCHSQL. there is one buffer queue. •In NOBATCHERRORMODE (default). Note: A queue is a thread of memory containing captured operations waiting to be batched. OPSPERQUEUE <n> Sets the maximum number of row operations that can be queued for all batches before flushing. TRACE Enables tracing of BATCHSQL activity to the console and report file. The default is 1200. . OPSPERBATCH <n> Sets the maximum number of rows that can be prepared for one batch before flushing.

Actual performance benefits will vary depending on the mix of operations. Usage restrictions Some statement types cannot be processed in batches and must be processed as exceptions. Transaction integrity is maintained. BATCHSQL has been known to improve Replicat’s performance from 400 to 500 percent. 181 . BATCHSQL benefits diminish. • Statements where the target table has one or more unique keys besides the primary key. OPSPERBATCH. Options: BATCHSQL – Results Smaller row changes will show a higher gain in performance than larger row changes. applies the exceptions in the normal manner of one at a time. At 100 bytes of data per row change. use the following options to control when a buffer is flushed: BATCHESPERQUEUE. • Statements containing rows longer than 25k in length. and then resumes batch processing. Such statements cannot be processed in batches because BATCHSQL does not guarantee correct ordering for non-primary keys if their values could change. BYTESPERQUEUE. BATCHTRANSOPS (the last buffer flush for a target transaction occurs when the threshold set with BATCHTRANSOPS is reached). Statements treated as exceptions include: • Statements containing LOB or LONG data. At around 5. To attain the optimum balance between efficiency and the use of memory. When BATCHSQL encounters them. it flushes everything in the batch. OPSPERQUEUE.Oracle GoldenGate Fundamentals Student Guide Managing the buffer Buffering consumes memory.000 bytes of data per row change.

zlib. . compression can require significant CPU resources.Example Compression is specified on the Extract RMTHOST parameter: RMTHOST <host> | <ip address>. However. MGRPORT 7809. COMPRESS. MGRPORT <port> [. Example: RMTHOST newyork. COMPRESSTHRESHOLD 750 The destination Server Collector decompresses the data stream before writing it to the remote file or remote trail. This typically results in compression ratios of at least 4:1 and sometimes much better. COMPRESSTHRESHOLD <byte size> ] COMPRESS specifies that outgoing blocks of captured changes are compressed. COMPRESS ] [. COMPRESSTHRESHOLD sets the minimum byte size for which compression will occur.Compression Options: Compression GoldenGate provides optional data compression when sending data over TCP/IP Automatic decompression is performed by Server Collector on remote system Compression threshold allows user to set minimum block size for which to compress GoldenGate uses the zlib compression.net Options: Compression . Default is 1000 bytes. More information can be found at www.

a symmetric 64-bit block cipher from CounterPane™ Internet Security The data is automatically decrypted by Server Collector before saving the data to the trail Trail or Extract File Encryption GoldenGate uses 256-key byte substitution Encrypts only the record data in a trail or extract file The data is decrypted by a downstream data pump or Replicat Database Password Encryption Encrypted password can be generated using a default key or userdefined key Options: Encryption .Overview Extract Network (TCP/IP) Server Collector Trail Replicat Message Encryption (Blowfish) Trail or Extract File Encryption (GoldenGate) Parameters Database Password Encryption Parameters 183 .Oracle GoldenGate Fundamentals Student Guide Encryption Options: Encryption – Overview Message Encryption Encrypts the messages sent over TCP/IP Uses Blowfish.

KEYNAME superkey 5. Enter key names and values in an ASCII text file named ENCKEYS (upper case.. no file extension) in the GoldenGate install directory ##Key name superkey secretkey Key value 0x420E61BE7002D63560929CCA17A4E1FB 0x027742185BBF232D7C664A5E1A76B040 3. use the RMTHOST ENCRYPT and KEYNAME parameters RMTHOST West. enter the literal key in quotes as the key value in an ENCKEYS file: ##Key name Key value mykey “DailyKey " Options: Message Encryption (cont’d) KEYGEN ENCKEYS ENCKEYS Extract TCP/IP Network Server Collector Startup command: server -p <port> -ENCRYPT BLOWFISH -KEYNAME <keyname> Trail Replicat Extract Parameters: RMTHOST… MGRPORT. Configure a static Server Collector and start it manually with the -ENCRYPT and -KEYNAME parameters server -p <port> -ENCRYPT BLOWFISH -KEYNAME <keyname> If you prefer to use a literal key.. Copy the ENCKEYS file to the source and target GoldenGate install directory 4. KEYNAME <keyname> Message Encryption (Blowfish) .Options: Message Encryption 1. In the Extract parameter files. ENCRYPT BLOWFISH. MGRPORT 7809. then instead of using KEYGEN. Run the GoldenGate KEYGEN utility to generate random hex keys C:\GGS> RUN KEYGEN <key length> <number of keys> Blowfish accepts a variable-length key from 32 to 128 bits 2. ENCRYPT BLOWFISH.

USERID joe. Paste the encrypted password in the Extract or Replicat PASSWORD parameter. ENCRYPTKEY DEFAULT 185 . Encrypted password: AACAAAAAAAAAAAOARAQIDGEEXAFAQJ 2. Generate an encrypted password with a GoldenGate default key code: GGSCI> ENCRYPT PASSWORD <password> For example: GGSCI> ENCRYPT PASSWORD goldenpassword No key specified.Oracle GoldenGate Fundamentals Student Guide Options: Trail or Extract File Encryption GoldenGate uses 256-key byte substitution Only the data records are encrypted in the trail Set Extract ENCRYPTTRAIL and Replicat DECRYPTTRAIL parameters Can set ENCRYPTTRAIL before tables you want encrypted and NOENCRYPTTRAIL before other tables Downstream data pumps can also decrypt the trail for transformation and pass it on either encrypted or decrypted Extract Network (TCP/IP) Server Collector Trail Replicat Extract Parameters: ENCRYPTTRAIL <table statements> Trail or Extract File Encryption Replicat Parameters: DECRYPTTRAIL <map statements> Options: Password Encryption – Method 1 1.. for example: SOURCEDB MySource. using default key. PASSWORD AACAAAAAAAAAAAOARAQIDGEEXAFAQJ..

USERID joe. ENCRYPTKEY drkey Options: Password Encryption . USERID . Generate an encrypted password with a user-defined key: GGSCI> ENCRYPT PASSWORD <password>. ENCRYPTKEY DEFAULT | <keyname> Replicat Parameters: [ TARGETDB ] . for example: ##Key name Key value drkey 0x11DF0E2C2BC20EB335CB98F05471A737 3. PASSWORD <encrypted password> . ENCRYPTKEY <keyname> For example: GGSCI> ENCRYPT PASSWORD MyPass. ENCRYPTKEY DEFAULT | <keyname> Password Encryption . Enter the key name and value in the ENCKEYS file. PASSWORD AACAAAAAAAAAAAIAJFGBNEYGTGSBSHVB. for example: SOURCEDB MySource. ENCRYPTKEY DRKEY Encrypted password: AACAAAAAAAAAAAIAJFGBNEYGTGSBSHVB 2. PASSWORD <encrypted password> . USERID .Summary ENCKEYS (user-defined key) Network (TCP/IP) Server Collector (user-defined key) ENCKEYS Extract Trail Replicat Extract Parameters: [ SOURCEDB ] .Options: Password Encryption – Method 2 1. Paste the encrypted password in the Extract or Replicat PASSWORD parameter.

not initial loads Options: Event Actions . start batch processes or start end-of-day reporting Activate tracing Write a checkpoint before and/or after writing the record to the trail 187 .Examples Examples of actions you might take on detecting an event record are: Stop the process Ignore or discard the current record Log an informational or warning message to the report file. to switch an application. GoldenGate error log and system event log Generate a report file Rollover the trail file Run a shell command – for example.Event Records GoldenGate provides an event marker system that enables the GoldenGate processes to take a defined action based on an event record in the transaction log or trail The event record is: Either a record in a data table that satisfies a filter condition for which you want an action to occur Or a record that you write to a dedicated event table when you want an action to occur Only implemented for change replication.Oracle GoldenGate Fundamentals Student Guide Event Actions Options: Event Actions .

Options: Event Actions – Examples (cont’d)
INSERT / UPDATE / DELETE Values(…) in an event table INSERT / UPDATE / DELETE Values(…) in a data table

Reports

Logs

Discards Chkpts

Reports

Logs

Discards Chkpts

EVENT PROCESSING

EVENT PROCESSING

Extract Transaction Log

Network (TCP/IP)

Target Trail

Replicat

Options: Event Actions - Implementing
Add an EVENTACTION option to a TABLE or MAP statement EVENTACTION can specify one or multiple events Example using a separate event table to manage events: TABLE source.event_table, EVENTACTION (ROLLOVER); Whenever a record is written to the event table, the trail file is rolled over. Example using data values to trigger events: MAP source.account, TARGET target.account, FILTER (account_no = 100), EVENTACTIONS (DISCARD, LOG); Any record where account_no = 100 is discarded and a log message written.

Oracle GoldenGate Fundamentals Student Guide

Options: Event Actions - EVENTACTIONS Parameter
TABLE | MAP … EVENTACTIONS ( [STOP | ABORT | FORCESTOP] [IGNORE [TRANSACTION [INCLUDEVENT]] [DISCARD] [LOG [INFO | WARNING]] [REPORT] [ROLLOVER] [SHELL <command>] [TRACE <trace file> [TRANSACTION] [PURGE | APPEND]] [CHECKPOINT [BEFORE | AFTER | BOTH]] [, ...] )
Note: You can also use a TABLE parameter in a Replicat to trigger actions without writing data to target tables

EVENTACTIONS STOP – Graceful stop ABORT – Immediate exit FORCESTOP – Graceful stop if the event record is the last operation in the transaction, else log warning message and abort IGNORE [TRANSACTION [INCLUDEVENT]] – Ignore record. Optionally ignore entire transaction and propagate the event record. DISCARD – Write record to discard file LOG [INFO | WARNING] – Log an informational or warning message to the report, error and systems event files REPORT – Generate a report file ROLLOVER – (Extract only) Roll over the trail file SHELL – Execute a shell command TRACE – Write trace information to file CHECKPOINT – Write a checkpoint before and/or after writing the event record Table statement for Replicat TABLE <table spec>, [, SQLEXEC (<SQL specification>), BEFOREFILTER] [, FILTER (<filter specification>)] [, WHERE (<where clause>)] {, EVENTACTIONS ({IGNORE | DISCARD} [<action>])} ;

189

Options: Event Actions – Heartbeat Example
A heartbeat table is periodically updated with the current time in the source database:
MAP source.heartbeat, TARGET target.heartbeat, FILTER ((@DATEDIFF (“SS”, hb_timestamp, @DATENOW() > 60 AND @DATEDIFF (“SS”, HBTIMESTAMP, @DATENOW() < 120), EVENTACTIONS (LOG); MAP source.heartbeat, TARGET target.heartbeat, FILTER (@DATEDIFF (“SS”, hb_timestamp, @DATENOW() > 120), EVENTACTIONS (LOG WARNING);

EVENT PROCESSING TX1 TX2 Heartbeat TX4 Target Trail Replicat

Info Log Warning

Options: Event Actions - Automated Switchover Example
Switchover

Application 1. User writes an event record at the planned outage point. This is read by Extract through the transaction log.

Application 2. When Replicat reads the event record, it triggers an event action – run a custom script to switch the application to the target database. Trail Network (TCP/IP Trail Extract Trans Log 3. The Extract on the target, already configured and running, starts capturing transactions. Replicat Target

Extract Source Trans Log Replicat

Oracle GoldenGate Fundamentals Student Guide

Options: Event Actions - Automated Synchronization Example

Application

ETL

2. When Replicat reads the event record, it communicates to the second ETL process to start at the right point and performs checkpoints before and after the record.

Application

ETL

1. When a batch load is starting, the ETL process writes an event record. Extract reads the record and performs a checkpoint before and after the record. Extract Source Trans Log Replicat Trail Network (TCP/IP) Extract Trans Log Replicat Target

Trail

3. When the second ETL process is completed, it generates an event record that is read by Extract on the target. When Replicat on the source receives the event record, it triggers a custom script to start the application based on the status of the batch process on the source.

191

The bottom is the reverse – changes from the right-side database are extracted and sent to the left.Bidirectional Considerations Options: Bidirectional . whether the configuration is for homogeneous or heterogeneous synchronization. Options: Bidirectional .Configuration Transaction Log Extract Network (TCP/IP) Trail Replicat Source Target Target Source Replicat Network (TCP/IP) Extract Transaction Log Trail The top of this illustration shows changes from the left-side database being extracted and sent over the network to be replicated in the right-side database.Capabilities Available for both homogeneous and heterogeneous configurations Distributed processing Both sides are live GoldenGate’s low latency reduces the risk of conflicts GoldenGate provides loop detection Bidirectional Capabilities GoldenGate supports bidirectional replication between two databases. .

193 . Detection and Resolution Detect if an update occurred on both the source and target before the changes were applied by GoldenGate Determine business rules on how to handle collisions Sequence numbers and identity data types Truncate table operations Loops Because there are both Extract and Replicat processes operating on the same tables in bidirectional synchronization. It also may be that the target application is standing-by waiting to be used if there is a fail-over. and then User B on Database B updates that same row. both sides of the database may be live and processing application transactions at the same time. there will be a conflict on the replicated transaction. Configuring GoldenGate for bidirectional may be as straightforward as configuring a mirror set of Extract and Replicat groups moving in the opposite direction. operations are captured and queued to be synchronized back to the primary database once it becomes available. If User B’s transaction occurs before User A’s transaction is synchronized to Database B. User A on Database A updates a row. Replicat’s operations must be prevented from being sent back to the source table by Extract. It is important. For example. Conflicts Because GoldenGate is an asynchronous solution. For this.Issues Loop Detection Detect if GoldenGate or the application performed the operation Conflict Avoidance. conflict-management is required to ensure data accuracy in the event that the same row is changed in two or more databases at (or about) the same time. If they are re-extracted they will be rereplicated beginning an endless loop. Options: Bidirectional .Oracle GoldenGate Fundamentals Student Guide In a bidirectional configuration. to thoroughly discuss special considerations for your environment to guarantee data accuracy. The following slides discuss some of the bidirectional concerns as well as known issues relating to file and data types. Loop detection is sometimes called ping-pong detection. however.

and SQL Server databases using log-based extraction • Teradata databases using VAM-based extraction • SQL/MX using the checkpoint table.Loop Example 2 Or… A row is inserted on system A The insert is captured and sent to system B The row is inserted on system B The insert is captured and sent to system A The insert is attempted on system A. • Oracle. Replicat’s operations must be prevented from being sent back to the source table by Extract. However the failed insert causes the Replicat . This is accomplished by configuring Extract to ignore transactions issued by the Replicat user. DB2. Preventing looping To avoid looping. but the operation fails with a conflict on the primary key causing synchronization services to HALT Because of the constraint that the primary key must be unique. Options: Bidirectional . This slide illustrates why data looping needs to be prevented. the insert fails in this example so it does not trigger looping. this loop continues endlessly. Methods of preventing data looping are available for the following databases.Loop Example 1 The following example demonstrates the problem that occurs without loop-detection: A row is updated on system A. The update operation is captured and sent to system B The row is updated on system B The update operation is captured sent to system A The row is updated on system A Without loop-detection.Options: Bidirectional .

it looks for the parameter TRACETABLE and will use the table name as the table to use to detect if Replicat performed an operation.<table name> Oracle Trace Table Loop-detection can be accomplished by creating a table in the Oracle environment known as the trace table. When the Replicat starts up. "USERID") or @GETENV ("TRANSACTION". If GGS_TRACE does not exist. 195 . you must first login to the database using DBLOGIN.<table_name>. use the GGSCI command ADD TRACETABLE. GGSCI also provides INFO and DELETE commands for the TRACETABLE entity. and if one exists.Loop Detection Loop detection technique depends on the source database: Oracle Using EXCLUDEUSER or EXCLUDEUSERID (Oracle 10g and later) Stop capture with Extract parameter: TRANLOGOPTIONS EXCLUDEUSER <userid | username> Use @GETENV ("TRANSACTION". so it is another example of the need to recognize and not extract Replicat transactions. The Replicat process updates this table when a transaction is committed providing a mechanism Extract can use to detect that a Replicat operation. it assumes the logged-in USERID.<table name> The default <table name> is GGS_TRACE If not using the default table name. then nothing is updated. Options: Bidirectional . Replicat looks for a default table GGS_TRACE owned by the logged-in USERID. To create a table with a different table name. If <owner> is omitted. If no TRACETABLE parameter is present. it looks to see if GGS_TRACE is part of the transaction. use ADD TRACETABLE [<owner>]. add a parameter in both Extract and Replicat: TRACETABLE <owner>. If no parameter is present. To use these commands. If it exists. it will automatically update the table. it looks for a TRACETABLE parameter. updates the trace table name as every transaction is committed. The Extract process behaves in a similar manner as Replicat in that. as it is started.Oracle GoldenGate Fundamentals Student Guide to abend which stops all replication services. To create the GGS_TRACE table. "USERNAME") to retrieve the Oracle userid or username on the Replicat database Using Trace Table (Oracle 9i and earlier) Add a trace table to detect GoldenGate operations with the GGSCI command: ADD TRACETABLE <owner>.

SQL Server does not log the ggs_repl transactions written by Replicat. SQL Server By default. Then the EXCLUDEUSER argument on the TRANLOGOPTIONS parameter can be added to Extract to trigger the detection and exclusion of that User ID. NonStop SQL/MP and Enscribe sources. For other database types. you must handle loop-detection in various ways.Loop Detection (cont’d) SQL Server By default. so no loops arise. DB2 and Ingres Execute Replicat with unique User ID Stop capture with Extract parameter: TRANLOGOPTIONS EXCLUDEUSER <user id> Loop-detection operates by default for SQL Server. DB2 and Ingres Loop-detection is accomplished by identifying which identifier of the user performed the operation.Options: Bidirectional . To deploy loop-detection for DB2. Options: Bidirectional . SQL Server logging excludes the ggs_repl transactions written by Replicat. you must execute the Replicat using a User ID different than the ID of the application.Loop Detection (cont’d) Sybase Do nothing and allow Replicat to use the default transaction name ggs_repl Or identify the Replicat transaction name in the Extract parameter: TRANLOGOPTIONS EXCLUDETRANS <trans name> Or identify the Replicat user name in the Extract parameter: TRANLOGOPTIONS EXCLUDEUSER <user name> .

197 . Because there is not SQL transaction associated with a PURGEDATA operation.Loop Detection (cont’d) NonStop SQL/MX Replicat transactions identified by the name of the checkpoint table specified with TRANLOGOPTIONS option: TRANLOGOPTIONS FILTERTABLE <table> Extract ignores transactions that include this checkpoint table PURGEDATA operation is not supported Teradata You do not need to identify Replicat transactions that are applied to a Teradata database. c-tree Extract automatically identifies Replicat transactions that are applied to a c-tree database NonStop SQL/MX To prevent data loopback. they are implicit transactions.Conflict Avoidance and Detection Conflicts can be minimized by low latency Conflicts can be avoided at the application level by assuring that records are always updated on one system only GoldenGate can capture both the before and after image of updates so you can compare before applying updates You can write compare logic in a filter or user exit Conflict Detection Low latency reduces the risk of encountering a conflict where the same record is updated on both systems. so GoldenGate cannot update the checkpoint table within that transaction.Oracle GoldenGate Fundamentals Student Guide Options: Bidirectional . Options: Bidirectional . This is the best overall method that we encourage in bidirectional configurations. a checkpoint table is required in a bidirectional configuration that involves a source or target SQL/MX database (or both). Because PURGEDATA operations are DDL. this operation type is not supported for bidirectional replication.

Additional SQL procedures can be written based on your application requirements. TARGET TARGET_EXCEPT.Conflict detection can also be addressed at the application or system level by assuring that records are always updated on one system. QUERY “SELECT COUNTER FROM TARGTAB” “WHERE PKCOL = :P1”. ensure the value of COUNTER before the update occurred matches the value in the target before performing the update. FILTER (ON UPDATE. all updates to card holder (or account number) 0 – 1000000 are applied on system A. raise error 9999 The REPERROR clause for error 9999 ensures that the exceptions map to TARGET_EXCEPT will be executed . Conflict Detection Example The example above does the following when an update is encountered: Before the update filter is executed. ERRTYPE = “Conflict Detected”). BEFOREFILTER. SQLEXEC (ID CHECK. BEFORE. RAISEERROR 9999).COUNTER. For example. Options: Bidirectional . EXCEPTION MAP SRCTAB. PARAMS (P1 = PKCOL)). INSERTALLRECORDS MAP SRCTAB. EXCEPTIONSONLY. perform a query to retrieve the present value of the COUNTER column If the first filter is passed successfully. TARGET TARGTAB. GoldenGate for UNIX and Windows (only) provides the capability to capture the before and after values of columns so that comparisons may be made on the target database before applying the values. while updates to 1000001 or higher is applied on system B. ON UPDATE. If the update filter fails. COLMAP (USEDEFAULTS.Conflict Detection by Filter REPERROR 9999.COUNTER <> CHECK.

the deposit transaction is replicated to New York before the withdrawal transaction is extracted.Conflict Resolution Example Initial balance: $500 Trans A: Mr. Smith withdraws $20 in NY: balance $480 Trans A replicated to NY: balance $575 Trans B replicated to LA: balance $480 Time At end of day.Oracle GoldenGate Fundamentals Student Guide Options: Bidirectional . 199 .$20 = $555 ! The conflict When the two transactions occur at different times. But when the two transactions occur at around the same time. correct balance should be $500 + $75 .Conflict Resolution Depends on your business rules – for example: Apply the net difference instead of the after value Map the data to an exception table for manual resolution Accept or ignore the change based on date/time Options: Bidirectional . Smith deposits $75 in LA: balance=$575 Trans B: Mrs. they are applied independently. resulting in an incorrect balance on both systems.

such as to maintain a count. to ensure that the source and target sequence numbers are unique. determine order of entry. so apply net difference: Trans B end balance (480) – Trans B begin balance (500) = -20 resulting in LA end balance of $555 Time Options: Bidirectional . Smith deposits $75 in LA: end balance $575 Trans B: Mrs. Smith withdraws $20 in NY: end balance $480 Trans A replicated to NY: begin/end balance $500 / $575 Conflict detected between trans A begin balance (500) and current NY balance (480).Oracle Sequence Numbers Oracle sequence numbers are used for a variety of purposes. so apply net difference: Trans A end balance (575) – Trans A begin balance (500) = +75 resulting in NY end balance of $555 Trans B replicated to LA: begin/end balance $500 / $480 Conflict detected between trans B begin balance (500) and current LA balance (575). assign odd and even values In a multidirectional configuration.Options: Bidirectional . or generate a primary key value GoldenGate does not support the replication of sequence values in a bidirectional configuration In a bidirectional configuration.Conflict Resolution by Applying Net Differences Initial balance: $500 Trans A: Mr. each system must use a starting value and increment based on the number of systems .

Oracle GoldenGate Fundamentals Student Guide Options: Bidirectional .Sybase & SQL Server Identity Data Types Similar issues to Oracle sequences Set the seed and increment values so each system is using a different range of identity values SQL Server Identity GoldenGate has issues with the replication of identity data types if the identity is part of the key regardless of whether this is unidirectional or bidirectional.Truncate Table Operations Truncate Table operations cannot be detected for loops Make sure that GETTRUNCATES is ON for only one direction Use IGNORETRUNCATES (default) for the other direction Change database security so truncates can only be issued on one system 201 . Identity data types are used for a variety of purposes. The challenge in a bidirectional configuration is to ensure that the same identity value is not generated on both systems causing a conflict. Options: Bidirectional . One technique that addresses this issue is to create the table on each system and set the seed and increment values so that each system is using a different range of identity values. for example as a field that is part of a primary key in order to make the row unique.

Target: DDL enabled by default to maintain data integrity Replicat must be configured to ignore or filter DDL Options: DDL Replication – GoldenGate Requirements/Restrictions Identical source and target data def: ASSUMETARGETDEFS Data pumps must be configured in PASSTHRU mode WILDCARDRESOLVE must remain set to DYNAMIC (default) Data manipulation is not supported GoldenGate user exits are not supported for DDL activity Restrictions exist for DDL operations that involve user defined types and LOB data DDL on objects in TABLE or MAP statements inherit the limitations in allowed characters of those parameters Restrictions exist for DDL operations that involve stored procedures GoldenGate does not support bidirectional replication of DDL – allow DDL changes on one system only DDL statements > 2MB require special handling DDL support is only valid with log based extraction. DDL filtering.Overview Available for all Oracle versions supported by GoldenGate DML synchronization DDL in relation to DML: DDL can be active with/without DML synchronization The same Extract/Replicat should be processing both DML and DDL to avoid timing issues DDL operations are recognized differently by Extract and Replicat: Source: DDL disabled by default. Neither data nor DDL conversion is supported. tables for which DDL is being replicated must be configured in pass-through mode. Object definitions Source and target object definitions must be identical (ASSUMETARGETDEFS specified for Replicat). manipulation. and error handling is not supported by data pumps. DDL and data pumps When Extract data pumps are being used. . Extract must be configured to enable.Oracle DDL Replication Options: DDL Replication .

If DML is being replicated for a user defined type. To use the new support. Long DDL statements GoldenGate 10. This means that DDL support must be disabled for these objects. Extract must process all of those changes before DDL can be performed on the object.4 supports the capture and replication of Oracle DDL statements of up to 2 MB in length (including some internal GoldenGate maintenance information). WILDCARDRESOLVE is now set by default to DYNAMIC and must remain so for DDL support.) User exits can be used with concurrent DML processing. See the GoldenGate for Oracle Installation and Setup Guide.sql script can be used to save the skipped DDL to a text file in the USER_DUMP_DEST directory of Oracle. which removes all of the DDL history. Objects affected by a standalone SQLEXEC statement must exist before the GoldenGate processes start. User Exits GoldenGate user exit functionality is not supported for use with DDL synchronization activities (user exit logic can not be triggered based on DDL operations. but the ddl_ddl2file. Refer to the Oracle GoldenGate Reference Guide for information on this topic. Extract will skip statements that are greater than the supported length. Consequently. 203 . GoldenGate does not replicate those DML operations. and Oracle does not provide Flashback capability for DDL (except DROP). LOB data With LOB data Extract might fetch a LOB value from a Flashback Query. DDL that affects structure must happen before the SQLEXEC executes. the DDL trigger must be reinstalled in INITIALSETUP mode. When a LOB is fetched. Because UDT data might be fetched by Extract. otherwise DDL operations could change or delete the object before the SQLEXEC executes. To avoid SQL errors that would be caused by redundant operations. User defined types DDL operations that involve user defined types generate implied DML operations on both the source and target. but the LOB record in the transaction log reflects old metadata. the reasons for this rule are similar to those that apply to LOB columns SQLEXEC Objects that are affected by a stored procedure must exist with the correct structure prior to the execution of SQL. the object structure reflects current metadata.Oracle GoldenGate Fundamentals Student Guide Wildcard resolution Standard GoldenGate asterisk wildcards (*) can be used with certain parameter options when synchronizing DDL operations.

If using DDL synchronization.Oracle Requirements/Restrictions Schema names using Oracle reserved names are ignored The GETTRUNCATES parameter should not be used with full DDL support Table name cannot be longer than 16 characters plus quotation marks for ALTER TABLE RENAME ALTER TABLE. .MOVE TABLESPACE Supported when tablespace all SMALLFILE or BIGFILE Stop Extract before issuing a MOVE TABLESPACE The recycle bin must be turned off ALTER DATABASE and ALTER SYSTEM not captured Long DDL statements need special handling GETTRUNCATES GoldenGate supports the synchronization of TRUNCATEs as a standalone function (independently of full DDL synchronization) or as part of full DDL synchronization.Characteristics New names must be specified in TABLE/MAP statements Extract sends all DDL to each trail when writing to multiple trails Supported objects for Oracle clusters functions indexes packages procedures roles sequences synonyms tables tablespaces triggers types views materialized views users Renames To work around remote permissions issues that may arise when different users are being used on the source and target.Options: DDL Replication . Options: DDL Replication . Oracle only allows 18 characters for a rename because of the ANSI limit for identifiers. Table names The ALTER TABLE RENAME fails if the old or new table name is longer than 18 characters (16 for the name and two for the quotation marks). disable standalone TRUNCATE synchronization to avoid errors caused by duplicate operations. RENAME will always be converted to equivalent ALTER TABLE RENAME for Oracle..

2) CREATE USER and then move new/renamed tables into that schema Options: DDL Replication .Writes to the Marker and History table User Role: GGS_GGSUSER_ROLE . RENAME will always be converted to equivalent ALTER TABLE RENAME.Activates when there is a DDL operation . 205 . so cleanup should be specified in the Manager parameter file. New Names New names must be specified in TABLE/MAP statements in order to: 1) Replicate DML operations on tables resulting from a CREATE or RENAME.Oracle Characteristics A comment identifies each Extract/Replicat DDL statement: /* GOLDENGATE_DDL_REPLICATION */ By default Extract ignores DDL identified with this comment For Oracle.Establishes the role needed for DDL replication . 2) CREATE USER and then move new/renamed tables into that schema Options: DDL Replication .Activating Oracle DDL Capture Install database objects used for the replication of operations: DDL marker table: GGS_MARKER .Stores object metadata history DDL trigger: GGS_DDL_TRIGGER_BEFORE .Oracle GoldenGate Fundamentals Student Guide New Names New names must be specified in TABLE/MAP statements in order to: 1) Replicate DML operations on tables resulting from a CREATE or RENAME.Should be the user that executes Extract Specify schema name in GLOBALS: GGSCHEMA <schema_name> Note: These tables will grow over time.Stores DDL information DDL history table: GGS_DDL_HIST . comments in middle of an object name appear at the end of the name in the target DDL statement Renames To work around remote permissions issues that may arise when different users are being used on the source and target.

Examples are CREATE USER. SEQUENCE*. CREATE ROLE.Is specified in a TABLE or MAP statement . REVOKE* . GRANT*. ALTER. If you attempt to remove the marker table without first removing the trigger.DDL marker table The DDL Marker table only receives inserts and its rows can be periodically purged. Do not delete the DDL marker table if you plan to continue processing DDL. MATERIALIZED VIW* * Operations are only for objects with asterisk UNMAPPED . the following error will be generated: "ORA-04098: trigger 'SYS.Scope Database objects fall into categories known as scopes : MAPPED .Does not have a TABLE or MAP statement OTHER . DDL trigger DDL trigger is installed with some packages. but if it is not the default name is GGS_MARKER. Default trigger name is GGS_DDL_TRIGGER_BEFORE. Default name is GGS_DDL_HIST. INDEX. Caution must be used if purging. RENAME.DDL operations other than those listed above . The name can be set in the GLOBALS parameter file. It contains the SQL statement that was issued by the user. updates. TRIGGER.GGS_DDL_TRIGGER_BEFORE' is invalid and failed re-validation" DDL history table The DDL History table receives inserts. ALTER TABLESPACE . The marker table and the DDL trigger are interdependent.TABLE or MAP statements do not apply .Objects TABLE*.Operations CREATE. deletes. User Role Default user role name is GGS_GGSUSER_ROLE. Other supporting database objects: •Internal setup table •DUMPDDL tables (for viewing DDL history) •ddl_pin (pins tracing for performance evaluation) •sequence used for a column in the marker table Options: DDL Replication . DROP.

] Only one DDL parameter can be used in a parameter file. An EXCLUDE must be accompanied by a corresponding INCLUDE clause. such as CREATE. INSTRCOMMENTS ‘<comment_string>’] ] [. INCLUDE includes specified DDL for capture or replication. such as TABLE. 207 . UNMAPPED applies to DDL operations that are of UNMAPPED scope. When combined. OTHER applies to DDL operations that are of OTHER scope. use any DDL command that is valid for the database. Wildcards can be used. DDL EXCLUDE ALL maintains up-to-date metadata on objects. ROLE.DDL Parameter DDL parameter enables DDL support and filters the operations Valid for Extract and Replicat DDL [ {INCLUDE | EXCLUDE} [. The inclusion or exclusion clause must consist of the INCLUDE or EXCLUDE keyword followed by any valid combination of other options of the DDL parameter. MAPPED | UNMAPPED | OTHER | ALL applies INCLUDE or EXCLUDE based on the DDL operation scope. For <type>. OPTYPE <type>] [.. OBJTYPE ‘<type>’ applies INCLUDE or EXCLUDE to a specific type of database object. EXCLUDE excludes specified DDL from being captured or replicated. Provide a double-quoted string as input. but you can combine multiple inclusion and exclusion options to filter the DDL to the required level. multiple option specifications are linked logically as AND statements. TRIGGER. MAPPED applies to DDL operations that are of MAPPED scope. USER. If you do not qualify the object name for Oracle. the owner is assumed to be the GoldenGate user.Oracle GoldenGate Fundamentals Student Guide Options: DDL Replication . An EXCLUDE takes priority over any INCLUDEs that contain the same criteria. For <type>.. use any object type that is valid for the database. OBJNAME “<name>”] [. INDEX. INSTR ‘<string>’] [. OBJTYPE ‘<type>’] [. You can use multiple inclusion and exclusion clauses. Enclose the object type within single quotes. All criteria specified with multiple options must be satisfied for a DDL statement to be replicated. and RENAME. while blocking the replication of the DDL operations themselves. OPTYPE <type> applies INCLUDE or EXCLUDE to a specific type of DDL operation. ALL applies to DDL operations of all scopes. Options INCLUDE | EXCLUDE Identifies the beginning of an inclusion or exclusion clause. ALTER. MAPPED | UNMAPPED | OTHER | ALL] [. OBJNAME “<name>” applies INCLUDE or EXCLUDE to the name of an object. for example a table name.

Options: DDL Replication . For RENAME operations. INSTR ‘<string>’] [. but not within comments. For DDL that creates triggers and indexes. in single quotes ‘<replace_string>’ is the replacement string.When using OBJNAME with MAPPED in a Replicat parameter file. OPTYPE <type>] [. but not within the DDL command itself. INSTRCOMMENTS ‘<comment_string>’] ] [. Enclose the string within single quotes. not the name of the trigger or index. the value for OBJNAME must refer to the name specified with the TARGET clause of the MAP statement. the value for OBJNAME must be the new table name.. OBJNAME “<name>”] [. you can use comments as a filtering agent. the value for OBJNAME must be the name of the base object. ALL | MAPPED | UNMAPPED | OTHER] [. in single quotes <clause> is an inclusion or exclusion clause using same syntax as INCLUDE and EXCLUDE from DDL parameter DDLSUBST Clauses DDLSUBST ‘<search_string>’ WITH ‘<replace_string>’ [ {INCLUDE | EXCLUDE} [. The string search is not case sensitive.String Substitution DDLSUBST parameter substitutes strings in a DDL operation Multiple statements can be used DDLSUBST parameter syntax: DDLSUBST ‘<search_string>’ WITH ‘<replace_string>’ [INCLUDE <clause> | EXCLUDE <clause>] Where: ‘<search_string>’ is the string in the source DDL statement you want to replace. You can combine INSTR and INSTRCOMMENTS options to filter on a string in the command syntax and in the comments. OBJTYPE <type>] [.] . The string search is not case sensitive INSTRCOMMENTS ‘<comment_string>’s applies INCLUDE or EXCLUDE to DDL statements that contain a specific character string within a comment. Enclose the string within single quotes. By using INSTRCOMMENTS. INSTR ‘<string>’ applies INCLUDE or EXCLUDE to DDL statements that contain a specific character string within the command syntax itself..

DISCARD Options: DDL Replication . REMOVECOMMENTS {BEFORE | AFTER}] [. NOCROSSRENAME improves performance by eliminating processing that otherwise is required to keep track of excluded tables in case they get renamed to an included name. NOMAPDERIVED overrides any explicit MAP statements that contain the name of the derived object and prevents name mapping. REPLICATEPASSWORD | NOREPLICATEPASSWORD] MAPDERIVED | NOMAPDERIVED is valid for Replicat. NOCROSSRENAME is valid for Extract on Oracle RAC. GETREPLICATES | IGNOREREPLICATES] [. With MAPDERIVED. RESTARTSKIP <num skips>] Replicat syntax: DDLERROR {<error> | DEFAULT} {<response>} [RETRYOP MAXRETRIES <n> [RETRYDELAY <delay>]] {INCLUDE <clause> | EXCLUDE <clause>} [. DEFAULTUSERPASSWORD <password> [ENCRYPTKEY DEFAULT | ENCRYPTKEY <keyname>]] [.Oracle GoldenGate Fundamentals Student Guide Options: DDL Replication . ABEND.Error Handling DDLERROR parameter: default and specific error handling rules to handle full range of anticipated errors Extract syntax: DDLERROR [. It controls how derived Object (e. MAPDERIVED is the default. NOCROSSRENAME] [.g. if a MAP statement exists for the derived object. REPORT | NOREPORT] [. GETAPPLOPS | IGNOREAPPLOPS] [. It assumes that tables excluded from the GoldenGate configuration will not be renamed to names that are in the configuration. ADDTRANDATA] [. It controls whether or not expanded DDL processing information is written to the report file.DDLOPTIONS for Oracle DDLOPTIONS parameter configures aspects of DDL processing other than filtering and string substitution DDLOPTIONS [. The default of 209 . RESTARTCOLLISIONS | NORESTARTCOLLISIONS] Where <response> can be IGNORE. that is used. MAPDERIVED | NOMAPDERIVED] [. REPORT | NOREPORT is valid for Extract and Replicat. Otherwise. indexes) names are mapped. the name is mapped to the name specified in the TARGET clause of the MAP statement for the base object. IGNOREMISSINGTABLES | ABENDONMISSINGTABLES] [.

REMOVECOMMENTS is valid for Extract and Replicat. or have unique key added or dropped. It controls whether or not comments are removed from the DDL operation. REMOVECOMMENTS BEFORE removes comments before the DDL operation is processed by Extract or Replicat. It controls whether or not DDL operations produced by Replicat are included in the content that Extract writes to a trail or file. By default GoldenGate uses the source password in the target CREATE or ALTER statement. use NOREPLICATEPASSWORD. use the NOREPLICATEPASSWORD option of DDLOPTIONS for Extract. GETREPLICATES | IGNOREREPLICATES is valid for Extract. GETAPPLOPS | IGNOREAPPLOPS are valid for Extract. . The default is GETAPPLOPS. The password may be entered as a clear text or encrypted using the default or a user defined <keyname> from ENCKEYS. This controls whether or not DDL operations produced by business applications except Replicat are included in the content that Extract writes to a trail or file. Use ADDTRANDATA to enable supplemental logging for CREATE TABLE or update supplemental logging for tables affected by an ALTER TABLE to add or drop columns. are renames. It specifies a different password for a replicated {CREATE | ALTER} USER <name> IDENTIFIED BY <password> statement from the one used in the source statement. REPORT adds the parameters being used and a step-by-step history of the operations that were processed ADDTRANDATA is valid for Extract. The default is IGNOREREPLICATES. When using DEFAULTUSERPASSWORD. DEFAULTUSERPASSWORD is valid for Replicat. REPLICATEPASSWORD is valid for Extract. AFTER removes comments after they are used for string substitution.NOREPORT reports basic DDL statistics. By default. comments are not removed. It applies to the password in a {CREATE | ALTER} USER <user> IDENTIFIED BY <password> command. To prevent the source password from being sent to the target.

Security levels are defined by the operating system’s user groups.Oracle GoldenGate Fundamentals Student Guide Managing Oracle GoldenGate Managing Oracle GoldenGate . while restricting access to START and STOP commands to other users. you can allow certain users access to INFO and STATUS commands. For example. certain users Allowed to view reports and collect status information Excluded from stop and delete commands Establishing Command Security Command-level security can be implemented to control which users have access to which GGSCI commands. 211 .Overview Command level security Trail management Process startup and TCP/IP errors Reporting and statistics Monitoring Troubleshooting Command Level Security Managing: Command Level Security – Overview Security rules established in the CMDSEC file Controls which users have access to GGSCI commands For example.

A wildcard to specify all groups For a Windows or Unix user. For a Windows or Unix group. Each line of the CMDSEC file contains a comment or a command security entry. START. access to all GoldenGate commands is granted to all users. Comments begin with a pound sign (#). For the command security line. STOP . ADD. you create a CMDSEC file in the GoldenGate directory. May be any GGSCI command name or a wildcard. <command name> <command object> <OS group> <OS user> <YES | NO> Note: Command names and command objects are not validated for accuracy. separate each of the following components with spaces or tabs. you can specify: . you can specify: . or the word COMMENT. YES or NO USER NAME ACCESS The CMDSEC File Create the CMDSEC file in the GoldenGate subvolume as an ASCII text file. May be any GGSCI command object or a wildcard. Managing: Command Level Security . On Unix operating systems. The CMDSEC file should be created and secured by the user responsible for central administration of Extract/Replicat.A wildcard to specify all users Granted or prohibited. On Unix operating systems. REPLICAT. Such as EXTRACT. .To implement security for GoldenGate commands.A numeric user ID instead of the user name . Without this file.A numeric group ID instead of the group name .CMDSEC File Command security entries include: Entry COMMAND NAME OBJECT NAME GROUP NAME Examples Such as INFO. two hyphens (--).

belonging to group ggsgroup. However. The order of the lines that begin with STOP causes a logical error. The proper way to set up this security is to set the specific entry above the more general (reverse the order of these entries). When no explicit entry is found for a given user and command. access is allowed. The next line (beginning * for command and * for object) allows the root user to execute any command. because ggsuser is a member of the ggsgroup. Everyone else in the ggsgroup group is given explicit access by the wildcard on the following line (STATUS *). START REPLICAT is granted to the root group (group 0) and explicitly denied outside the root group. Order configuration entries from the most specific (those with no wildcards) to the least specific. Securing the CMDSEC File 213 .Sample CMDSEC File Sample CMDSEC File: #Command STATUS STATUS START START * STOP STOP * * Object REPLICAT * REPLICAT REPLICAT EXTRACT * * * * Group ggsgroup ggsgroup root * 200 ggsgroup ggsgroup root * User ggsuser * * * * * ggsuser root * Access Allowed? NO YES YES NO NO NO YES YES NO Can you see the error with the two STOP lines? How Security Rules are Resolved Security rules are processed from the top of the CMDSEC file downward.Oracle GoldenGate Fundamentals Student Guide Managing: Command Level Security . In the absence of this last line. The second rule (STOP 2) grants all STOP commands to user ggsuser. authority to commands is granted by default. The CMDSEC file in the slide illustrates implementation of command security. On the next two lines. The next line denies EXTRACT commands to anyone belonging to the group with a numeric group ID of 200. The last line explicitly restricts all users from using any command. The first entry satisfied is the one used to determine whether or not access is allowed. Any rules that were specified granting access above this line take precedence over this last entry due to ordering. even though he is supposed to have permission to issue them. The STATUS REPLICAT line explicitly restricts user ggsuser. he has been already been denied access to all STOP commands by the first rule. from the STATUS REPLICAT command. The first rule (STOP 1) denies all STOP commands to all members of group ggsgroup.

but restrict write and purge access to everyone but the administrator. use a separate disk managed by a disk process different than that of the application. Trail Management Managing: Trail Management – Overview Trail files are created by Extract Plan the initial allocation of space for the trail files Manage the ongoing number and size of the files Using size and number parameters Purging old files Managing: Trail Management – Allocation of Space Allocation of space for GoldenGate trails Initially set the number and size of the trail files based on Transaction log volume Speed of your system Maximum anticipated outage With ADD EXTTRAIL.Since the CMDSEC file is the source of security. follow these guidelines: • For trails on the source system. ADD RMTTRAIL commands Use MEGABYTES to control the maximum size Initial allocating of storage for trails To prevent trail activity from interfering with business applications. To ensure there is enough disk space for the trail files. it must be secured. In a failure reading from a trail . there should be enough space to handle data accumulation if the network connection fails. The administrator must grant read access to anyone allowed access to GGSCI.

The Manager process determines which files to purge based on Extract and Replicat processes configured on the local system. Estimate the longest time that you think the network can be unavailable. To estimate the required trail space 1. This growth factor can then be applied to the maximum down time. you can use the following rules: • Purge if all processes are finished with a file as indicated by checkpoints.4 Note: The equation uses a multiplier of 40 percent because GoldenGate estimates that only 40 percent of the data in the transaction logs is written to the trail. otherwise. to determine the growth. you can use options that are not available with the Extract or Replicat version. (This is the default. By using PURGEOLDEXTRACTS as a Manager parameter.Oracle GoldenGate Fundamentals Student Guide terminates.) • MINKEEP rules set the time or number of files to keep. such as an hour. 2. Allowing Manager to control the purging helps to ensure that no file is purged until all groups are finished with it. data will accumulate because data is extracted and transferred across the network faster than it can be applied to the target database. Use the following formula: trail disk space = <transaction log volume in 1 hour> x <number of hours down> x . To purge trail files. the rules do not take effect. The transaction logs could recycle or the audit could be offloaded. If at least one process reads a trail file. Estimate how much transaction log volume you generate in one hour. Managing: Trail Management – PURGEOLDEXTRACTS Parameter Add PURGEOLDEXTRACTS to clean up trail files In Extract or Replicat parameter file Trail files are purged as soon as the Extract/Replicat finishes processing them Do not use if more than one process uses the trail files In Manager parameter file Set MINKEEP<hours. Use the USECHECKPOINTS option. A more exact estimate can be derived by configuring Extract and allowing it to run for a set time period. but the primary Extract group reading from logs or audit data continues extracting data. 3. • For trails on the target system. 215 . It is not good practice to stop the primary Extract group to prevent further accumulation. Manager applies the specified rules. files> to define the minimums for keeping files Specify USECHECKPOINTS to trigger checking to see if local processes have finished with the trail files Specify a frequency to purge old files Best Practices: All PURGEOLDEXTRACTS rules in the Manager parameter file Manager processing for PURGEOLDEXTRACTS Use PURGEOLDEXTRACTS in a Manager parameter file to purge trail files when GoldenGate has finished processing them. days.

file will be purged unless it falls below MINKEEP rules. based on keeping a minimum of: Either one file if no MINKEEP rule is used Or the number of files specified with a MINKEEP rule.Managing: Trail Management – PURGEOLDEXTRACTS Parameter Manager evaluation process for PURGEOLDEXTRACTS: Parameter FREQUENCYMINUTES | FREQUENCYHOURS Explanation •If set. •If both MINKEEPHOURS and MINKEEPDAYS are set. MINKEEPFILES <n> Keeps at least n unmodified files. •If both a MINKEEP<hours or days> and MINKEEPFILES are set. •If processing complete. <minkeep rule>] [. <log table name> When used to maintain log files rather than trail files. according to any MINKEEP rules. specifies the log file to purge. •Checkpoints are considered unless NOUSECHECKPOINTS is set. <minkeep rule> Use only one of the following to set rules for the minimum amount of time to keep data: MINKEEPHOURS <n> Keeps an unmodified file for at least the specified number of hours. •Only one of the MINKEEP options should be set. NOUSECHECKPOINTS Allows purging without considering checkpoints. Requires a login to be specified with the USERID parameter. USECHECKPOINTS (Default) Allows purging after all Extract and Replicat processes are done with the data as indicated by checkpoints. last setting is used. including the active file. <frequency>] Arguments: <trail name>The trail to purge. MINKEEPDAYS <n> Keeps an unmodified file for at least the specified number of days. Use the fully qualified name. determines how often Manager purges old files. USECHECKPOINTS MINKEEPHOURS | MINKEEPDAYS | MINKEEPFILES Syntax: PURGEOLDEXTRACTS {<trail name> | <log table name> } [. the default is MINKEEPFILES = 1. defaults to the maintenance frequency set in the Manager CHECKMINUTES parameter (default 10). . •If not set. •If no MINKEEP rules are set. MINKEEP<hours or days> is used and MINKEEPFILES ignored. The table owner is assumed to be the one specified with the USERID parameter. USECHECKPOINTS | NOUSECHECKPOINTS] [.

There will only be two files if AA000002 is purged. The default time for Manager to process maintenance tasks is 10 minutes. USECHECKPOINTS. with which to purge old trail files. which will violate the MINKEEPFILES parameter. as specified with the CHECKMINUTES parameter. however. Replicat and Extract have completed processing. Since both MINKEEPFILES and MINKEEPHOURS have been entered. FREQUENCYHOURS <n> Sets the frequency. The Manager parameters include: PURGEOLDEXTRACTS /ggs/dirdat/AA*. Replicat has been down for four hours and has not completed processing any of the files. MINKEEPHOURS 2 Result: All trail files will be purged since the minimums have been met. The Replicat has been down for four hours and has not completed processing. Additional examples: Example 1 Trail files AA000000. Every 10 minutes. AA000001. The default purge frequency is 60 minutes. Managing: Trail Management – PURGEOLDEXTRACTS Example Manager parameter file: PURGEOLDEXTRACTS /ggs/dirdat/AA*.Oracle GoldenGate Fundamentals Student Guide <frequency> Sets the frequency with which to purge old trail files. in minutes. The result: The files have not been accessed for 4 hours so MINKEEP rule allows purging. Example 2 The following is an example of why only one of the MINKEEP options should be set. The Manager parameters include: PURGEOLDEXTRACTS /ggs/dirdat/AA*. at which to purge old trail files. AA000001. MINKEEPHOURS 4. MINKEEPFILES is 217 . in hours. AA000001. and AA000002 exist. There has been no access to the trail files for the last five hours. NOUSECHECKPOINTS. MINKEEPFILES 4 Result: USECHECKPOINTS requirements have been met so the minimum rules will be considered when deciding whether to purge AA000002. and AA000002 exist. and AA000002 exist. Trail files AA000000. <frequency> can be one of the following: FREQUENCYMINUTES <n> Sets the frequency. USECHECKPOINTS. MINKEEPHOURS 2 For example: Trail files AA000000. Manager evaluates the PURGEOLDEXTRACTS frequency and conducts the purge after the specified interval. but checkpoints indicate the files have not been processed so purge is not allowed.

which meets the MINKEEPHOURS requirement of 4 hours. The file will be purged because it has not been modified for 5 hours.ignored. Managing : Trail Management – GETPURGEOLDEXTRACTS Command GETPURGEOLDEXTRACTS SEND MANAGER option Displays the rules set with PURGEOLDEXTRACTS Syntax SEND MANAGER {CHILDSTATUS | GETPORTINFO [DETAIL] | GETPURGEOLDEXTRACTS | KILL <process name>} Managing: Trail Management – GETPURGEOLDEXTRACTS Report Example: GGSCI > SEND MANAGER GETPURGEOLDEXTRACTS PurgeOldExtracts Rules Fileset MinHours MaxHours MinFiles MaxFiles UseCP S:\GGS\DIRDAT\EXTTRAIL\P4\* 0 0 1 0 Y S:\GGS\DIRDAT\EXTTRAIL\P2\* 0 0 1 0 Y S:\GGS\DIRDAT\EXTTRAIL\P1\* 0 0 1 0 Y S:\GGS\DIRDAT\REPTRAIL\P4\* 0 0 1 0 Y S:\GGS\DIRDAT\REPTRAIL\P2\* 0 0 1 0 Y S:\GGS\DIRDAT\REPTRAIL\P1\* 0 0 1 0 Y OK Extract Trails Filename Oldest_Chkpt_Seqno IsTable IsVamTwoPhaseCommit S:\GGS\8020\DIRDAT\RT 3 0 0 S:\GGS\8020\DIRDAT\REPTRAIL\P1\RT 13 0 0 S:\GGS\8020\DIRDAT\REPTRAIL\P2\RT 13 0 0 S:\GGS\8020\DIRDAT\REPTRAIL\P4\RT 13 0 0 S:\GGS\8020\GGSLOG 735275 1 0 S:\GGS\8020\DIRDAT\EXTTRAIL\P1\ET 14 0 0 S:\GGS\8020\DIRDAT\EXTTRAIL\P2\ET 14 0 0 S:\GGS\8020\DIRDAT\EXTTRAIL\P4\ET 14 0 0 .

The syntax is: AUTOSTART <process type> <group name> <process type> is one of the following: EXTRACT. ER (Extract and Replicat) <group name> is a group name or wildcard specification for multiple groups. RETRIES <max retries>] [.Oracle GoldenGate Fundamentals Student Guide Process Startup and TCP/IP Errors Managing: Process Startup AUTOSTART AUTOSTART ER * AUTOSTART EXTRACT PROD* Do not specify any batch task groups. You can use multiple AUTORESTART statements in the same parameter file. WAITMINUTES 3. WAITMINUTES <wait minutes>] [. RETRIES 5. RESETMINUTES 90 Default maximum retries is 2 Default wait minutes is 2 Default reset minutes is 20 AUTOSTART Manager parameter used to start one or more Extract or Replicat processes when Manager starts. ER (Extract and Replicat) <group name> A group name or wildcard indicating the group names of multiple processes to start. This can be useful at system boot time. AUTORESTART Manager parameter used to specify Extract or Replicat processes to be restarted by Manager after abnormal termination. 219 . such as one-time initial load groups. Example AUTOSTART ER * Note: Be careful to not include any batch tasks. RESETMINUTES <reset minutes>] <process type> Specify one of: EXTRACT. such as initial load processes. when you want synchronization to begin immediately. REPLICAT. AUTORESTART AUTORESTART ER *. for example. You can use multiple AUTOSTART statements in the same parameter file. The syntax is: AUTORESTART <process type> <group name> [. REPLICAT.

RESETMINUTES 60 Managing: TCP/IP Errors GoldenGate automatically attempts handling of IP errors Error handling defaults are stored in tcperrs file located in the GoldenGate installation directory/folder You may customize any of these settings to fit your environment Error handling includes: Error Response (ABEND or RETRY) Delay (in centiseconds) Maximum Retries Settings for error handling Error Specifies a TCP/IP error for which you are defining a response. AUTORESTART EXTRACT *. The default is 20 minutes. After the time expires. Max Retries Controls the number of times that GoldenGate attempts to connect again before aborting. WAITMINUTES <wait minutes> is the amount of time to pause between discovering that a process has terminated abnormally and restarting the process. Response Controls whether or not GoldenGate tries to connect again after the defined error. RETRIES 3. RESETMINUTES <reset minutes> is the window of time during which retries are counted. The default is 2 retries. and it waits five minutes before each attempt. The default delay is 2 minutes. Delay Controls how long GoldenGate waits before attempting to connect again.RETRIES <max retries> is the maximum number of times that Manager should try to restart a process before aborting retry efforts. Use this option to delay restarting until a necessary resource becomes available or some other event occurs. the number of retries reverts to zero. Manager tries to start all Extract processes three times after failure within a one hour time period. Example In the following example. Valid values are either RETRY or ABEND. WAITMINUTES 5. .

REPORT View process reports and history of reports VIEW REPORT <group> VIEW REPORT <group>[n] VIEW REPORT <filename> Reports overview Each Extract. open the file in a text editor and change any of the values in the columns.Oracle GoldenGate Fundamentals Student Guide Managing: TCP/IP Errors (cont’d) Sample tcperrs file: # TCP/IP error handling parameters # Default error response is abend # Error ECONNABORTED #ECONNREFUSED ECONNREFUSED ECONNRESET ENETDOWN ENETRESET ENOBUFS ENOTCONN EPIPE ESHUTDOWN ETIMEDOUT NODYNPORTS Response RETRY ABEND RETRY RETRY RETRY RETRY RETRY RETRY RETRY RETRY RETRY ABEND Delay (csecs) 1000 0 1000 500 3000 1000 100 100 500 1000 1000 0 Max Retries 10 0 12 10 50 10 60 10 10 10 10 0 Changing TCPERRS To alter the instructions or add instructions for new errors. Replicat. and Manager process generates a standard report file that shows: parameters in use 221 . Reporting and Statistics Managing: Reporting .Overview Set up hourly or daily interval reports via parameters REPORT REPORTCOUNT REPORTROLLOVER Generate reports on demand via commands SEND [ EXTRACT | REPLICAT ] <group>.

and REPORTROLLOVER. For example.table and column mapping database information runtime messages and errors You can set up additional reports to be generated at a defined interval by using the Extract and Replicat parameters REPORT. The statistics for REPORT are carried over from the previous report.REPORTCOUNT EVERY 30 MINUTES. use the STATOPTIONS parameter with the RESETREPORTSTATS option. You can request additional reports by sending the request to running Extract and Replicat processes.REPORT AT 14:00 .REPORT ON FRIDAY AT 23:00 REPORTCOUNT . REPORTCOUNT. Syntax REPORT {AT <hh:mi> | ON <day> | AT <hh:mi> ON <day>} Where: . By default. RATE . By default.REPORTCOUNT EVERY 1000000 RECORDS .REPORTROLLOVER AT 01:00 REPORT Use REPORT to specify when Extract or Replicat generates interim runtime statistics in a process report. The statistics are added to the existing report. and the second report would show those plus the current day’s 20 million inserts. Managing: Reporting – Set up with Parameters Generate interim runtime statistics using: REPORT . and a report is generated at 3:00 each day. reports are only generated when an Extract or Replicat process is stopped. then the first report would show the first 10 million inserts. totaling 30 million. To reset the statistics when a new report is generated.REPORTCOUNT EVERY 2 HOURS REPORTROLLOVER . if the process performed 10 million inserts one day and 20 million the next. runtime statistics are displayed at the end of a run unless the process is intentionally killed.

and so forth. REPORTROLLOVER Use REPORTROLLOVER to define when the current report file is aged and a new one is created.rpt. myext2. Both options can be used together. Note Report statistics are carried over from one report to the other. use the STATOPTIONS parameter with the RESETREPORTSTATS option. RATE reports the number of operations per second and the change in rate. Using AT without ON generates a report at the specified time every day. use the SEND EXTRACT or SEND REPLICAT command with the REPORT option. REPORTCOUNT Use REPORTCOUNT to generate a count of records that have been processed since the Extract or Replicat process started. Using AT without ON generates a report at the specified time every day.rpt. To generate new runtime statistics to the report. where <group name> is the name of the Extract or Replicat group and <n> is a number that gets incremented by one whenever a new file is created.Oracle GoldenGate Fundamentals Student Guide AT <hh:mi> generates the report at a specific time of the day.rpt. Syntax REPORTROLLOVER {AT <hh:mi> | ON <day> | AT <hh:mi> ON <day>} 223 . myext1.g. Record counts can be output at scheduled intervals or after a specific number of records. Record counts are carried over from one report to the other. ON <day> generates the report on a specific day of the week. Either the AT or ON option is required. Syntax REPORTCOUNT [EVERY] <count> {RECORDS | SECONDS | MINUTES | HOURS} [. Valid values are the days of the week in text (e. This parameter does not cause new runtime statistics to be written to the report. Old reports are renamed in the format of <group name><n>. as a measurement of performance. for example: myext0. RECORDS | SECONDS | MINUTES | HOURS is the unit of measure for <count>. REPORTCOUNT can be used only once in a parameter file.rpt. Results are printed to the report file and to screen. SUNDAY). use the REPORT parameter. RATE] <count> is the interval after which to output a count. GoldenGate uses the last one. To reset the statistics in the new report. If there are multiple instances of REPORTCOUNT. To control when runtime statistics are generated to report files.

VIEW REPORT FINANCE VIEW REPORT <group>[<n>] . <n> The number of an old report. use the [<n>] option. Reports are aged whenever a process starts. and deletes output since the last report. Report files are numbered from 0 (the most recent) to 9 (the oldest). REPORT . and other diagnostic information. Syntax: REPORT [HANDLECOLLISIONS [<table spec>] ] HANDLECOLLISIONS shows tables for which HANDLECOLLISIONS has been enabled. To view old reports.rpt.VIEW REPORT /usr/ggs/reportarchives/finance999. finance1.rpt in the GoldenGate dirrpt sub-directory. . <file name> A fully qualified file name.SEND ER *. The command assumes the report file named <group>.rpt SEND REPORT Use SEND REPORT to communicate with a running process and generate an interim statistical report that includes the number of inserts. and so forth. The request is processed as soon as it is ready to accept commands from users. REPORT . VIEW REPORT Use VIEW REPORT to view the process report that is generated by Extract or Replicat.rpt. such as c:\ggs\dirrpt\orders.SEND DB2INIT. run statistics. error messages. updates. REPORT . The report lists process parameters. The command displays only the current report. Syntax VIEW REPORT {<group name>[<n>] | <file name>} <group name> The name of the group.SEND REPLICAT ACCT*. <table spec> restricts the output to a specific target table or a group of target tables specified with a standard wildcard (*).Managing: Reporting – SEND and VIEW REPORT Commands Report on demand using commands SEND [ EXTRACT | REPLICAT ] {group}. REPORT VIEW REPORT <group> . Old reports are appended with a sequence number. for example finance0.VIEW REPORT FINANCE 5 VIEW REPORT <filename> .rpt.

Overview Generate statistics on demand STATS [ EXTRACT | REPLICAT ] {group} View latest statistics STATS <group>.rpt Managing: Statistics .Oracle GoldenGate Fundamentals Student Guide Example 1 VIEW REPORT orders3 Example 2 VIEW REPORT c:\ggs\dirrpt\orders. reset statistics on report rollover) Statistics overview Extract and Replicat maintain statistics in memory during normal processing. These statistics can be viewed online with GGSCI by issuing the STATS command. 225 . or display only a brief totals only. such as to reset the counters. LATEST Display daily statistics STATS <group>. There are many options with STATS. or to provide a per-table basis statistical report. DAILY Other statistics options By table Totals only Hourly Reset statistics Report rate Report fetch statistics (Extract) Report collisions (Replicat) STATOPTIONS parameter (report fetch statistics or collisions.

<statistic>] [. TABLE <table>] [. REPORTFETCH | NOREPORTFETCH] [. DAILY. <option> TABLE {owner. REPORTRATE <time units>] [. TOTAL. DAILY Displays totals since the start of the current day. More than one statistic can be specified by separating each with a comma. for example STATS REPLICAT finance. LATEST Displays totals since the last RESET command. HOURLY Displays totals since the start of the current hour. <statistic> The statistic to be displayed.. Valid values are: TOTAL Displays totals since process startup. ] <group name> The name of a Replicat group or a wildcard (*) to specify multiple groups. . T* shows statistics for all groups whose names begin with T.Managing: Statistics – STATS Command STATS [ EXTRACT | REPLICAT ] {group} or STATS {group} STATS <group>. .. TOTALSONLY <table spec>] [.tablename} TOTALSONLY REPORTRATE REPORTFETCH | NOREPORTFETCH REPORTDETAIL | NOREPORTDETAIL (Extract only) (Replicat only) STATS Command Use STATS REPLICAT or STATS EXTRACT to display statistics for one or more groups. REPORTDETAIL | NOREPORTDETAIL] [. Syntax: STATS EXTRACT | REPLICAT <group name> or just STATS <group name> [. <statistic> TOTAL DAILY HOURLY LATEST RESET STATS <group>. RESET Resets the counters in the LATEST statistical field. TABLE <table> Displays statistics only for the specified table or a group of tables specified with a wildcard (*). For example.

DDL replication statistics (for all trails): *** Total statistics since extract started *** Operations 3. For example.Oracle GoldenGate Fundamentals Student Guide TOTALSONLY <table spec> Summarizes the statistics for the specified table or a group of tables specified with a wildcard (*).00 Total operations 216. updates. 227 . REPORTDETAIL | NOREPORTDETAIL (Replicat) Controls whether or not the output includes operations that were not replicated as the result of collision errors. These operations are reported in the regular statistics (inserts.DEPARTMENTS to JDADD. Statistics for discarded operations are not reported. The default is REPORTDETAIL.EMPLOYEES: *** Latest statistics since 2006-06-08 11:36:55 *** Total inserts 176.00 Excluded operations 0. Managing: Statistics – STATS Command Example GGSCI > STATS EXTRACT GGSEXT. <time units> valid values are HR.00 Total updates 0. REPORTFETCH Sending STATS request to EXTRACT GGSEXT. REPORTRATE <time units> Displays statistics in terms of processing rate rather than values..00 Extracting from JDADD. SEC.00 Output to . the report would indicate that there were 10 inserts and also 10 discards due to collisions.00 Total discards 0. if 10 records were insert operations and they were all ignored due to duplicate keys..00 Mapped operations 3. MIN.00 Unmapped operations 0.EMPLOYEES to JDADD. and it also resets the latest statistics. and deletes performed) plus as statistics in the detail display.00 Default operations 0.00 Total deletes 40. Start of Statistics at 2006-06-08 11:45:05. LATEST.DEPARTMENTS: *** Latest statistics since 2006-06-08 11:36:55 *** No database operations have been performed./dirdat/aa: Extracting from JDADD. STATS Command Example: The example displays total and hourly statistics per minute for a the table finance. REPORTFETCH | NOREPORTFETCH (Extract) Controls whether or not statistics about fetch operations are included in the output. The default is NOREPRTFETCH. if enabled.

For example. REPORTDETAIL | NOREPORTDETAIL] [. updates. RESETREPORTSTATS | NORESETREPORTSTATS Controls whether or not report statistics are reset when a new process report is created. REPORTFETCH returns statistics on row fetching. RESETREPORTSTATS | NORESETREPORTSTATS] REPORTDETAIL | NOREPORTDETAIL Valid for Replicat. These options also can be enabled as needed as arguments to those commands. REPORTDETAIL returns statistics on operations that were not replicated as the result of collision errors. the report would indicate that there were 10 inserts and also 10 discards due to collisions. and deletes performed) plus as statistics in the detail display. Syntax: STATOPTIONS [. NOREPORTFETCH turns off reporting of fetch statistics. These operations are reported in the regular statistics (inserts. NOREPORTDETAIL turns off reporting of collision statistics. The default is NOREPORTFETCH. The default of NORESETREPORTSTATS continues the statistics from one report . if 10 records were insert operations and they were all ignored due to duplicate keys.Managing: Statistics – STATOPTIONS Parameter REPORTDETAIL | NOREPORTDETAIL Report statistics for collisions (Replicat) REPORTFETCH | NOREPORTFETCH Report statistics on row fetching (Extract) RESETREPORTSTATS | NORESETREPORTSTATS Resets statistics when a new report file is create by the REPORTROLLOVER parameter STATOPTIONS Parameter Use STATOPTIONS to specify information to be included in statistical displays generated by the STATS EXTRACT or STATS REPLICAT command. REPORTFETCH | NOREPORTFETCH] [. The default is REPORTDETAIL. such as that triggered by a FETCHCOLS clause or fetches that must be performed when not enough information is in the transaction record. REPORTFETCH | NOREPORTFETCH Valid for Extract. if enabled.

DOWNCRITICAL. To reset statistics. UPREPORT Setting up operator log alerts when lag thresholds are exceeded LAGREPORT.Overview Setting up operator log alerts for processes stopping and starting DOWNREPORT.Oracle GoldenGate Fundamentals Student Guide to another (as the process stops and starts or as the report rolls over based on the REPORTROLLOVER parameter). LAGCRITICAL Setting up email alerts for messaging Event text in error log generates email notification Setting up email alerts for latency Use a lag alert to notify you when a process has exceeded the threshold GoldenGate provides proactive messaging for process that are not running: DOWNCRITICAL messages for failed processes DOWNREPORT reminders for failed processes GoldenGate provides proactive messaging for processes that are lagging: LAGINFO and LAGCRITICAL control warning and critical error messaging for latency thresholds that have been exceeded LAGREPORT controls the frequency of latency monitoring Director Client can be configured to send automatic email alerts to operators or email distribution groups for: LATENCY ALERTS sends emails when latency thresholds that have been exceeded MESSAGE ALERTS sends emails when any particular error message is generated LAG Charts can be displayed to show history of average latency over a period of time 229 . Monitioring Oracle GoldenGate Managing: Monitoring . use RESETREPORTSTATS. LAGINFO.

Frequency to report running processes UPREPORTHOURS 1 UPREPORTMINUTES 10 DOWNREPORT Whenever a process starts or stops. Only abended processes are reported as critical unless DOWNCRITICAL is specified. UPREPORTMINUTES and UPREPORTHOURS report on a periodic basis to ensure that you are aware of the process status.Managing: Monitoring Processes Can set Manager parameters for: DOWNREPORT . DOWNREPORTMINUTES and DOWNREPORTHOURS sets an interval for reporting on terminated processes. events are generated. . events are generated to the error log. DOWNREPORTMINUTES 30 DOWNCRITICAL Specifies that both abended processes and those that have stopped gracefully are marked as critical in the ‘down’ report. <hours> The frequency. Example The following generates a report every 30 minutes. in minutes. but those messages can easily be overlooked if the log is large. Every time one of those processes starts or stops. to report processes that are not running. in hours. UPREPORT Use UPREPORTMINUTES or UPREPORTHOURS to specify the frequency with which Manager reports Extract and Replicat processes that are running. to report processes that are not running. Those messages are easily overlooked in the error log because the log can be so large.Include abended processes in DOWNREPORT (default is not to) UPREPORT .Frequency to report down processes DOWNREPORTHOURS 1 DOWNREPORTMINUTES 15 DOWNCRITICAL . Syntax DOWNREPORTMINUTES <minutes> | DOWNREPORTHOURS <hours> <minutes> The frequency.

It is the difference in time between when a change record was processed by Extract (written to the trail) and the timestamp of that record in the data source. It is the difference in time between when a change is made to source data and when that change is reflected in the target data.Oracle GoldenGate Fundamentals Student Guide Managing: Monitoring Lag Source Database Manager Manager Target Database Replicat Primary Extract Trans Log Trail Data Pump Network (TCP/IP) Server Collector Trail Source Commit Timestamp System Time Write to Trail Extract lag Pump lag Replicat lag “end-to-end” latency Definitions: Lag This is the Extract lag or Pump lag in the diagram. 231 Target Commit Timestamp System Time Write to Trail . Latency This is the Replicat lag in the diagram.

in hours. The syntax is: LAGREPORTMINUTES <minutes> | LAGREPORTHOURS <hours> <minutes> The frequency. A value of zero (0) forces a message at the frequency specified with the LAGREPORTMINUTES or LAGREPORTHOURS parameter. otherwise. Example LAGREPORTHOURS 1 LAGINFO Manager parameter. LAGINFOSECONDS. used to specify how often to report lag information to the error log. or LAGINFOHOURS. <hours> The frequency. If the lag is greater than the value specified with the LAGCRITICAL parameter. to report lag information. The syntax is: LAGINFOSECONDS <seconds> | LAGINFOMINUTES <minutes> | LAGINFOHOURS <hours> <seconds> The frequency. to report lag information. to check for lag. <minutes> The frequency. in hours. to check for lag. LAGREPORTMINUTES or LAGREPORTHOURS. used to specify the interval at which Manager checks for Extract and Replicat lag. it reports the lag as an informational message. Manager reports the lag as critical. in seconds. Example LAGINFOHOURS 1 . in minutes. to report lag information. in minutes.Managing: Monitoring Lag (cont’d) Can set Manager parameters for: LAGREPORT Frequency to check for lags LAGREPORTMINUTES <minutes> LAGREPORTHOURS <hours> LAGINFO Frequency to report lags to the error log LAGINFOSECONDS <seconds> LAGINFOMINUTES <minutes> LAGINFOHOURS <hours> LAGCRITICAL Set lag threshold to force a warning message to the error log LAGCRITICALSECONDS <seconds> LAGCRITICALMINUTES <minutes> LAGCRITICALHOURS <hours> LAGREPORT Manager parameter. LAGINFOMINUTES. <hours> The frequency.

<minutes> Lag threshold. Setting up a System Alert 233 . Example LAGCRITICALSECONDS 60 Managing: Monitoring . The syntax is: LAGCRITICALSECONDS <seconds> | LAGCRITICALMINUTES <minutes> | LAGCRITICALHOURS <hours> <seconds> Lag threshold. If the criteria established in the Alert match. in seconds. LAGCRITICALSECONDS. or an email may be sent to one or more recipients. or LAGCRITICALHOURS. in hours. in minutes. This parameter affects Extract and Replicat processes on the local system. an audible warning can be triggered. LAGCRITICALMINUTES.Setting Email Alerts in Director Within Director. used to specify a lag threshold that is considered critical and to force a warning message to the error log when the threshold is reached.Oracle GoldenGate Fundamentals Student Guide LAGCRITICAL Manager parameter. <hours> Lag threshold. you can configure email alerts: when specific messages appear in the GoldenGate error log when a specific lag threshold has been exceeded Email Alerts Director Client can be configured to send automatic email alerts to operators or email distribution groups for: MESSAGE ALERTS sends emails when any particular error message is generated LATENCY ALERTS sends emails when latency thresholds that have been exceeded LAG Charts can be displayed to show history of average latency over a period of time What is a System Alert? A System Alert is a filter you set up in Director on event type and/or text or checkpoint lag for a particular process or group of processes.

Process Lag This alert type allows you to specify a threshold for checkpoint lag. When the desired Alert is displayed. note that some fields on the page will change. by selecting from the Select an Alert dropdown list. Process Name Type the process name to apply the criteria to. or you may make the Alert global to all instances. Enter the desired Lag Threshold here. You may use a wildcard (*) here to make partial matches. Enter the text to match. leave blank or enter '*' to match any text. depending upon what you select here.would match processes beginning with 'EXT' '*SF*' . or change an existing one. When Event Text contains This field is displayed when you select an Event Text Alert type.would match all processes with 'SF' anywhere in the name Criteria When Lag goes above This field is displayed when you select a Process Lag Alert type. When Event Type is This field is displayed when you select an Event Text Alert type. Action Send eMail to Enter a comma-separated list of email addresses . notifications will be generated. WARNING) to match here. Select the event types (ERROR. it can be anything up to 50 characters. Event Text This alert type allows you to specify event type or text. for example: '*' . Instance Name Choose a specific Manager Instance to apply the Alert criteria to. choose to enter a new Alert. if the event matches. Alert Type Choose between the following options. should lag go over the threshold.would match all process names 'EXT*' . complete the following fields: Alert Name This is a friendly name that you will use to refer to the Alert.Using the System Alert Setup page. notifications will be generated.

and Manager process generates a report file that shows: • parameters in use • table and column mapping • database information • runtime messages and error Event/Error log The error log is a file that shows: • history of GGSCI commands • processes that started and stopped • errors that occurred • informational messages 235 . Process Reports Each Extract. or see the alphabetical reference in the Oracle GoldenGate Reference Guide.Oracle GoldenGate Fundamentals Student Guide Troubleshooting Troubleshooting . For syntax. Replicat.Resources GGSCI commands to view: Processing status Events Errors Checkpoints GoldenGate reports and logs Process reports Event/Error log Discard file System logs Resources for gathering evidence GoldenGate sends processing information to several locations to help you monitor processes and troubleshoot failures and unexpected results. view the GGSCI online help by issuing the HELP command. GGSCI The GGSCI command interface provides several helpful commands for troubleshooting.

Events and Errors These commands display basic processing status. On Windows. see the Director online help. For more information about Director. Extract. working directory. or trail/extract file for Replicat. datasource. Errors appearing in the system logs also appear in the GoldenGate error log. and Replicat processes on the system INFO <group>. Director Most of the information viewed with GGSCI commands can also be viewed through Director Client and Director Web. Sample INFO DETAIL command output (some redo logs purposely omitted due to space constraints): GGSCI > INFO EXT_CTG1 DETAIL EXTRACT EXT_CTG1 ABENDED Checkpoint Lag Last Started 2005-12-16 11:10 Status 00:00:00 (updated 444:20:28 ago) . Troubleshooting – Show Status. checkpoints. DETAIL shows process status.Discard file GoldenGate creates a discard file when the DISCARDFILE parameter is used in the Extract or Replicat parameter file and the process has a problem with a record it is processing. GoldenGate’s graphical user interfaces. including: • the database error message • the trail file sequence number • the relative byte address of the record in the trail • details of the discarded record System logs GoldenGate writes errors that occur at the operating system level to the Event Viewer on Windows or the syslog on UNIX. events and errors SEND <group>. this feature must be installed. lag. STATUS shows current processing status STATS <group> shows statistics about operations processed INFO ALL shows status and lag for all Manager. The discard file contains column-level details for operations that a process could not handle. files containing processing information The data source can be transaction log or trail/extract file for Extract.

Oracle GoldenGate Fundamentals Student Guide Log Read Checkpoint File C:\ORACLE\ORADATA\ORA10G\REDO01.rpt Parameter file C:\GoldenGate\Oracle_10.LOG 2005-12-15 15:10 Not Available 2005-12-13 10:53 Not Available 2005-12-13 10:53 Seqno 0 RBA 25380 Begin 2005-12-16 05:55 2005-12-15 15:11 * Initialized * 2005-12-15 14:27 2005-12-13 10:53 * Initialized * Max 5 Current directory C:\GoldenGate\Oracle_10.10\win_ora101_v8020_019 Report file C:\GoldenGate\Oracle_10.LOG 2005-12-15 15:11 C:\ORACLE\ORADATA\ORA10G\REDO03.1.1.1. RBA 8919040 Target Extract Trails: Remote Trail Name MB C:\GoldenGate\Oracle\dirdat\g1 Extract Source End C:\ORACLE\ORADATA\ORA10G\REDO01.prm Checkpoint file C:\GoldenGate\Oracle_10.10\win_ora101_v8020_019\dirchk\EXT_CTG1 .pce Error log C:\GoldenGate\Oracle_10.1.cpe Process file C:\GoldenGate\Oracle_10.1.1.LOG 2005-12-22 23:20 C:\ORACLE\ORADATA\ORA10G\REDO03.10\win_ora101_v8020_019\ggserr.10\win_ora101_v8020_019\dirprm\EXT_CTG1 .log 237 .10\win_ora101_v8020_019\dirrpt\EXT_CTG1 .LOG 2005-12-16 05:55 C:\ORACLE\ORADATA\ORA10G\REDO03.10\win_ora101_v8020_019\dirpcs\EXT_CTG1 .LOG 2005-12-22 23:20:39 Seqno 794.

SHOWCH provides detailed checkpoint information Extract maintains the following read checkpoints: Startup – starting position in data source (transaction log or trail) Recovery – position of oldest unprocessed transaction in data source Current – position of last record read in data source and one write checkpoint: Current .log Recovery Checkpoint (position of oldest unprocessed transaction in data source): Thread #: 1 Sequence #: 47 RBA: 68748304 Timestamp: 2006-06-09 14:16:45.8439720 Redo File: /orarac/oradata/racq/redo01. RBA 65657408 Current Checkpoint Detail: Read Checkpoint #1 Oracle RAC Redo Log Startup Checkpoint (starting position in data source): Thread #: 1 Sequence #: 47 RBA: 68548112 Timestamp: 2006-06-09 13:37:51.log 2006-06-09 14:16:45 Thread 1.000000 SCN: 0. Seqno 24.current write position in trail Replicat maintains the following read checkpoints: Startup – starting position in trail Current – position of last record read in trail Example of an extract checkpoint report GGSCI> INFO EXTRACT JC108XT. Seqno 47.log . RBA 68748800 Log Read Checkpoint File /orarac/oradata/racq/redo04.Troubleshooting – Show Checkpoints INFO <group>.000000 SCN: 0.8440969 Redo File: /orarac/oradata/racq/redo01. SHOWCH Checkpoint Lag 00:00:00 (updated 00:00:01 ago) Log Read Checkpoint File /orarac/oradata/racq/redo01.log 2006-06-09 14:16:19 Thread 2.

8440613 Redo File: /orarac/oradata/racq/redo04.000000 SCN: 0.000000 SCN: 0.8439719 Redo File: /orarac/oradata/racq/redo04.000000 SCN: 0./dirdat/eh Header: Version = 2 239 .8440969 Redo File: /orarac/oradata/racq/redo01.567638 Extract Trail: .log Write Checkpoint #1 GGS Log Trail Current Checkpoint (current write position): Sequence #: 2 RBA: 2142224 Timestamp: 2006-06-09 14:16:50.log Read Checkpoint #2 Oracle RAC Redo Log Startup Checkpoint(starting position in data source): Sequence #: 24 RBA: 60607504 Timestamp: 2006-06-09 13:37:50.Oracle GoldenGate Fundamentals Student Guide Current Checkpoint (position of last record read in the data source): Thread #: 1 Sequence #: 47 RBA: 68748800 Timestamp: 2006-06-09 14:16:45.log Recovery Checkpoint (position of oldest unprocessed transaction in data source): Thread #: 2 Sequence #: 24 RBA: 65657408 Timestamp: 2006-06-09 14:16:19.000000 SCN: 0.8440613 Redo File: /orarac/oradata/racq/redo04.log Current Checkpoint (position of last record read in the data source): Thread #: 2 Sequence #: 24 RBA: 65657408 Timestamp: 2006-06-09 14:16:19.

view the Replicat report file with the VIEW REPORT <group> command or view the trail with the Logdump utility .Record Source = A Type = 6 # Input Checkpoints = 2 # Output Checkpoints = 1 File Information: Block Size = 2048 Max Blocks = 100 Record Length = 2048 Current Offset = 0 Configuration: Data Source = 3 Transaction Integrity = 1 Task Type = 0 Status: Start Time = 2006-06-09 14:15:14 Last Update Time = 2006-06-09 14:16:50 Stop Status = A Troubleshooting – Recovery Both Extract and Replicat restart after a failure at their last read checkpoint SEND EXTRACT STATUS command reports when Extract is recovering Checkpoint information is updated during the recovery stage allowing you to monitor the progress with the INFO command If an error prevents Replicat from moving forward in the trail. you can restart Replicat after the ‘bad’ transaction: START REPLICAT <group> SKIPTRANSACTION | ATCSN <csn> |AFTERCSN <csn> To determine the CSN to use.

Old reports are kept with active reports.435 5.rpt EXT_CTG4.rpt EXT_CTG1. Default location is dirrpt directory in GoldenGate home location. here is a sample of the report history: 12/15/2005 12/14/2005 12/14/2005 12/14/2005 12/13/2005 12/13/2005 12/13/2005 12/12/2005 12/12/2005 02:31 11:58 11:13 02:14 04:00 03:56 03:54 06:26 06:38 PM AM AM AM PM PM PM PM AM 5.193 5. such as invalid parameter.855 4. or database error messages.453 5.952 5.rpt Current Report next oldest 241 .rpt EXT_CTG7. Only the last ten reports are kept. and Manager has its own report file that shows: Banner with startup time Parameters in use Table and column mapping Database and Environmental information Runtime messages and errors The report provides initial clues.rpt EXT_CTG5.636 5.193 EXT_CTG.rpt EXT_CTG0. You may need to go back to them if the GoldenGate environment is large.855 5.931 5.rpt EXT_CTG3.Process Report Each Extract. data mapping errors. Old reports are numbered 0 through 9.Oracle GoldenGate Fundamentals Student Guide Troubleshooting . Replicat.rpt EXT_CTG2. The number of reports is not configurable. View with: VIEW REPORT <group> in GGSCI Director provides single click to next or previous historical reports Viewing a process report View file name with INFO <group> DETAIL in GGSCI. For a group named EXT_CTG.rpt EXT_CTG6.

For example.LOG 2005-12-29 17:55:57 Seqno 34.rpt Parameter file C:\GoldenGate802\dirprm\ORAEXT. you might discover: Someone stopped a process A process failed to make a TCP/IP or database connection A process could not open a file View with: Standard text editor or shell command GGSCI command VIEW GGSEVT Oracle GoldenGate Director The log’s name is ggserr.log file is listed with the other GoldenGate working directories. You can also locate the file using the INFO EXTRACT <group>.Event Log (ggserr. detail EXTRACT ORAEXT Last Started 2005-12-28 10:45 Status STOPPED Checkpoint Lag 00:00:00 (updated 161:55:17 ago) Log Read Checkpoint File C:\ORACLE\ORADATA\ORA920\REDO03.pce Error log C:\GoldenGate802\ggserr.Troubleshooting .prm Checkpoint file C:\GoldenGate802\dirchk\ORAEXT. DETAIL command.log . RBA 104843776 <some contents deliberately omitted> Current directory C:\GoldenGate802 Report file C:\GoldenGate802\dirrpt\ORAEXT. The location of the ggserr. as shown below: GGSCI> info extract oraext.cpe Process file C:\GoldenGate802\dirpcs\ORAEXT. located in the root GoldenGate directory.log) GoldenGate Event Log provides: History of GGSCI commands Processes that started and stopped Errors that occurred Informational messages Shows events leading to an error.log.

Created when Extract or Replicat has a problem with the record it is processing.SALES to HR.Discard File GoldenGate Discard file: Contains column-level details for operations that the process could not handle.SALES Mapping problem with compressed update record (target format).. Usually used for Replicat to log operations that could not be reconstructed or applied.. <OPTION> Options are: APPEND: adds new content to old content in an existing file PURGE: purges an existing file before writing new content MEGABYTES <n>: sets the maximum size of the file (default is 1 MB) Discard file sample Aborting transaction beginning at seqno 12 rba 231498 error at seqno 12 rba 231498 Problem replicating HR. Can help you resolve data mapping issues.Oracle GoldenGate Fundamentals Student Guide Troubleshooting .txt. and if the DISCARDFILE <filename> parameter is used in the Extract or Replicat parameter file. ORDER_ID = ORDER_QTY = 49 ORDER_DATE = 2005-10-19 14:15:20 243 . Discard file The location of the discard file is set in either the Extract or Replicat parameter file by using the DISCARDFILE parameter: DISCARDFILE C:\GoldenGate\dirrpt\discard.

Technical Support My Oracle Support Web Site Go to My Oracle Support (http:// support.com) New users must register for an account with a Customer Support Identifier (CSI) and be approved by their Customer User Administrator (CUA) The customer portal allows you to: Search Knowledge Documents on known issues Log and track a Service Requests (SR) for bugs or enhancement requests Download patches Enter ‘GoldenGate’ as the product Global Customer Care Global Customer Care is a highly available expert resource that resolves customers' business-related inquiries while capturing and sharing feedback to enhance the customer relationship Call US: 800 223 1711 Other Global Support Hot Lines are listed at: http://www.oracle.oracle.com/support/contact.html Responsibilities include but are not limited to: Access and navigation of Oracle Support websites Placing software orders Assisting with CSI questions Assisting with product or platform issues related to SR logging Locate and provide published information Create software upgrade orders .

1 .Welcome to the Oracle Advisor Webcast Program! Includes links to the Advisor Webcast page Instructions for registering and viewing both live and archived webcasts The current menu of scheduled webcasts 245 .Oracle GoldenGate Fundamentals Student Guide Oracle Advisors Webcasts A new way to receive information about your Oracle products and services Go to MetaLink Note 553747.

Master your semester with Scribd & The New York Times

Special offer for students: Only $4.99/month.

Master your semester with Scribd & The New York Times

Cancel anytime.