Quick and Dirty DR Solution Using Robocopy

  • 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.

  • 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)

  • 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.

  • Long Path Tool can simplify and probably end your problems in unlocking, managing and renaming files that appear to have a long filename.

  • Hi All,

    I have a basic robocopy cmd that copies new files with text changes within the .txt / .doc / .asp / .asa .dll files and many more filetypes to the destination folder

    i now want to be able to only copy the changed files (all file types) to a folder, so then i can copy this to another location.

    An example below;

    COMPARE FOLDER 1 with FOLDER 2 -------> OUTPUT changed files/folders to Folder 3

    the script i have below for comparing folder 1 and 2 file type changes, just the folder 3 part

    thank you in advance, and i can try provide as much detail as you need

    C:\Program Files (x86)\Windows Resource Kits\Tools>robocopy "E:\Test1" "E:\Test2" /MIR /E /COPYALL /V /NP /LOG:"e:\test.txt" /R:3 /W:30

    Log File : e:\test.txt

  • There are too many things to take into consideration while working with robocopy and in this fast worl who has the time for all this. I just paid a few bucks for a commercial software and it handled all for me. I used GS Richcopy 360 which helped me through the whole process. Simple to use even for a non-IT guy who is not good in solving errors. Haha!

  • barettojames99 - Tuesday, December 12, 2017 9:50 AM

    There are too many things to take into consideration while working with robocopy and in this fast worl who has the time for all this. I just paid a few bucks for a commercial software and it handled all for me. I used GS Richcopy 360 which helped me through the whole process. Simple to use even for a non-IT guy who is not good in solving errors. Haha!

    Have you tried a DR restore from that yet?

    --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)

  • A few months back, I was migrating about 4 TB of databases from a datacenter in Atlanta to New Jersey. Across a 1 GigaBit / sec network connection, there were times when I'd see throughput of only 5 - 20 MB / sec using ROBOCOPY or Windows Explorer drag/drop. The drag/drop method actually seemed to be consistently faster than ROBOCOPY.
    If it were entirely up to me, I'd rather have backed up the databases to removable USB 3.0 drives transferred them via sneakernet/coach or maybe FedEx them to NJ. I'm not a networking or infrastructure guy, and this was probably a one-off event, but I invite anyone to educate me on a better method of doing this if you were in a similar situation.

    "Do not seek to follow in the footsteps of the wise. Instead, seek what they sought." - Matsuo Basho

  • The main problem with Robocopy is that it crashes in between which leads to missing files. And who wants that? So I had to uninstall it. My friend suggested me to use GS Richcopy 360, this software helped me a lot in overcoming the problems which I faced earlier. The transfer speed is unmatched.

  • Eric M Russell - Thursday, December 14, 2017 12:12 PM

    A few months back, I was migrating about 4 TB of databases from a datacenter in Atlanta to New Jersey. Across a 1 GigaBit / sec network connection, there were times when I'd see throughput of only 5 - 20 MB / sec using ROBOCOPY or Windows Explorer drag/drop. The drag/drop method actually seemed to be consistently faster than ROBOCOPY.
    If it were entirely up to me, I'd rather have backed up the databases to removable USB 3.0 drives transferred them via sneakernet/coach or maybe FedEx them to NJ. I'm not a networking or infrastructure guy, and this was probably a one-off event, but I invite anyone to educate me on a better method of doing this if you were in a similar situation.

    Heh... have done similar in the past.  The ol' "Sneaker Net" / "Carrier Pigeon" methods sometimes cannot be beat.  We actually bought a plane ticket for someone to carry several hard drives because of the time limitations and it worked beautifully.

    --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 10 posts - 16 through 24 (of 24 total)

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