June 12, 2014 at 10:07 am
Hi all,
I'm looking for the most time-efficient way to backup db's to a local drive and then move the .bak files across to a new server, as well as batch separation, and ideally ensure that any failure to backup to/move a particular .bak file does not impede others, or is at least flagged up.
So far, I'm thinking thus...
Backup Database AfterSalesTo Disk = 'D:\ AfterSales.bak'
Exec XP_CMDSHELL 'Move "D:\ AfterSales.bak' \\UKSLO1SQL05.FRENCHUK.LOCAL\Restore'
Go
Backup Database BatchControlTo Disk = 'D:\ (add path here)\ BatchControl.bak'With Replace
Exec XP_CMDSHELL 'Move "D:\BatchControl.bak' \\UKSLO1SQL05.FRENCH.LOCAL\Restore'
Go
Backup Database Cleverly Etc...
Go
Unfortunately, this still means that SQL will proceed with it's tasks in serial fashion - is there a more time-efficient way/sequence that I can force it to proceed?
I don't have any 3rd party software onsite to back up with.
Thanks,
Jake.
June 12, 2014 at 10:36 am
Quick thought, wouldn't it be simpler to have an SSIS package for shuffling the backup files around, no need for XP_CMDSHELL etc.
😎
June 12, 2014 at 10:50 am
Is doing tasks in serial much of a problem here? Backups are only usually limited by disk throughput.
June 12, 2014 at 1:32 pm
Second thought:w00t:
why not backup straight to the network drive? No need to write the backup locally!
😎
June 12, 2014 at 1:44 pm
Just a suggestion. When I had done something like this in the past an Poor Mans Log Shipping process in SQL 2000. I had a schedule task that I ran on a remote server where I would ROBOCOPY the backups to that remote server to keep the directory in sync every hour.
ROBOCOPY
http://technet.microsoft.com/en-us/library/cc733145.aspx
Robocopy and a Few Examples
http://social.technet.microsoft.com/wiki/contents/articles/1073.robocopy-and-a-few-examples.aspx
June 13, 2014 at 8:50 am
Put it in a stored procedure and wrap the groups in a try/catch. Log each group and send an email upon failure.
Cheers
June 13, 2014 at 5:06 pm
Eirikur Eiriksson (6/12/2014)
Quick thought, wouldn't it be simpler to have an SSIS package for shuffling the backup files around, no need for XP_CMDSHELL etc.😎
Since you brought it up, lets see the package that you envision for this. 😉
--Jeff Moden
Change is inevitable... Change for the better is not.
June 13, 2014 at 5:07 pm
Jake Shelton (6/12/2014)
Hi all,I'm looking for the most time-efficient way to backup db's to a local drive and then move the .bak files across to a new server, as well as batch separation, and ideally ensure that any failure to backup to/move a particular .bak file does not impede others, or is at least flagged up.
So far, I'm thinking thus...
Backup Database AfterSalesTo Disk = 'D:\ AfterSales.bak'
Exec XP_CMDSHELL 'Move "D:\ AfterSales.bak' \\UKSLO1SQL05.FRENCHUK.LOCAL\Restore'
Go
Backup Database BatchControlTo Disk = 'D:\ (add path here)\ BatchControl.bak'With Replace
Exec XP_CMDSHELL 'Move "D:\BatchControl.bak' \\UKSLO1SQL05.FRENCH.LOCAL\Restore'
Go
Backup Database Cleverly Etc...
Go
Unfortunately, this still means that SQL will proceed with it's tasks in serial fashion - is there a more time-efficient way/sequence that I can force it to proceed?
I don't have any 3rd party software onsite to back up with.
Thanks,
Jake.
I strongly recommend a COPY rather than a MOVE. If you move the files, non of your SQL Server GUI stuff will be able to find any of your backup files.
--Jeff Moden
Change is inevitable... Change for the better is not.
June 13, 2014 at 8:24 pm
Jeff Moden (6/13/2014)
Eirikur Eiriksson (6/12/2014)
Quick thought, wouldn't it be simpler to have an SSIS package for shuffling the backup files around, no need for XP_CMDSHELL etc.😎
Since you brought it up, lets see the package that you envision for this. 😉
I really appreciate your support of the "shell". Sometimes you just have to cut the crap, and it solves the problem.
Cheers
June 13, 2014 at 10:28 pm
Jeff Moden (6/13/2014)
Jake Shelton (6/12/2014)
Hi all,I'm looking for the most time-efficient way to backup db's to a local drive and then move the .bak files across to a new server, as well as batch separation, and ideally ensure that any failure to backup to/move a particular .bak file does not impede others, or is at least flagged up.
So far, I'm thinking thus...
Backup Database AfterSalesTo Disk = 'D:\ AfterSales.bak'
Exec XP_CMDSHELL 'Move "D:\ AfterSales.bak' \\UKSLO1SQL05.FRENCHUK.LOCAL\Restore'
Go
Backup Database BatchControlTo Disk = 'D:\ (add path here)\ BatchControl.bak'With Replace
Exec XP_CMDSHELL 'Move "D:\BatchControl.bak' \\UKSLO1SQL05.FRENCH.LOCAL\Restore'
Go
Backup Database Cleverly Etc...
Go
Unfortunately, this still means that SQL will proceed with it's tasks in serial fashion - is there a more time-efficient way/sequence that I can force it to proceed?
I don't have any 3rd party software onsite to back up with.
Thanks,
Jake.
I strongly recommend a COPY rather than a MOVE. If you move the files, non of your SQL Server GUI stuff will be able to find any of your backup files.
I strongly recommend you never use the SQL GUI to do restores/recoveries. In that sense, moving the files is actually advantageous, since it forces you to script your SQL restores/recoveries.
SQL DBA,SQL Server MVP(07, 08, 09) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".
June 13, 2014 at 11:02 pm
Jeff Moden (6/13/2014)
Eirikur Eiriksson (6/12/2014)
Quick thought, wouldn't it be simpler to have an SSIS package for shuffling the backup files around, no need for XP_CMDSHELL etc.😎
Since you brought it up, lets see the package that you envision for this. 😉
Elementarty:-)
Since SSIS packages can be executed from T-SQL, one can replace the xp_cmdchell. The package itself would be simple, Foreach Task loops through the source file location, FileSystemTask then copies the file across to the configured destination and in the end if everything is successful, deletes the original file. For belt and braces one can add logging, alerting, alternative destinations etc.
😎
Viewing 11 posts - 1 through 10 (of 10 total)
You must be logged in to reply to this topic. Login to reply