Table of Contents

Search

  1. Preface
  2. Data Replication Overview
  3. Understanding Data Replication
  4. Sources - Preparation and Replication Considerations
  5. Targets - Preparation and Replication Considerations
  6. Starting the Server Manager
  7. Getting Started with the Data Replication Console
  8. Defining and Managing Server Manager Main Servers and Subservers
  9. Creating and Managing User Accounts
  10. Creating and Managing Connections
  11. Creating Replication Configurations
  12. Materializing Targets with InitialSync
  13. Scheduling and Running Replication Tasks
  14. Implementing Advanced Replication Topologies
  15. Monitoring Data Replication
  16. Managing Replication Configurations
  17. Handling Replication Environment Changes and Failures
  18. Troubleshooting
  19. Data Replication Files and Subdirectories
  20. Data Replication Runtime Parameters
  21. Command Line Parameters for Data Replication Components
  22. Updating Configurations in the Replication Configuration CLI
  23. DDL Statements for Manually Creating Recovery Tables
  24. Sample Scripts for Enabling or Disabling SQL Server Change Data Capture
  25. Glossary

Data Visibility Across Multiple Applier Threads

Data Visibility Across Multiple Applier Threads

Applier thread 1 runs post-apply SQL statements or stored procedures before the main Applier thread commits the data across all of the Applier threads. Consequently, Applier thread 1 can process only the data that was committed during previous apply cycles and the change data that Applier thread 1 applied to the target during the current apply cycle. Applier thread 1 cannot process change data that other Applier threads applied to the target during the current apply cycle.
Some target databases provide mechanisms for reading uncommitted data that was loaded by multiple threads.
For Teradata targets, you can use the LOCK TABLE FOR ACCESS clause to ensure that the post-apply SQL statements or stored procedures process change data that other Applier threads applied to the target during the current apply cycle.
The LOCK TABLE clause is a part of the DML SQL command. It is not a separate statement.
The following SQL statement inserts the total number of records in the tgt_db1.tgt_tab target table and the current timestamp into the tgt_db1.stat table:
LOCK TABLE tgt_db1.tgt_tab FOR ACCESS INSERT INTO tgt_db1.stat(COUNTER,LOAD_TIME) SELECT count(*), current_timestamp(0) from tgt_db1.tgt_tab;
The total number of records includes the change data that was loaded to this table by all of the Applier threads during the current apply cycle even though this data is not committed yet.

0 COMMENTS

We’d like to hear from you!