Here are the steps to truncate VMWare events data to free up space:
This article is being intentionally left somewhat vague because these actions should NOT be performed routinely. However, when the VMWare Virtual Center’s MS SQL databases have become so large that clearing out all the old event data has become necessary. This is one of several ways to do this.
The following query will give you a list of all your tables and give you how many rows and how large they are:
SELECT t.NAME AS TableName, p.rows AS RowCounts, SUM(a.total_pages) * 8 AS TotalSpaceKB, SUM(a.used_pages) * 8 AS UsedSpaceKB, (SUM(a.total_pages) - SUM(a.used_pages)) * 8 AS UnusedSpaceKB FROM sys.tables t INNER JOIN sys.indexes i ON t.OBJECT_ID = i.object_id INNER JOIN sys.partitions p ON i.object_id = p.OBJECT_ID AND i.index_id = p.index_id INNER JOIN sys.allocation_units a ON p.partition_id = a.container_id WHERE t.NAME NOT LIKE 'dt%' AND t.is_ms_shipped = 0 AND i.OBJECT_ID > 255 GROUP BY t.Name, p.Rows ORDER BY t.Name
The following query will delete all events logged. Please make a backup before doing this!!!
truncate table vpx_event_arg; delete from vpx_event;
You should then perform a database shrink.
We hope you find this article informative. Please share it with your friends, colleagues, and on all your favorite social sites. Let us know what interests you, and we will write it. Don’t forget to leave a comment.