Can I clone a database across servers?

  • Hi all,

    I have a database that resides on server A and I need to create its clone on server B. I am using DBCC clonedatabase command. I have a linked server from B to A. And I can create an opposite linked server too, from A to B.

    Is it possible, and if yes, how?

    Thanks

     

     

  • I'm not sure that will work.  The CloseDatabase command takes source_database_name and target_database_name as parameters, so it creates a read-only copy on the same server.

    For better, quicker answers, click on the following...
    http://www.sqlservercentral.com/articles/Best+Practices/61537/

    For better answers on performance questions, click on the following...
    http://www.sqlservercentral.com/articles/SQLServerCentral/66909/

  • DBCC CLONEDATABASE is not multi server, it copies it to the same server so won’t meet your requirements.

    Automate a backup restore operation using the traditional backup routines or use bacpac etc to do it or powershell.

    I would strongly recommend getting the DBATools powershell module for this and using the cmdlets in that, DBATools makes life so much easier these days.

  • What is the purpose of this secondary copy of the database?  There are several options available - depending on what you intend to do with that copy.

    Jeffrey Williams
    “We are all faced with a series of great opportunities brilliantly disguised as impossible situations.”

    ― Charles R. Swindoll

    How to post questions to get better answers faster
    Managing Transaction Logs

  • If both databases live on the same SAN, checkout the documentation for the SAN... it may have the ability to do a "SAN Snapshot", which is incredibly fast and doesn't have to live on the same server... just the same SAN.

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

Viewing 5 posts - 1 through 4 (of 4 total)

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