I am currently backing up a series of databases utilizing full backups, log backups and differential backups. I have used the maintenance plans to create the full and log backups. With the differentials I created a job with the following code.
BACKUP DATABASE XXX
TO DISK=@filename
WITH DIFFERENTIAL,
DESCRIPTION = @description,
RETAINDAYS = @retaindays,
NOINIT
Retain days is equal to 2 in case you are wondering.
The full and log backups put out a separate file every time they run (not using a backup device). But what I am doing with the differential backups creates a backup device for each day and puts the backups onto the same device for that day.
The issue is that I do not know how to limit the number of these devices or is that not possible?
There must be some way to have a job that deletes these devices if they are so many days old.. just like in the maintenance plans. Would someone offer some instruction or code to help me out?
The other way of looking at this is to make the differential backup put out a regular file instead of going to a backup device.
Thank you in advance for your efforts,
Apollo21
BACKUP DATABASE XXX
TO DISK=@filename
WITH DIFFERENTIAL,
DESCRIPTION = @description,
RETAINDAYS = @retaindays,
NOINIT
Retain days is equal to 2 in case you are wondering.
The full and log backups put out a separate file every time they run (not using a backup device). But what I am doing with the differential backups creates a backup device for each day and puts the backups onto the same device for that day.
The issue is that I do not know how to limit the number of these devices or is that not possible?
There must be some way to have a job that deletes these devices if they are so many days old.. just like in the maintenance plans. Would someone offer some instruction or code to help me out?
The other way of looking at this is to make the differential backup put out a regular file instead of going to a backup device.
Thank you in advance for your efforts,
Apollo21