Sharepoint 2010 从SharePoint_Config.dbo.TimerJob删除历史记录的计时器作业不工作

Sharepoint 2010 从SharePoint_Config.dbo.TimerJob删除历史记录的计时器作业不工作,sharepoint-2010,Sharepoint 2010,数据库SharePoint\u Config越来越大,现在是16GB。我在Power Shell中运行了此命令SPTimerJob delete job history,它给了我以下输出: Name Schedule Last Run ---- -------- -------- job-delete-job-hi... weekly at sun 05:... 20.11.2011

数据库
SharePoint\u Config
越来越大,现在是16GB。我在Power Shell中运行了此命令
SPTimerJob delete job history
,它给了我以下输出:

Name                 Schedule             Last Run
----                 --------             --------
job-delete-job-hi... weekly at sun 05:... 20.11.2011 05:00:00
我想现在运行这个作业,我尝试了这个命令,但什么也没发生。没有输出,没有错误

Get-SPTimerJob job-delete-job-history | Start-SPTimerJob

我需要帮助来清除表中的数据
SharePoint\u Config.dbo.TimerJobHistory

可能是由于CA[Delete Job History]计时器作业未每周执行,您的SP Config DB[Timerjob History]表已膨胀;您可以检查它上次在CA中运行的时间,作业定义,[删除作业历史记录]。如果在一个多星期内没有执行[删除作业历史]定时器作业,则需要考虑手动执行定时器作业。

如果[Delete Job History]计时器作业已有一段时间未运行,则需要小心,因为执行该作业将尝试从[TimerJob History]表中清除旧数据,这将导致SP Config DB TLog文件随着事务的清除而增长

以下是我用来逐渐从[TimerJob History]表中清除旧数据的一种方法,同时在执行[Delete Job History]计时器作业之间监视和收缩SP Config DB TLog文件

# Execute [Delete Job History] Timer Job
# Job Title: Delete Job History
# Job Description: Deletes old entries from the timer job history.
# Recurring Schedule: Weekly, Sunday @ 05:00

$job = Get-SPTimerJob | Where-Object {$_.name -eq "job-delete-job-history"}
# If this Timer Job has not been executed on a regular basis (weekly), then the 
# dbo.TimerJobHistory table will have a larger then normal amount of stored rows 
# which need to be purged. In which case, execution of this Timer Job will cause 
# the SP Config DB Transaction Log file to grow as this TimerJob is active.
# In this case, set the DaysToKeepHistory Property to a high value and execute 
# the Timer Job repeatedly gradually decreasing the DaysToKeepHistory Property 
# value until you reach the 7 days default value.
#$job.DaysToKeepHistory = 365 # The default value is 7
#$job.Update()
$job.RunNow()