Last weekend encountered a problem with our VMware instance where we could no longer reach a few of our VM’s via SSH. No big deal I thought I will just connect to VMCC and jump on the console. So I was mildly annoyed when I couldn’t connect, but it was Sunday and there was nothing Product impacted so decide to investigate first thing Monday.
By the time I got in Monday a co-work had already begun investigating why we couldn’t connect to VMCC and found the error ‘VIM_VCDB’ because the ‘PRIMARY’ filegroup is full. in Event log for the machine hosting VMCC. A little googling gave some pointers to the fix, but most seemed to assume you were a MS SQL DBA and knew what you were doing. Since I am not a MS SQL DBA and did not know what I am doing, I thought I would put what I eventually figured out here in case any other non-DBA’s had the same problem. (Note you could completely destroy your VMware installation following these instructions, I would highly recommend you hire an expert to do it)
1.) Download the purge old data SQL script from HERE
2.) If you don’t already have it (not being a DBA and all) download SSMSE from HERE
3.) Double- Click the VCDB_table_cleanup_MSSQL script and it will Launch SSMSE
4.) Select the VIM_VCDB database from the drop down
5.) Now click the button to perform a trail run. You should see something similar to the screen below showing the output of the test run.
From here I will leave as an exercise for the reader to figure out how to enable the cleanup script to actually clean up the database, Hint: read the script comments.