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


How take backup without overwriting or Appending the old files


How take backup without overwriting or Appending the old files

Author
Message
guruprasadurs
guruprasadurs
SSC-Enthusiastic
SSC-Enthusiastic (100 reputation)SSC-Enthusiastic (100 reputation)SSC-Enthusiastic (100 reputation)SSC-Enthusiastic (100 reputation)SSC-Enthusiastic (100 reputation)SSC-Enthusiastic (100 reputation)SSC-Enthusiastic (100 reputation)SSC-Enthusiastic (100 reputation)

Group: General Forum Members
Points: 100 Visits: 66
Hi,
I want to schedule back up DB in ms sql server 2005 using maintainence plan wizard. I want to know Is it possible to schedule backup like Test09jan2012.bak, Test10jan2012.bak, Test11jan2012.bak in backup folder. Like individula files.

Please let me know if possible.

Thnaks in Advance

Regards,
GP
Dev
Dev
SSCrazy Eights
SSCrazy Eights (9.2K reputation)SSCrazy Eights (9.2K reputation)SSCrazy Eights (9.2K reputation)SSCrazy Eights (9.2K reputation)SSCrazy Eights (9.2K reputation)SSCrazy Eights (9.2K reputation)SSCrazy Eights (9.2K reputation)SSCrazy Eights (9.2K reputation)

Group: General Forum Members
Points: 9190 Visits: 1602
Not very sure if Maintenance Plans works that way (try it) but you can write your own scripts to achieve the same. At run time you have to add timestamp (or whatever) indicator in the backup file name.
John Mitchell-245523
John Mitchell-245523
SSC-Dedicated
SSC-Dedicated (35K reputation)SSC-Dedicated (35K reputation)SSC-Dedicated (35K reputation)SSC-Dedicated (35K reputation)SSC-Dedicated (35K reputation)SSC-Dedicated (35K reputation)SSC-Dedicated (35K reputation)SSC-Dedicated (35K reputation)

Group: General Forum Members
Points: 35315 Visits: 16683
Yes, maintenance plans will do that for you. You don't have any control, as far as I know, over the actual name of the file, but you'll get each day's backup in a separate file whose name contains the database name and a timestamp.

John
padhis
padhis
Old Hand
Old Hand (386 reputation)Old Hand (386 reputation)Old Hand (386 reputation)Old Hand (386 reputation)Old Hand (386 reputation)Old Hand (386 reputation)Old Hand (386 reputation)Old Hand (386 reputation)

Group: General Forum Members
Points: 386 Visits: 125
This may help you.

http://www.sqlservercentral.com/articles/Backup+%2F+Restore/72234/
Dev
Dev
SSCrazy Eights
SSCrazy Eights (9.2K reputation)SSCrazy Eights (9.2K reputation)SSCrazy Eights (9.2K reputation)SSCrazy Eights (9.2K reputation)SSCrazy Eights (9.2K reputation)SSCrazy Eights (9.2K reputation)SSCrazy Eights (9.2K reputation)SSCrazy Eights (9.2K reputation)

Group: General Forum Members
Points: 9190 Visits: 1602


Nice Pointer but it might not help OP because backup file won't have the indicators (prefix/suffix) he might be interested in.
robgilbie
robgilbie
SSC Rookie
SSC Rookie (26 reputation)SSC Rookie (26 reputation)SSC Rookie (26 reputation)SSC Rookie (26 reputation)SSC Rookie (26 reputation)SSC Rookie (26 reputation)SSC Rookie (26 reputation)SSC Rookie (26 reputation)

Group: General Forum Members
Points: 26 Visits: 16
Hi as Dev indicated your best bet would be to script a backup in SQL agent using a time stamp token.

For example in 2008 to append the machine name, date and time to a backup file name the script would look like this:

backup database MSDB to disk = N'c:\sql backup\MSDB_$(ESCAPE_NONE(MACH))_$(ESCAPE_NONE(DATE))_$(ESCAPE_NONE(TIME)).BAK'
go

In 2000 to append the date to the backup file name it would be:

backup database MSDB to disk = N'c:\sql backup\MSDBE_[DATE].BAK'
go

This switches only work in the agent, if you run in a query you will just append the commands

For a full list of tokens in job steps see the following link:

http://msdn.microsoft.com/en-us/library/ms175575.aspx
Mike Hinds
Mike Hinds
Ten Centuries
Ten Centuries (1.4K reputation)Ten Centuries (1.4K reputation)Ten Centuries (1.4K reputation)Ten Centuries (1.4K reputation)Ten Centuries (1.4K reputation)Ten Centuries (1.4K reputation)Ten Centuries (1.4K reputation)Ten Centuries (1.4K reputation)

Group: General Forum Members
Points: 1391 Visits: 1134
robgilbie (1/12/2012)
For example in 2008 to append the machine name, date and time to a backup file name the script would look like this:

backup database MSDB to disk = N'c:\sql backup\MSDB_$(ESCAPE_NONE(MACH))_$(ESCAPE_NONE(DATE))_$(ESCAPE_NONE(TIME)).BAK'
go
...
For a full list of tokens in job steps see the following link:

http://msdn.microsoft.com/en-us/library/ms175575.aspx


Very helpful and useful. I've never seen "ESCAPE_NONE" or the other job tokens before. Thanks a bunch!

Mike Hinds
Senior Database Administrator
1st Source Bank
MCP, MCTS
Divine Flame
Divine Flame
SSCarpal Tunnel
SSCarpal Tunnel (4.5K reputation)SSCarpal Tunnel (4.5K reputation)SSCarpal Tunnel (4.5K reputation)SSCarpal Tunnel (4.5K reputation)SSCarpal Tunnel (4.5K reputation)SSCarpal Tunnel (4.5K reputation)SSCarpal Tunnel (4.5K reputation)SSCarpal Tunnel (4.5K reputation)

Group: General Forum Members
Points: 4463 Visits: 2816
guruprasadurs (1/9/2012)
Hi,
I want to schedule back up DB in ms sql server 2005 using maintainence plan wizard. I want to know Is it possible to schedule backup like Test09jan2012.bak, Test10jan2012.bak, Test11jan2012.bak in backup folder. Like individula files.

Please let me know if possible.

Thnaks in Advance

Regards,
GP


Maintenance Plan does that only. It automatically adds the timestamp in backup file name. Also, it asks you whether you want to store the backup files in a single backup directory or you want to create new directory for each & every database backup. Choice is yours!!


Sujeet Singh
robgilbie
robgilbie
SSC Rookie
SSC Rookie (26 reputation)SSC Rookie (26 reputation)SSC Rookie (26 reputation)SSC Rookie (26 reputation)SSC Rookie (26 reputation)SSC Rookie (26 reputation)SSC Rookie (26 reputation)SSC Rookie (26 reputation)

Group: General Forum Members
Points: 26 Visits: 16
Hi Mike

Neither had I mate till a few weeks ago, just start MCTS Smile


Going back to the original request, as already stated you can use maintenance plans, sorry should have said,
just trying to get out of the habit of using them myself Smile
guruprasadurs
guruprasadurs
SSC-Enthusiastic
SSC-Enthusiastic (100 reputation)SSC-Enthusiastic (100 reputation)SSC-Enthusiastic (100 reputation)SSC-Enthusiastic (100 reputation)SSC-Enthusiastic (100 reputation)SSC-Enthusiastic (100 reputation)SSC-Enthusiastic (100 reputation)SSC-Enthusiastic (100 reputation)

Group: General Forum Members
Points: 100 Visits: 66
Sorry to all for late reply. Its working fine now. Thanks to all
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