SCVMM jobs cleanup-- 40K jobs exist in history. Best way to clear older history jobs?? causing performance issues.

SCVMM for VDI (citrix xendesktop) is managing 6000+ VM's and 200+ Hyper-V host.

Currently the settings for 'Garbage Collect' is set to 2 days.

Still the jobs history shows 40K + jobs. Due to that the PERFORMANCE OF ADMIN CONSOLE IS TOO SLOW. Ideally, expecting the older job history to be cleared after 2 days which is not currently happening.

SCVMM version is 2012 on windws 2008 R2.

I am now reducing the 'Garbage Collect' to TaskGC= 1 day.

If it still wont clear, how we can manually clear from DB? 

I came across this blog and running the below command, will it clear all the old job history previous to the DATE that we mention??

http://blogs.technet.com/b/mbriggs/archive/2009/12/08/scvmm-service-may-consume-high-memory-or-cpu-utilization.aspx

DECLARE @CutoffDateTime datetime SELECT @= '31/8/20015' EXECUTE [VirtualManagerDB].[dbo].prc_TR_GarbageCollect @CutoffDateTime

So, as per above command, i should be able to clear all jobs history before 31st AUG? Correct me?

Does the above command work irrespective the sql version that we are using? i am using sql 2008 R2.

Should i also need to run the below ones? or just the above should be OK to clear all jobs history before 31st AUG

delete from [VirtualManagerDB].[dbo].[tbl_TR_DeletedObject]

delete from [VirtualManagerDB].[dbo].[tbl_TR_AuditTrail]

delete from [VirtualManagerDB].[dbo].[tbl_TR_SubtaskTrail]

delete from [VirtualManagerDB].[dbo].[tbl_TR_TaskTrail]

delete from [tbl_PCMT_PerfHistory_Raw]

delete from [tbl_PCMT_PerfHistory_Hourly]

delete from [tbl_PCMT_PerfHistory_Daily]


September 2nd, 2015 2:53am

Hi Sir,

It seems that the safe way to clean up job history is :

"

Add the TaskGC registry value to limit the number of days that VMM retains job historical information.
  1.  Navigate to the following registry entry on your VMM server

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft System Center Virtual Machine Manager Server\Settings\Sql

    2.    Create a DWORD value named TaskGC and set its value to a number less than 90 (decimal).

(TaskGC value controls the number of days that the events are stored in the DB)

    3.    Restart the VMM server several times to remove jobs until the total drops below 10,000

This registry key runs a stored procedure on the SQL Server once every 20h. In one run, a maximum of 50,000 objects in the jobs table is deleted. As there are multiple objects per job, this might not show a significant reduction immediately, but will succeed over several days to cleanup the DB.
"

https://support.microsoft.com/en-us/kb/2009348

As this article mentioned , we need to change the "cutoffdatatime" , It will delete the jobs which the datatime before "cutoffdatatime" (not include "cutoffdatatime")

Best Regards,

Elton Ji

Free Windows Admin Tool Kit Click here and download it now
September 4th, 2015 3:03am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics