Validate the replicated database

  • Hi room,

    I am newbie DBA!!!   Just completed replication from Server A to Server B.

    Server A is running SQL Server 2005 and Server B is running SQL Servr 2000.

    The snapshoot is running successully to pull or copy database from Server B.

    Questions:

    • I need to validate my Server A database is exactly identical from Server B database.   How can I do that?

    Please helps!!!  

    Thank youuuuuuuuuuuuuu.

    Edwin

  • There are a number of methods you could use to do this.

    1. The simple and quick way is to right click on the publication and select the "Validate Subscriptions..." option.

    2. Another way is to manually query and count the number of records in tables to make sure that they are the same.  The only problem with this method is depending on the amount of activity your going to have to be very fast as a record could be inserted into the publisher database and by the time you run the same query on the subscriber database it may or may not have been commited by replication.

    Example:

    SELECT COUNT(*) FROM PublisherTable WITH(NOLOCK)

    SELECT COUNT(*) FROM SubscriberTable WITH(NOLOCK)

  • Snapshot replication is snapshot at a single point so when it runs it will populate the all data it got in snapshot or it will fail...

    Check BOL topic "Validating Replicated Data"

    MohammedU
    Microsoft SQL Server MVP

  • He didn't state which replication model he was using.  He could be doing transactional which uses a snapshot.  If he is doing transactional just because the snapshot succeeded doesn’t mean replication is in synch or working correctly.

    Either way it doesn’t matter which model he is using.  The easiest way is to use the "Validate" method from with in the Replication Monitor.

  • I was under the impression that he is using snapshot...

    Thanks...

    MohammedU
    Microsoft SQL Server MVP

  • Hi room,

    Thank you for your responses.  I am setup Transactional Replication using snapshoot.

    Thank youuuuuuuuuu

  • How to: Validate Data at the Subscriber (Replication Transact-SQL Programming) 

    http://msdn2.microsoft.com/en-us/library/ms147366.aspx

     

    MohammedU
    Microsoft SQL Server MVP

  • any database compare tool will do the job, SQL Compare, Kentico sql compare , dbghost etc.

    In certain circumstances the database schema will not be identical, depends upon the source of course and what options you defined during replciation.

    [font="Comic Sans MS"]The GrumpyOldDBA[/font]
    www.grumpyolddba.co.uk
    http://sqlblogcasts.com/blogs/grumpyolddba/

Viewing 8 posts - 1 through 7 (of 7 total)

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