November 7, 2011 at 9:03 am
Hello everyone,
I'm getting started in SQL, and there's is one thing I know can be done but I can't find or figure out how to do it.
I create my backup jobs with the maintenance plan wizard and my databases get backed up locally on my server, everything great but after the backup job finishes (or while it runs as a part of it) I want those backup files (bak and trn) to be copied to a different location on my network.
How do I do this? is there a checkbox or something I am missing on the creation of the backup plan or do I have to create it via a script? if I need a script, can anybody provide an example?
Thanks in advance for the help.
November 7, 2011 at 9:47 am
Do you need to have 2 copies of the backup.. 1 locally and 1 on the share ?
If you only need 1 copy you could backup straight to a network share via a script or manually edit the maintenance plan with;
BACKUP DATABASE DbName to disk='\\server\share\DbName.bak' WITH CHECKSUM
Obviously this share will need to be locked down appropriately.
Cheers
Vultar
November 7, 2011 at 9:49 am
Yes, for security reasons I need two, my local copy and my network share copy
November 7, 2011 at 10:31 am
In a maintenance plan not sure don't use them myself. Via T-SQL, use the mirror capability in the backup database command like so
BACKUP DATABASE AdventureWorks
TO DISK = 's:\mybackups\somedatabase.bak'
MIRROR TO DISK = '\\fileserver\remotebaks'
WITH INIT
-----------------------------------------------------------------------------------------------------------
"Ya can't make an omelette without breaking just a few eggs" 😉
November 7, 2011 at 11:06 am
Thank you for the reply Perry, I'll give it a try to see if it works.
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply