History Cleanup Task (Maintenance Plan)
Use the History Cleanup Task dialog to discard old historical information from tables in the msdb database. This task supports deleting backup and restore history, SQL Server Agent Job history, and maintenance plan history. Deleting SQL Server Agent Job history is not available on servers running Microsoft SQL Server 2000.
This statement uses the sp_purge_jobhistory and sp_delete_backuphistory statements.
Important
The addition of the Hour interval in cleanup tasks has implications when you are running multiple version of SQL Server 2005. If you create a task that has an interval of hours, and then try to run that task on either the release version of SQL Server 2005 or SQL Server 2005 Service Pack 1, you will get a different interval. If you edit the task using the earlier versions of the tools, an error message will appear.
- Connection
Select the server connection to use when performing this task.
- New
Create a new server connection to use when performing this task. The New Connection dialog box is described later in this topic.
- Backup and restore history
Retaining records of when recent backups were created can help SQL Server create a recovery plan when you want to restore a database. The retention period should be at least the frequency of full database back ups.
- SQL Server Agent Job history
This history can help you troubleshoot failed jobs, or determine why database actions occurred.
- Maintenance plan history
This history can help you troubleshoot failed maintenance plan jobs, or determine why database actions occurred.
- Remove historical data older than
Specify age of items that you want to delete.
View T-SQL
View the Transact-SQL statements performed against the server for this task, based on the selected options.Note
When the number of objects affected is large, this display can take a considerable amount of time.
New Connection Dialog Box
- Connection name
Enter a name for the new connection.
- Select or enter a server name
Select a server to connect to when performing this task.
- Refresh
Refresh the list of available servers.
- Enter information to log on to the server
Specify how to authenticate against the server.
- Use Windows integrated security
Connect to an instance of the SQL Server Database Engine with Windows Authentication.
- Use a specific user name and password
Connect to an instance of the SQL Server Database Engine using SQL Server Authentication. This option is not available.
- User name
Provide a SQL Server login to use when authenticating. This option is not available.
- Password
Provide a password to use when authenticating. This option is not available.
See Also
Other Resources
sp_purge_jobhistory (Transact-SQL)
sp_delete_backuphistory (Transact-SQL)
Help and Information
Getting SQL Server 2005 Assistance
Change History
Release | History |
---|---|
15 September 2007 |
|