Schema changes & data migration on large tables

  • Apologies if someone has already posted a similar scenario, I did do some searching before writing this post but found nothing.

    Scenario

    We need to clone a table within the same database with some small schema changes with little, or preferably no down-time. This table is a billion rows and 200gb in size and is high-traffic (reads and writes). As soon as the new table is in sync with the old table we want to switch over to it (with the possibility of rolling back to the old table with slight data-loss should any consuming code fail).

    Possible Solution

    I was thinking we might be able to use transactional replication, but from what I understand you can't have the publisher and a subscriber in the same database? Can you get around this by replicating twice ? (i.e. to another server and then back again)

    Any sort of "join old table to new table and merge rows" type approach just takes too long and is a non-starter.

    Any pointers would be much appreciated,

    Alex.

  • Just to add I figured out it was pretty easy to have the Publisher and Subscriber in the same database, you just can't do it via the SSMS wizard. Obviously I would have to initialize the replication from a backup as opposed to from a snapshot, but it looks like this should work?

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply