Log in
::
Register
::
Not logged in
Home
Tags
Articles
Editorials
Stairways
Forums
Scripts
Videos
Blogs
QotD
Books
Ask SSC
SQL Jobs
Training
Authors
About us
Contact us
Newsletters
Write for us
Recent Posts
Recent Posts
Popular Topics
Popular Topics
Home
Search
Members
Calendar
Who's On
Home
»
SQL Server 2005
»
Administering
»
backup database
backup database
Rate Topic
Display Mode
Topic Options
Author
Message
Nero-1119276
Nero-1119276
Posted Wednesday, October 28, 2009 11:54 PM
SSC Rookie
Group: General Forum Members
Last Login: Thursday, October 29, 2009 6:31 AM
Points: 39,
Visits: 132
hi all,
I have configured a job in EM.For full backup and differential backup.
But i have only two option where i can append to media or overwrite existing backup.
But as per policy i should maintain automated backup for at least a previous week.
Current i take
FULL backup in morning around 10 and differentail after 5 hours.
Now how can i maintain week backup when i have only two option1.APPEND TO MEDIA
option2.Overwrite existing media
thanks,
Neerav
Post #810515
Adi Cohn-120898
Adi Cohn-120898
Posted Thursday, October 29, 2009 12:05 AM
SSCrazy
Group: General Forum Members
Last Login: 2 days ago @ 10:47 PM
Points: 2,023,
Visits: 4,948
The easiest way is to use the maintenance wizard. It will create a different file for each backup and will delete old files according to the way that you configured the maintenance job. If you don’t want to use the maintenance wizard, you can write your own code that does the same thing.
Adi
--------------------------------------------------------------
To know how to ask questions and increase the chances of getting asnwers:
http://www.sqlservercentral.com/articles/Best+Practices/61537/
For better answers on performance questions, click on the following...
http://www.sqlservercentral.com/articles/SQLServerCentral/66909/
Post #810519
Nero-1119276
Nero-1119276
Posted Thursday, October 29, 2009 12:20 AM
SSC Rookie
Group: General Forum Members
Last Login: Thursday, October 29, 2009 6:31 AM
Points: 39,
Visits: 132
If i write this code
backup database to disk='Path'
Now what should i use to include date in backup name likewise
testbackup01-01-2009.bck
Post #810523
Adi Cohn-120898
Adi Cohn-120898
Posted Thursday, October 29, 2009 12:31 AM
SSCrazy
Group: General Forum Members
Last Login: 2 days ago @ 10:47 PM
Points: 2,023,
Visits: 4,948
Nero-1119276 (10/29/2009)
If i write this code
backup database to disk='Path'
Now what should i use to include date in backup name likewise
testbackup01-01-2009.bck
You’ll have to use the date and time as a part the file’s name so the names will be unique and you’ll know when the backup was taken. One option to do it is to write the backup statement as dynamic SQL and then use a combination of string manipulating and getdate() functions in order to get the file’s name. Another option that is not widely known is to use the Agent’s tokens. If you’ll use this option, you won’t have to use dynamic SQL and the agent will convert the tokens with the real value. You can read about the SQL Agent tokens here –
http://www.sqldev.net/sqlagent/SQLAgentStepTokens.htm
.
Personally I’d use the maintenance wizard for that instead of writing it on my own. Any reason that you are not using it?
Adi
--------------------------------------------------------------
To know how to ask questions and increase the chances of getting asnwers:
http://www.sqlservercentral.com/articles/Best+Practices/61537/
For better answers on performance questions, click on the following...
http://www.sqlservercentral.com/articles/SQLServerCentral/66909/
Post #810524
« Prev Topic
|
Next Topic »
Permissions
You
cannot
post new topics.
You
cannot
post topic replies.
You
cannot
post new polls.
You
cannot
post replies to polls.
You
cannot
edit your own topics.
You
cannot
delete your own topics.
You
cannot
edit other topics.
You
cannot
delete other topics.
You
cannot
edit your own posts.
You
cannot
edit other posts.
You
cannot
delete your own posts.
You
cannot
delete other posts.
You
cannot
post events.
You
cannot
edit your own events.
You
cannot
edit other events.
You
cannot
delete your own events.
You
cannot
delete other events.
You
cannot
send private messages.
You
cannot
send emails.
You
may
read topics.
You
cannot
rate topics.
You
cannot
vote within polls.
You
cannot
upload attachments.
You
may
download attachments.
You
cannot
post HTML code.
You
cannot
edit HTML code.
You
cannot
post IFCode.
You
cannot
post JavaScript.
You
cannot
post EmotIcons.
You
cannot
post or upload images.
Copyright © 2002-2013 Simple Talk Publishing. All Rights Reserved.
Privacy Policy.
Terms of Use.
Report Abuse.