SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Quick and Dirty DR Solution Using Robocopy


Quick and Dirty DR Solution Using Robocopy

Author
Message
thecosmictrickster@gmail.com
thecosmictrickster@gmail.com
Hall of Fame
Hall of Fame (3.7K reputation)Hall of Fame (3.7K reputation)Hall of Fame (3.7K reputation)Hall of Fame (3.7K reputation)Hall of Fame (3.7K reputation)Hall of Fame (3.7K reputation)Hall of Fame (3.7K reputation)Hall of Fame (3.7K reputation)

Group: General Forum Members
Points: 3718 Visits: 939
Comments posted to this topic are about the item Quick and Dirty DR Solution Using Robocopy



Scott Duncan

MARCUS. Why dost thou laugh? It fits not with this hour.
TITUS. Why, I have not another tear to shed;
--Titus Andronicus, William Shakespeare

rob-732484
rob-732484
Forum Newbie
Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)

Group: General Forum Members
Points: 6 Visits: 2
On top of using RoboCopy, use RoboCopyPlus, which will let you email job results with condensed logfile, and inserts entries in the windows eventlog with job result error levels.
See www.robocopyplus.com
Sean Elliott (UK)
Sean Elliott (UK)
SSC-Enthusiastic
SSC-Enthusiastic (150 reputation)SSC-Enthusiastic (150 reputation)SSC-Enthusiastic (150 reputation)SSC-Enthusiastic (150 reputation)SSC-Enthusiastic (150 reputation)SSC-Enthusiastic (150 reputation)SSC-Enthusiastic (150 reputation)SSC-Enthusiastic (150 reputation)

Group: General Forum Members
Points: 150 Visits: 181
Be aware that using the /z switch (restartable mode) for Robocopy slows it down massively cant tell you how much but something like half speed. You are better off not using /z in general and just recopying the whole file again in the rare event it fails part way through.

I have just been doing something identical to this but I found Robocopy to be far too slow for large files ie > 20GB. It also seems to cause file corruption (silently) somewhere in the range 30GB to 70GB. I can copy 30GB files but not 70GB files. You can prove that a file is identical (or not) easily using the Microsoft utility called FCIV which creates a hash value for a file:

http://www.microsoft.com/download/en/details.aspx?displaylang=en&id=11533

There is a much quicker way to copy very large files using a Microsoft utility called ESEUTIL. I have just spent my entire weekend migrating 280GB of backup files across a network using this. It runs much faster than robocopy and does not corrupt the files.

