This means if you tick the "Tasks and Events" retained for that your vcenter will remove any tasks/events older than 180 days from the database.
You can change this if you like to a number which is nice for you, this will also reduce some of the size of your database, I'm currently working on a database reduction, there is also a Stored Procedure you can run on the vCenter database to cleanse this data from the database.
If you haven’t tweaked the “Database Retention Policy” settings under the vCenter Server Settings, it is a good idea to do this also.
- Under vCenter database > Tables > Right-Click the dbo.VPX_PARAMETER table and click Open.
- Modify event.maxAge to 30 (or another reasonable value), and modify the event.maxAge.Enabled value to true.
- Modify task.maxAge to 30, and modify the task.maxAgeEnabled value to true.
It is recommended that you jump down from 180 days in increments or you will fill up the Transaction Log , you can then run the below procedure and repeat the above to changing the days in increments.
Steps:
- Run stored procedure below
- Run transaction log backup
- Shrink database
See below for full instructions on steps
Step 6
Run the built-in stored procedure:
- Navigate to Programmability > Stored Procedures.
- Right-click dbo.cleanup_events_tasks_proc and click Execture Stored Procedure.
Script below:
USE [Vmtest_vcenterdb]
GO
DECLARE @return_value int
EXEC @return_value = [dbo].[cleanup_events_tasks_proc]
SELECT 'Return Value' = @return_value
GO
- This purges the data from the vpx_event, vpx_event_arg, and vpx_task tables based on the date specified for maxAge.
- The last action is to shrink the database files. Right-click the vCenter database > Tasks > Shrink > Database
Note: You can run the below script on the database if shrink is taking its time to run through to check the progress:
SELECT
percent_complete,
start_time,
status,
command,
estimated_completion_time,
cpu_time,
total_elapsed_time
FROM
sys.dm_exec_requests
WHERE
command = 'DbccFilesCompact