Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Database & SysAdmin
  3. Database
  4. Using Change Data Capture to Replicate data

Using Change Data Capture to Replicate data

Scheduled Pinned Locked Moved Database
databasesql-serveroracletutorialquestion
4 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • P Offline
    P Offline
    Pascal Ganaye
    wrote on last edited by
    #1

    I am building a reporting database that is pulling data from several source and different databases. The plan so far is to turn on change data capture on the source databases and process the log generated using SSIS. I can find a few papers and sample online on how to process the ubiquitous INSERT/UPDATE/DELETE log and it is helpful but I fail to find any good sample or tool with multiple tables. I can't see how I can process the items in the right order and keep integrity. Let's say we have a classic database with Product, Order and OrderLine. And this scenario:

    8:00 - Create a product P1
    8:01 - Create an Order O1
    8:02 - Create an Order Line L1
    8:03 - Delete the Order Line L1
    8:04 - Delete the Order O1
    8:05 - Create a new Order O1
    8:06 - Create a new Order Line L1

    The cdc tables will contain For Product

    8:00 INSERT P1

    For Order

    8:01 INSERT O1
    8:04 DELETE O1
    8:05 INSERT O1

    For Order Line

    8:02 INSERT L1 Order:O1 Product:P1
    8:03 DELETE L1
    8:06 CREATE L1 Order:O1 Product:P1

    To keep the referential integrity of the reporting database, I would need to: - insert order lines after orders - delete order lines before orders Because of this I can't really treat a CDC at a time. As I see it the only way would be to process all CDC simulataneously in datetime order. Is there ways to do that? The source databases are Oracle and MS SQL and possibly text files. The reporting database is MS SQL

    M E S 3 Replies Last reply
    0
    • P Pascal Ganaye

      I am building a reporting database that is pulling data from several source and different databases. The plan so far is to turn on change data capture on the source databases and process the log generated using SSIS. I can find a few papers and sample online on how to process the ubiquitous INSERT/UPDATE/DELETE log and it is helpful but I fail to find any good sample or tool with multiple tables. I can't see how I can process the items in the right order and keep integrity. Let's say we have a classic database with Product, Order and OrderLine. And this scenario:

      8:00 - Create a product P1
      8:01 - Create an Order O1
      8:02 - Create an Order Line L1
      8:03 - Delete the Order Line L1
      8:04 - Delete the Order O1
      8:05 - Create a new Order O1
      8:06 - Create a new Order Line L1

      The cdc tables will contain For Product

      8:00 INSERT P1

      For Order

      8:01 INSERT O1
      8:04 DELETE O1
      8:05 INSERT O1

      For Order Line

      8:02 INSERT L1 Order:O1 Product:P1
      8:03 DELETE L1
      8:06 CREATE L1 Order:O1 Product:P1

      To keep the referential integrity of the reporting database, I would need to: - insert order lines after orders - delete order lines before orders Because of this I can't really treat a CDC at a time. As I see it the only way would be to process all CDC simulataneously in datetime order. Is there ways to do that? The source databases are Oracle and MS SQL and possibly text files. The reporting database is MS SQL

      M Offline
      M Offline
      Mycroft Holmes
      wrote on last edited by
      #2

      Wow in 20+ year of writing reporting systems I have never had to consider this for of replication, imagine reading the logs! Why do normal replication tools (something else I know little about) not meet your requirements.

      Never underestimate the power of human stupidity RAH

      1 Reply Last reply
      0
      • P Pascal Ganaye

        I am building a reporting database that is pulling data from several source and different databases. The plan so far is to turn on change data capture on the source databases and process the log generated using SSIS. I can find a few papers and sample online on how to process the ubiquitous INSERT/UPDATE/DELETE log and it is helpful but I fail to find any good sample or tool with multiple tables. I can't see how I can process the items in the right order and keep integrity. Let's say we have a classic database with Product, Order and OrderLine. And this scenario:

        8:00 - Create a product P1
        8:01 - Create an Order O1
        8:02 - Create an Order Line L1
        8:03 - Delete the Order Line L1
        8:04 - Delete the Order O1
        8:05 - Create a new Order O1
        8:06 - Create a new Order Line L1

        The cdc tables will contain For Product

        8:00 INSERT P1

        For Order

        8:01 INSERT O1
        8:04 DELETE O1
        8:05 INSERT O1

        For Order Line

        8:02 INSERT L1 Order:O1 Product:P1
        8:03 DELETE L1
        8:06 CREATE L1 Order:O1 Product:P1

        To keep the referential integrity of the reporting database, I would need to: - insert order lines after orders - delete order lines before orders Because of this I can't really treat a CDC at a time. As I see it the only way would be to process all CDC simulataneously in datetime order. Is there ways to do that? The source databases are Oracle and MS SQL and possibly text files. The reporting database is MS SQL

        E Offline
        E Offline
        eusimonica
        wrote on last edited by
        #3

        hello veri nice

        http://www.hobby-zoo.ro

        1 Reply Last reply
        0
        • P Pascal Ganaye

          I am building a reporting database that is pulling data from several source and different databases. The plan so far is to turn on change data capture on the source databases and process the log generated using SSIS. I can find a few papers and sample online on how to process the ubiquitous INSERT/UPDATE/DELETE log and it is helpful but I fail to find any good sample or tool with multiple tables. I can't see how I can process the items in the right order and keep integrity. Let's say we have a classic database with Product, Order and OrderLine. And this scenario:

          8:00 - Create a product P1
          8:01 - Create an Order O1
          8:02 - Create an Order Line L1
          8:03 - Delete the Order Line L1
          8:04 - Delete the Order O1
          8:05 - Create a new Order O1
          8:06 - Create a new Order Line L1

          The cdc tables will contain For Product

          8:00 INSERT P1

          For Order

          8:01 INSERT O1
          8:04 DELETE O1
          8:05 INSERT O1

          For Order Line

          8:02 INSERT L1 Order:O1 Product:P1
          8:03 DELETE L1
          8:06 CREATE L1 Order:O1 Product:P1

          To keep the referential integrity of the reporting database, I would need to: - insert order lines after orders - delete order lines before orders Because of this I can't really treat a CDC at a time. As I see it the only way would be to process all CDC simulataneously in datetime order. Is there ways to do that? The source databases are Oracle and MS SQL and possibly text files. The reporting database is MS SQL

          S Offline
          S Offline
          shreekar
          wrote on last edited by
          #4

          One idea could be do to disable all relations/checks/constraints on the report tables, execute CDC statements and then re enable relations/checks/constraints. Your execution should handle errors nicely though for this to work.

          Shreekar

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups