Reading Time: 4 minutes

In the previous post we have talk about the VMware Horizon View Event database and how purge the old data in order to free some space. You can have similar issue also with the VMware vCenter Server database, considering that it can continuous grow due to the statistics and also due to the events/tasks. In really small system a simple solution could be re-install a fresh version of vCenter Server (maybe during an upgrade) and re-create all the configuration stored only in the vCenter Server database. But in several cases this approach is not realistic.

Again there isn’t a pre-build maintenance plan to purge old data, but you can use those different VMware KB:

  • For vSphere 2.x: KB 1000125 (Purging old data from the database used by VirtualCenter 2.x)
  • Up to vSphere 5.0: KB 1025914 (Purging old data from the database used by VMware vCenter Server 4.x and 5.x)
  • Up to vSphere 5.5: KB 1007453 (Reducing the size of the vCenter Server database when the rollup scripts take a long time to run)

Basically you can use those two script for truncate the old data:

Note that there isn’t a prebuild script for the embedded database of the virtual appliance version of vCenter Server. However, there are a lot of front end (also for Windows) that can help you in this “housekeeping” task, in case you are not comfortable with the command line.

Of course, a complete backup of your database is recommended before any action:

Most of those issue are related to a SQL Express installation where you may have a limited database file due to the edition limitation: SQL Express 2008 is limited to 1 CPU, 1 GB of RAM and 4 GB for database file, the SQL Express 2008 R2 version increase the maximum file to 10 GB (see this comparison chart) and the SQL Express 2012 version also can use up to 4 cores (see this comparison chart). The file limit explain also the limited support for the SQL Express:

SQL Express 2005/2008 (vCenter Server 5.x is bundled with SQL Express 2008 R2) 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.

vCenter-RetentionNote that you can also change some setting in order to reduce the future grow of your database, using the vCenter Server settings.

Tasks/Events retention

You can specify the retention (in days) of tasks and events data. By default you will store all data in your vCenter Server database, so it will continuous grow year by year.

Depending by your needs and your compliance requirements could be reasonable put a limit on the time frame of this kind of data.

vCenter-StatisticsStatistics

Stats and counters are another big reason on the database grow and the main reason on the change rate of the database (so also on the grow of the transaction logs).

You have an useful calculator to estimate the database size depending on the number of hosts, on the number of VMs, on the counter level (note that by default is 1, but you probably may need to change to 2, at least for the short time, in order to have more counters) and the retention on each period.

Share

Virtualization, Cloud and Storage Architect. Tech Field delegate. VMUG IT Co-Founder and board member. VMware VMTN Moderator and vExpert 2010-24. Dell TechCenter Rockstar 2014-15. Microsoft MVP 2014-16. Veeam Vanguard 2015-23. Nutanix NTC 2014-20. Several certifications including: VCDX-DCV, VCP-DCV/DT/Cloud, VCAP-DCA/DCD/CIA/CID/DTA/DTD, MCSA, MCSE, MCITP, CCA, NPP.