March 7, 2012 at 9:12 am
Have an app that creates databases about once every other day a new DB will be created. Once a new Db is created the old DB's are kept for 60 days and are not changed. Is there some way to program a backup to only backup the newest DB so I dont have to backup all the DB's every night? The name of the newest will change and count up. EX: WSlogdb64, wslogdb65. No the numbers should count up in increments of one but that is also not a guarantee as currently I have a mismatch of #'s. Any help or point in right direction would be appreciated,
Thanks,
Jeff
March 7, 2012 at 9:35 am
I would record database names in a table and then backup only the databases that are not in that table.
Another possible solution: since you don't want database backups for existing databases, I suppose they don't get modified, so you could take a backup of read/write databases and then set all databases read only.
-- Gianluca Sartori
March 7, 2012 at 10:42 am
You can check if your database ever was backed-up:
SELECT Database_Name,
CONVERT( SmallDateTime , MAX(Backup_Finish_Date)) as Last_Backup
FROM MSDB.dbo.BackupSet
WHERE Type = 'd'
GROUP BY Database_Name
ORDER BY Database_Name
March 8, 2012 at 7:10 am
Gianluca Sartori (3/7/2012)
Another possible solution: since you don't want database backups for existing databases, I suppose they don't get modified, so you could take a backup of read/write databases and then set all databases read only.
I believe that would be the perfect solution for two reasons.
1) It would be easy to write the script to do this.
2) It will prevent updates to databases that aren't being backed up.
--Jeff Moden
Change is inevitable... Change for the better is not.
March 8, 2012 at 8:14 am
Thanks, I like the read, read/write solution as the old DB are for reporting only so no writes. I will work on getting this up and working.. Thanks.
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply