Difference between Log shipping and DB mirroring

  • From SQL2K BOL "Transaction Log Backups", I find advice not to recover the database to operational until all transaction logs have been applied...

    ... For example, a series of transaction log backups contain a long-running transaction. The start of the transaction is recorded in the first transaction log backup, but the end of the transaction is recorded in the second transaction log backup. There is no record of a commit or rollback operation in the first transaction log backup. Therefore, if a recovery operation runs when the first transaction log backup is applied, the long-running transaction is treated as incomplete. Data modifications recorded in the first transaction log backup for the transaction are rolled back

    which seems to support your point, and your test.

    The confusion may arise from what happens to the transaction log itself, where the inactive part of the log - committed transactions - is the bit that becomes available for use again. But it's not, apparently, the only bit that gets backed up.

    Thanks for making me think about this!

  • The example you gave supports you. will give it a try on monday to see the results(just to 'see' it with own eyes ). But definately clarifies my doubts.

    🙂



    Pradeep Singh

  • Adi Cohn (12/16/2008)


    you'll have to bring it online by running the last restore with recovery option.

    or just issue a

    restore database [mydatabase] with recovery

    -----------------------------------------------------------------------------------------------------------

    "Ya can't make an omelette without breaking just a few eggs" 😉

  • I will list some of the differences between Log Shipping and Database Mirroring which has not been discussed yet,

    Log Shipping :

    1. Not a high availability solution

    1. Database can be in Full or Bulk Logged recovery model.

    2. SQL Server Agent is primary responsible for all Log shipping, so SQL Server Agent services should be running

    3. Database on Secondary server can be either in Restoring mode or Read only mode.

    4. Need not take backup's of Log file separately as transactional log backups are already included in Log Shipping.

    5. After transactional log backup Non-Active transaction are deleted from log file automatically.

    6. Need shared folders on Operating system to configure log shipping.

    Database Mirroring :

    1. High availability solution

    1. Database has to be only in Full recovery mode.

    2. Database mirroring is done through TCP-IP so SQL Server Agent Service need not be running.

    3. Database mirroring can be set up on database whose compatibility 80 (2000) running on SQL Server 2005.

    4. Databse Mirroring will not work if SQL Server is configured to use only Named Pipes. SQL Server should also use or only use TCP-IP

    5. Partner ( Secondary server ) database will only be in Restoring mode. But we can take database snapshot regularly to check if data is being mirrored and these database snapshots can be used as read only database, data will not be refreshed in this database snapshot.

    6. You have to schedule transactional log backup's for databases as a separate task, as this is not included in database mirroring.

    7. Log file is not truncated after transactional log backup, to truncate log file you need to stop database mirroring set up and then manually truncate log file and then re set up database mirroring.

    8. We don't need any shared folder on operating system to set up database mirroring.

    9. If you have two SQL Servers (A as Principal and B as Mirroring) and you want to set up high availability solution, you can install third SQL Server ( Express edition , Free of cost ) and make this server as your witness server.

    Regards

    IM.

  • Thanks to all of you. Great forum. NOt only cleared my knowledge on Log shipping but also on Mirroring.

    Wish you all a very happy new Year.

    Cheers,

    Got an idea..share it !!

    DBA_Vishal

  • Well i'm already addicted to this forum. hardly 3 weeks here and yet i've learnt so much!! There is no end of learnings here. One doesn't need to go anywhere else to learn sql server. The articles/scripts/forums contain in-depth analysis/solution of various topics that even good books miss out on.



    Pradeep Singh

  • Hi,

    This will answer to all your questions :

    http://www.microsoft.com/technet/prodtechnol/sql/2005/dbmirror.mspx

    scroll all the way down to know the difference between

    1. Database Mirroring and Log Shipping

    2. Database Mirroring and Transactional Replication

    3. Database Mirroring and Clustering

    Hope this may help u ....

    Enjoy u r holidays ....

    \\K 🙂

    ______________________________________________________________________________________________________________________________________________________________________________________
    HTH !
    Kin
    MCTS : 2005, 2008
    Active SQL Server Community Contributor 🙂

  • Pls find attachment..

    _____________________________________________________________________________________________________________
    Paresh Prajapati
    ➡ +919924626601
    http://paresh-sqldba.blogspot.com/[/url]
    LinkedIn | Tweet Me | FaceBook | Brijj

Viewing 8 posts - 16 through 24 (of 24 total)

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