Johnny Zhang
Please keep in mind, clean up event is not recommended, do it ONLY when you are running out of space because both vpx_event_arg and vpx_event tables are filled with many GB of data.
Always shut down vCenter service before you do anything with the database.
You can check the space usage by each table:

use "name_of_the_vcdb"
CREATE TABLE #TemptableforspaceUsed
(name SYSNAME,
rows bigINT,
reserved VARCHAR(20),
data VARCHAR(20),
index_size VARCHAR(20),
unused VARCHAR(20))
INSERT #TemptableforspaceUsed
EXEC sp_MSforeachtable 'sp_spaceused "?"'

select *
from #TemptableforspaceUsed

drop table #TemptableforspaceUsed


You can now clean the event tables.

use "name_of_the_vcdb"
truncate table vpx_event_arg;
delete from vpx_event;

Because there are foreign keys inside vpx_event, you can not truncate the data inside. You must remove those data before start the vCenter service, the service might not start if there are data that is missing link. Please also keep in mind, "delete" will always save a copy of the change, so you will see increase in transaction logs, sometimes it can be huge, depends on the amount of data you have.
1 Response
  1. VMware has a Knowledge Base article with a script for cleaning up the event log in the database.

Post a Comment