Shrink vCenter Database.
Update: For vCenter Server 5.1 and 5.5, see the To truncate all performance data from vCenter Server 5.1 and 5.5 section in Reducing the size of the vCenter Server database when the rollup scripts take a long time to run (1007453).
SQL Express 2005/2008 (vCenter Server 5.x is bundled with SQL Express 2008) supports a maximum of 5 hosts and 50 virtual machines. If your environment exceeds these thresholds, you must upgrade your database to SQL Standard edition.
The old data takes valuable place. And what if you don't have enough space? You battle to gain several megs here or threre on your volume, bu you know that there is a way to shrink the vCenter database too?
n 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. And also there are a scripts attached to the KB article so you'll be able to use them on VirtualCenter 2.0.x, vCenter Server 2.5.x and vCenter Server 4.0.x.
You must use database admin account to run this script.
After the download from the vMware KB website, unzip on the desktop. Stop the vCenter Service and open the file. Then follow the video about how and where to enter the values concerning the from when you want to purge the data. First you can just do a simulation and then when changing value from delete data = 0 to delete data = 1 the data only will get purged.
So here is the video showing the scripts in action.
You can also use Ms SQL management studio to shrink your database:
01. In Object Explorer, connect to an instance of the SQL Server Database Engine, and then expand that instance.
02. Expand Databases, and then right-click the database that you want to shrink.
03. Point to Tasks, point to Shrink, and then click Database.
04. Enter the maximum percentage of free space to be left in the database files after the database has been shrunk. Permissible values are between 0 and 99. Click OK to finish.
To download MS SQL server management studio express.
If the database has reached a 4 GB limit in SQL Express, the database is corrupted, or if vCenter Server is unavailable for any reason, purge the event and event_arg tables either by manually enabling the database retention policy in the database using SQL Studio, or by running the stored procedure to purge the data from these tables.