VMware vCenter SQL express database full? How to #fixit!

Last week I had a customer running on a SQL express database with a 10 GB upper limit. The customer called us in because the vCenter service was crashing almost daily.

Upon inspecting the event log I saw the following:
vCenter SQL Express full event log

Source MSSQL$SQLEXPRESS Event 1105

Could not allocate space for object ‘dbo.VPX_TEMPTABLE0′ in database ‘VIM_vCenter’ because the ‘PRIMARY’ filegroup is full. Create disk space by deleting unneeded files, dropping objects in the filegroup, adding additional files to the filegroup, or setting autogrowth on for existing files in the filegroup.

Luckily Scott March has some good tips on his blog

I connected to the SQL Express instance and executed the following commands:
truncate table vpx_hist_STAT1
truncate table vpx_hist_STAT2
truncate table vpx_hist_STAT3
truncate table vpx_hist_STAT4
truncate table vpx_sample_time1
truncate table vpx_sample_time2
truncate table vpx_sample_time3
truncate table vpx_sample_time4

After all the commands completed I proceeded to shrink the database:
Shrink vCenter SQL Express database

Here are the results:
vCenter database shrink results

From 10 GB to 1,79 GB Рwhat a difference Рnow we are ready to rock and roll again!

To prevent something like this from happening again, you might want to consider enabling Database Retention Policy and setting it around 180 days or whatever your preference maybe so these data do not get kept forever.

You can find this setting here: vSphere Client: Administration -> vCenter Server Settings -> Database Retention Policy.

 

If this helped you PLEASE leave a comment!

Incoming search terms:

  • vcenter database full
  • vmware VPX_HIST_STAT2
  • vcenter sql express database 10gb
  • vcenter server database is full
  • vcenter running out of space in sql express
  • vcenter 5 1 database full
  • vcenter 5 1 10 GB database full
  • truncate vpx_hist_stat1_n
  • reduce the database size of veeam one
  • how to shrink sql express vcenter 5 5