Please come back for more

vmware vcenter database over 10 giga

Vcenter running SQL Express.  “VIM_VCDB” reached 10GB and so crashes Vcenter !!
To purge the data in the VPX_EVENT table:
  1. Connect to Servername\SQL Database and log in with the appropriate credentials.
  2. Click databases to expand and select VIM_VCDB > Tables.Note: By default, the vCenter Server database is named VIM_VCDB, unless it was renamed during initial creation.
  3. Right-click the dbo.VPX_PARAMETER table and click Open.Note: If you are using SQL Server 2008, right-click the dbo.VPX_PARAMETER table and click Edit Top 200 Rows.
  4. Modify event.maxAge to 30 and the event.maxAgeEnabled value to true.
  5. Modify task.maxAge to 30 and the task.maxAgeEnabled value to true.Note: To improve the time of the data cleanup, run the preceding steps in several intervals:
    1. Ensure to keep the default value of event.maxAge and task.maxAge.
    2. Perform step 6 to run the cleanup.
    3. Reduce the event.maxAge and task.maxAge value by 60 and run the cleanup.
    4. Repeat the steps a-c until the value is reached to 30 for the final cleanup process.
  6. Run the built-in stored procedure:
    1. Go to VIM_VCDB > Programmability > Stored Procedures.
    2. Right-click dbo.cleanup_events_tasks_proc and select Execute Stored Procedure.This purges the data from the vpx_event, vpx_event_arg, and vpx_task tables based on the date specified for maxAge.
    3. When purging is successfully completed, close the SQL Management Studio and start the VMware Virtual Center Server service.
  7. Ensure that the default Statistics Level is set to 1:
    1. Using the vSphere Client, log in to vCenter Server as an administrator.
    2. Go to Administration > vCenter Server Settings > Statistics.
    3. Under Statistics Intervals, ensure the Statistics Level column is set to 1.
    4. To change the value, select the Interval Duration, click Edit and select Level 1 from the list.
Notes:
  • The execution of dbo.cleanup_events_tasks_proc may take a long period of time depending on the database size.
  • The operation may fail due to the transaction logs being filled up at multiple intervals based on the data to be purged. You must shrink the Transaction logs when required and run dbo.cleanup_events_tasks_proc again.

Truncate the event and tasks table

To Truncate the event and tasks table, run this script:

alter table VPX_EVENT_ARG drop constraint FK_VPX_EVENT_ARG_REF_EVENT, FK_VPX_EVENT_ARG_REF_ENTITY
alter table VPX_ENTITY_LAST_EVENT drop constraint FK_VPX_LAST_EVENT_EVENT
truncate table VPX_TASK
truncate table VPX_ENTITY_LAST_EVENT
truncate table VPX_EVENT
truncate table VPX_EVENT_ARG
alter table VPX_EVENT_ARG add constraint FK_VPX_EVENT_ARG_REF_EVENT foreign key(EVENT_ID) references VPX_EVENT (EVENT_ID) on delete cascade,
constraint FK_VPX_EVENT_ARG_REF_ENTITY foreign key (OBJ_TYPE) references VPX_OBJECT_TYPE (ID)
alter table VPX_ENTITY_LAST_EVENT add constraint FK_VPX_LAST_EVENT_EVENT foreign key(LAST_EVENT_ID)
references VPX_EVENT (EVENT_ID) on delete cascade

More inforamtion :

http://bohemiangrove.co.uk/vmware-vcenter-server-5-5-database-is-full/

https://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=1025914

Leave a Reply

Your email address will not be published. Required fields are marked *