• hboswell (3/27/2014)


    This seems to be one area where the way I would have done this in Oracle just doesn't mesh with the SQL Server does things. I'm working on a project where I need to build a small database and then copy it to a server at the client's site. I can't connect directly, so I have to use a VPN connection and use Remote Desktop, copy the database backup from my machine to the cloud, then download it to the client machine. The project is still in the early stages, and the client is still sending me data in CSV files and Excel spreadsheets. I'm periodically needing to do a complete refresh of the database at the client. I've hacked my way through it a couple of times, but I need to know the proper way to do it. I get errors on the restore step, telling me the file is in use. Searching the web gets many what would seem to be the solution, but there's something I'm missing. I know this is one of those RTM situations, and I will, but for now, can someone tell me where I'm messing up?

    Thanks,

    Harry

    Let me see if I understand.

    Your have database A and you want to establish or refresh B with a copy of A? ... well, it depends of how remote or how they both are connected.

    If you don't have a fast connection between both, and the refresh will be sporadically, then you take a FULL database backup of A and restore on top of B. At that time, database B will have all the changes you have performed on A at that point. Any subsequent change (after your backup) will be absent from B. This method will require or disconnect users and sessions on B during the restore.

    You can also setup Tlog shipping. You need a fast connection between A and B, both need to be in FULL recovery model, and both will be in sync. Changes on A will be replicated to B.

    Here...

    http://technet.microsoft.com/en-us/library/ms186858.aspx#restoring_full_db

    ... you will find examples and explanation of RESTORE command.

    Be careful with SQL logins and SIDs though. They won't be the same and you will have to manually reset.