Don’t believe me about ESEUTIL? See this for evidence that using ESEUTIL is a sensible thing to do (bottom of page post by Jacob Luebbers Posted 5/22/2008 2:05 AM:

http://www.sqlservercentral.com/Forums/Topic495042-357-1.aspx

(also see the other posts he refers to – I have seen other posts on same topic too)
Iulian -207023
Iulian -207023
SSCommitted
SSCommitted (1.5K reputation)SSCommitted (1.5K reputation)SSCommitted (1.5K reputation)SSCommitted (1.5K reputation)SSCommitted (1.5K reputation)SSCommitted (1.5K reputation)SSCommitted (1.5K reputation)SSCommitted (1.5K reputation)

Group: General Forum Members
Points: 1507 Visits: 1245
That is a nice, thank you.

I am using something simmilar but through windows tasks.

Iulian
Kendal Van Dyke
Kendal Van Dyke
Say Hey Kid
Say Hey Kid (702 reputation)Say Hey Kid (702 reputation)Say Hey Kid (702 reputation)Say Hey Kid (702 reputation)Say Hey Kid (702 reputation)Say Hey Kid (702 reputation)Say Hey Kid (702 reputation)Say Hey Kid (702 reputation)

Group: General Forum Members
Points: 702 Visits: 983
Be careful with using Robocopy on large files - it uses buffered IO functions in the Windows API which can lead to massive paging and negatively impact SQL Server performance.

These two blog posts explain buffered vs. unbuffered IO in greater detail:

http://blogs.msdn.com/b/granth/archive/2010/05/10/how-to-copy-very-large-files-across-a-slow-or-unreliable-network.aspx
http://blogs.technet.com/b/askperf/archive/2007/05/08/slow-large-file-copy-issues.aspx

The articles also talk about other tools which copy files using unbuffered IO as an alternative to robocopy.

Kendal Van Dyke
http://kendalvandyke.blogspot.com/
thecosmictrickster@gmail.com
thecosmictrickster@gmail.com
Hall of Fame
Hall of Fame (3.7K reputation)Hall of Fame (3.7K reputation)Hall of Fame (3.7K reputation)Hall of Fame (3.7K reputation)Hall of Fame (3.7K reputation)Hall of Fame (3.7K reputation)Hall of Fame (3.7K reputation)Hall of Fame (3.7K reputation)

Group: General Forum Members
Points: 3718 Visits: 939
Sean Elliott (UK) (11/7/2011)
Be aware that using the /z switch (restartable mode) for Robocopy slows it down massively cant tell you how much but something like half speed. You are better off not using /z in general and just recopying the whole file again in the rare event it fails part way through.

I have just been doing something identical to this but I found Robocopy to be far too slow for large files ie > 20GB. It also seems to cause file corruption (silently) somewhere in the range 30GB to 70GB. I can copy 30GB files but not 70GB files. You can prove that a file is identical (or not) easily using the Microsoft utility called FCIV which creates a hash value for a file:

http://www.microsoft.com/download/en/details.aspx?displaylang=en&id=11533

There is a much quicker way to copy very large files using a Microsoft utility called ESEUTIL. I have just spent my entire weekend migrating 280GB of backup files across a network using this. It runs much faster than robocopy and does not corrupt the files.

Don’t believe me about ESEUTIL? See this for evidence that using ESEUTIL is a sensible thing to do (bottom of page post by Jacob Luebbers Posted 5/22/2008 2:05 AM:

http://www.sqlservercentral.com/Forums/Topic495042-357-1.aspx

(also see the other posts he refers to – I have seen other posts on same topic too)


I've heard about ESEUTIL but never been able to get my hands on a copy to try it out.



Scott Duncan

MARCUS. Why dost thou laugh? It fits not with this hour.
TITUS. Why, I have not another tear to shed;
--Titus Andronicus, William Shakespeare

mstjean
mstjean
Mr or Mrs. 500
Mr or Mrs. 500 (563 reputation)Mr or Mrs. 500 (563 reputation)Mr or Mrs. 500 (563 reputation)Mr or Mrs. 500 (563 reputation)Mr or Mrs. 500 (563 reputation)Mr or Mrs. 500 (563 reputation)Mr or Mrs. 500 (563 reputation)Mr or Mrs. 500 (563 reputation)

Group: General Forum Members
Points: 563 Visits: 2546
I thought RichCopy replaced RoboCopy as the copy utility of choice. Or am I comparing apples and oranges?


Cursors are useful if you don't know SQL
Sean Elliott (UK)
Sean Elliott (UK)
SSC-Enthusiastic
SSC-Enthusiastic (150 reputation)SSC-Enthusiastic (150 reputation)SSC-Enthusiastic (150 reputation)SSC-Enthusiastic (150 reputation)SSC-Enthusiastic (150 reputation)SSC-Enthusiastic (150 reputation)SSC-Enthusiastic (150 reputation)SSC-Enthusiastic (150 reputation)

Group: General Forum Members
Points: 150 Visits: 181
You can get eseutil from the web if you look via google "eseutil download". It's installed with MS Exchange but all you need is 2 files eseutil.exe and eseutil.dll and they are small.
If you are on W2k8 you can use xcopy with the new /j flag which does the same type of unbuffered copying apparently. I'm not on w2k8.
czagatti
czagatti
Grasshopper
Grasshopper (15 reputation)Grasshopper (15 reputation)Grasshopper (15 reputation)Grasshopper (15 reputation)Grasshopper (15 reputation)Grasshopper (15 reputation)Grasshopper (15 reputation)Grasshopper (15 reputation)

Group: General Forum Members
Points: 15 Visits: 37
Guys,

Considering an online database, with users transactioning on it, is this procedure able to create a copy of the database that I can use on another server?

For instance, if server1 crashes and I try to attach the copy on server2 using the file I've synced this way, is this going to work?

Regards
Sean Elliott (UK)
Sean Elliott (UK)
SSC-Enthusiastic
SSC-Enthusiastic (150 reputation)SSC-Enthusiastic (150 reputation)SSC-Enthusiastic (150 reputation)SSC-Enthusiastic (150 reputation)SSC-Enthusiastic (150 reputation)SSC-Enthusiastic (150 reputation)SSC-Enthusiastic (150 reputation)SSC-Enthusiastic (150 reputation)

Group: General Forum Members
Points: 150 Visits: 181
Yes the copy will work OK so long as server1 and server2 are both not using the mdf and ldf files whilst they are copying over.

Note that mdf and ldf files are many times larger than a backup especially if backup compression is used. You would be advised to zip (ie compress) the files before copying them across the network.

It might be the case that server2 will already need to have previously had the same database online so that it already knows which ndf and ldf to use. Recovery might not happen when attaching databases (I could be wrong). Recovery will definitly work if SQL is started with the right files in the right place ie as it has previously known.

Try it.
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search