Click here to monitor SSC
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
Iulian -207023
Iulian -207023
Ten Centuries
Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)

Group: General Forum Members
Points: 1198 Visits: 1226
It copies the backup files not the .mdf or .ldf , moeover the article explains some params of the roocopy so that it will retry a few times to copy the backup files.

Once the backup files copied in the second location you should be able to restore the database.

This tool looks to me more as an"quick and dirty" :-) extension of the backup so that it also push the database to another location.

Maybe what you are looking for is mirroring, replication, failover clustering, etc.

Regards,
Iulian
czagatti
czagatti
Forum Newbie
Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)

Group: General Forum Members
Points: 3 Visits: 37
I couldnt agree more Smile
jswong05
jswong05
Valued Member
Valued Member (65 reputation)Valued Member (65 reputation)Valued Member (65 reputation)Valued Member (65 reputation)Valued Member (65 reputation)Valued Member (65 reputation)Valued Member (65 reputation)Valued Member (65 reputation)

Group: General Forum Members
Points: 65 Visits: 476
You should always run Robocopy from the standby host (the secondary) to copy from primary to secondary. This way the Robocopy uses secondary host resources and only reads the backup files from primary host.

If you have money to spend, you can use double-take. It copies at data-block level.

Jason
http://usa.redirectme.net/

Jason
http://dbace.us
:-P
Sean Elliott (UK)
Sean Elliott (UK)
Valued Member
Valued Member (68 reputation)Valued Member (68 reputation)Valued Member (68 reputation)Valued Member (68 reputation)Valued Member (68 reputation)Valued Member (68 reputation)Valued Member (68 reputation)Valued Member (68 reputation)

Group: General Forum Members
Points: 68 Visits: 181
yes this article is about copying backup files but you can copy mdf and ldf from one server to another and then attach them.
timo-947179
timo-947179
SSC Rookie
SSC Rookie (32 reputation)SSC Rookie (32 reputation)SSC Rookie (32 reputation)SSC Rookie (32 reputation)SSC Rookie (32 reputation)SSC Rookie (32 reputation)SSC Rookie (32 reputation)SSC Rookie (32 reputation)

Group: General Forum Members
Points: 32 Visits: 89
Great tip!
One change is needed in my opinion though:


SET /A ERRLEV = "(%ERRLEV1% & %ERRLEV2%) & 24"


Should be "(%ERRLEV1% | %ERRLEV2%) & 24"
(untested)

Otherwise you'll miss error code(s) in cases when e.g.
ERRLEV1=8 and ERRLEV2=16
or
ERRLEV1=24 and ERRLEV2=0


Edit:
Hope this example illustrates my point:

select (8 & 16) & 24 as errorcode_lost

select (8 | 16) & 24 as errorcode_active
select (0 | 16) & 24 as errorcode_active
select (8 | 8) & 24 as errorcode_active

select (5 | 6) & 24 as no_errorcode
select (0 | 0) & 24 as no_errorcode


grbihno
grbihno
Grasshopper
Grasshopper (20 reputation)Grasshopper (20 reputation)Grasshopper (20 reputation)Grasshopper (20 reputation)Grasshopper (20 reputation)Grasshopper (20 reputation)Grasshopper (20 reputation)Grasshopper (20 reputation)

Group: General Forum Members
Points: 20 Visits: 123
Hi,

Regarding the /Z switch. Not only does it slow down the copy process, it can lead to unresponsive SQL Server. As it happens. There is a bug of some sort with this combination: robocopy with /Z switch inside SQL Agent Job on Windows Server 2003 x64 and SQL Server 2005 x64. When connection was lost between server and destination location, Windows started to aggressively trim SQL Server memory. Server started to page, and slowed down to the point of unusability. SQL Server was not configured with Lock Pages in Memory privilege.

You can test this out by disabling network card on your destination location.
sethgray
sethgray
Forum Newbie
Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)

Group: General Forum Members
Points: 1 Visits: 78
This is late to the party, but for the permanent record, the experience with /Z switch is unlikely the source of the problem. Robocopy simply doesn't do unbuffered IO. In my experience on win2k3 you'll get that aggressive trim behavior from any kind of copy operation that does it buffered when the file is read into memory.

Only two options for win2k3 that I've found, use unbuffered IO utility (such as eseutil) to push the file from the SQL box to the destination box) or enable Lock Pages In Memory for the SQL process (that's a commonly suggested setting for x64 SQL on Win2k3 (but not win2k8)).

I have not experienced the same memory issue on windows 2k8 when copying, but I have limited real life experience since production env is 2k3.

ESEUTIL or RICHCOPY can both do unbuffered pushes (network pulls are always handled by win2k3 as buffered operations)



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

Group: General Forum Members
Points: 2 Visits: 2
We use RoboCopy with an add-on utility called RoboCopyPlus (www.robocopyplus.com). It wraps around RoboCopy and not only analyzes the result, based on exit code, but also compresses the logfiles to see only exceptions, and then emails them off to us depending on the result, with the compressed logfiles attached.
Plus, it generates eeventlogentries based on the copy-job result, so you can integrate the lot into a management system.
Makes the whole thing a LOT easier for us to manage and therefore much more useful and stable.
hremipl7
hremipl7
Forum Newbie
Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)

Group: General Forum Members
Points: 1 Visits: 0
Long Path Tool can simplify and probably end your problems in unlocking, managing and renaming files that appear to have a long filename.
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