Sql-server – SQL Server Backup retention policy

database-backupsqlsql serversql-server-2005sql-server-2008

I need to backup database in full recovery mode with a condition as:
1. Backup database, only when space is available for backup operation and Backup retention policy must be like expect last two days backup folder, delete all other backup folder.
any help will be highly appreciable.

Best Answer

You should backup your database via a maintenance plan "Back Up Database Task". Following that, you should add a "Maintenance Cleanup Task" to specify your retention policy and delete backups older than say, two days.

You can create your plan via the "Maintenance Plan Wizard".

Taking backups is your number one task as a DBA so you should really always make sure you have sufficient disk space. If disk space is an issue and you are using SQL Server 2008 Enterprise or SQL Server 2008 R2 Standard or higher, you can use backup compression to save space.

Related Topic