Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


backup database


backup database

Author
Message
Nero-1119276
Nero-1119276
SSC Rookie
SSC Rookie (45 reputation)SSC Rookie (45 reputation)SSC Rookie (45 reputation)SSC Rookie (45 reputation)SSC Rookie (45 reputation)SSC Rookie (45 reputation)SSC Rookie (45 reputation)SSC Rookie (45 reputation)

Group: General Forum Members
Points: 45 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
Adi Cohn
Adi Cohn
Hall of Fame
Hall of Fame (3.3K reputation)Hall of Fame (3.3K reputation)Hall of Fame (3.3K reputation)Hall of Fame (3.3K reputation)Hall of Fame (3.3K reputation)Hall of Fame (3.3K reputation)Hall of Fame (3.3K reputation)Hall of Fame (3.3K reputation)

Group: General Forum Members
Points: 3254 Visits: 6468
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/
Nero-1119276
Nero-1119276
SSC Rookie
SSC Rookie (45 reputation)SSC Rookie (45 reputation)SSC Rookie (45 reputation)SSC Rookie (45 reputation)SSC Rookie (45 reputation)SSC Rookie (45 reputation)SSC Rookie (45 reputation)SSC Rookie (45 reputation)

Group: General Forum Members
Points: 45 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
Adi Cohn
Adi Cohn
Hall of Fame
Hall of Fame (3.3K reputation)Hall of Fame (3.3K reputation)Hall of Fame (3.3K reputation)Hall of Fame (3.3K reputation)Hall of Fame (3.3K reputation)Hall of Fame (3.3K reputation)Hall of Fame (3.3K reputation)Hall of Fame (3.3K reputation)

Group: General Forum Members
Points: 3254 Visits: 6468
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/
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