Knowledge Base

Search the Knowledge Base: |
Search the Knowledge Base: |
Purging old data from the database used by vCenter Server
Details
In vCenter Server 4.0.x there is a Database Retention Policy setting which allows you to specify when vCenter Server tasks and events should be deleted. Since this setting does not affect performance data records it is still possible to purge or shrink old records from the database using the scripts attached to this article. To access the Database Retention Policy setting in the vSphere Client click Administration > vCenter Server Settings > Database Retention Policy.
Solution
Caution: The scripts attached to this article are intended for execution by database administrators (DBAs) who are experienced with using database client tools to execute SQL commands. The purpose of the scripts is to delete data. VMware strongly recommends that you stop the VirtualCenter Server service and make a full, reliable backup of your database before attempting this process.
These scripts delete rows, in batches, from designated tables in the vCenter database. However, by default it only reports how many rows are deleted. To actually delete data, a configuration parameter within the script must be modified. This is a safety precaution. Please see the comments in the heading of the script for details. Diagnostic messages are printed that summarize the operations.
The database transaction log may fill up during this procedure if sufficient disk space is not available. For SQL Server, if the required disk space cannot be made available, one option is to utilize the “simple” recovery model on the database for the duration of this operation.
Warning: The VirtualCenter Server service must be stopped while this script is running. For more information, see Stopping, starting, or restarting vCenter services (1003895).
Attachments
Feedback
- KB Article: 1000125
- Updated: Nov 17, 2009
- Products:
VMware VirtualCenter - Product Versions:
VMware VirtualCenter 2.0.x
VMware VirtualCenter 2.5.x
VMware vCenter Server 4.0.x

