SQL Server: DB Backup - Part 2
EXEC sp_adddumpdevice @devtype='disk',
@logicalname='AWBackup',
@physicalname='D:\backup\AWBackup1.bak'
EXEC sp_adddumpdevice @devtype='tape',
@logicalname='AWTapeBackup',
@physicalname='\\.\tape0'
Sp_dropdevice @logicalname='AWBackup'
This command only removes the backup device definition—it doesn’t automatically delete the files contained therein. Use this command to remove all the files in addition tothe device definition:
Sp_dropdevice @logicalname='AWBackup', @devfile='DELFILE'
BACKUP DATABASE AdventureWorks
TO AWBackup
WITH EXPIREDATE = '12/05/2007'
or
BACKUP DATABASE AdventureWorks
TO AWBackup
WITH RETAINDAYS=7
The first option causes that specific backup to be removed after December 5, 2007at midnight. The second option forces that particular backup to be
removed after seven days have passed.
No comments:
Post a Comment