media retention Option

Administering SQL Server

Administering SQL Server

media retention Option

Use the media retention option to provide a system-wide default for the length of time to retain each backup medium after it has been used for a database or transaction log backup. media retention helps protect backups from being overwritten until the specified number of days has elapsed. When you set media retention, you do not have to specify the length of time to retain system backups each time you perform a backup. The default is 0 days. If you use the backup medium before the set number of days has passed, Microsoft® SQL Server™ issues a warning message. SQL Server does not issue a warning unless you change the default.

This option can be overridden by using the RETAINDAYS clause of the BACKUP statement.

media retention is an advanced option. If you are using the sp_configure system stored procedure to change the setting, you can change media retention only when show advanced options is set to 1. The setting takes effect after stopping and restarting the server.

To set the backup retention duration