未啟用 State Service 刪除到期工作階段計時器工作 (SharePoint Server)The State Service Delete Expired Sessions timer job is not enabled (SharePoint Server)

摘要: 了解如何解決 SharePoint Server 2016 和 SharePoint 2013 的 SharePoint Health Analyzer 規則「未啟用 [State Service 刪除到期工作階段] 計時器工作」。Summary: Learn how to resolve the SharePoint Health Analyzer rule "The State Service Delete Expired Sessions timer job is not enabled", for SharePoint Server 2016 and SharePoint 2013.

規則名稱: 未啟用 [State Service 刪除到期工作階段] 計時器工作。Rule Name: The State Service Delete Expired Sessions timer job is not enabled.

摘要: State Service 使用計時器工作,從 State Service 資料庫中刪除到期工作階段的資料。如果未啟用此計時器工作,主控 State Service 資料庫的伺服器會用盡磁碟空間,導致 SharePoint 伺服器陣列停止運作Summary: The State Service uses a timer job to delete data for expired sessions from the State Service databases. If this timer job is not enabled, the server that hosts the State Service database will run out of disk space and the SharePoint farm will cease to function

原因: 未啟用 [State Service 刪除到期工作階段] 計時器工作。Cause: The State Service Delete Expired Sessions timer job is not enabled.

解決方案:使用 SharePoint 管理中心網站 啟用計時器工作Resolution: Enable the timer job by using the SharePoint Central Administration website

  1. 確認執行此程序的使用者帳戶是伺服器陣列管理員群組的成員。Verify that the user account that is performing this procedure is a member of the Farm Administrators group.

    注意

    此計時器工作設定會套用於整個伺服器陣列,且無法針對伺服器陣列中的個別伺服器進行設定。The timer job settings are farm-wide and cannot be set for individual servers in the farm.

  2. 啟動管理中心。Start Central Administration.

  3. 在管理中心按一下 [監視]*In Central Administration, click *Monitoring.

  4. 在 [監視] 頁面上,按一下 [計時器工作]**** 區段中的 [檢閱工作定義]*On the Monitoring page, in the *Timer Jobs section, click Review job definitions.

  5. 在 [工作定義] 頁面上,按一下 [State Service 刪除到期工作階段] 計時器工作。On the Job Definitions page, click the State Service Delete Expired Sessions timer job.

  6. 在 [編輯計時器工作] 頁面上,指定您要的排程,然後按一下 [啟用]*On the Edit Timer Job page, specify the schedule that you want, and then click *Enable.

解決方案:使用 Microsoft PowerShell 啟用計時器工作Resolution: Enable the timer job by using Microsoft PowerShell

  1. 確認您具備下列成員身分:Verify that you have the following memberships:

    • SQL Server 執行個體上的 securityadmin 固定伺服器角色。securityadmin fixed server role on the SQL Server instance.

    • 所有要更新之資料庫上的 db_owner 固定資料庫角色。db_owner fixed database role on all databases that are to be updated.

    • 正在執行 PowerShell Cmdlet 之所在伺服器上的系統管理員群組。Administrators group on the server on which you are running the PowerShell cmdlets.

      系統管理員可以使用 Add-SPShellAdmin Cmdlet 授與使用 SharePoint Server 2016 Cmdlet 的權限。An administrator can use the Add-SPShellAdmin cmdlet to grant permissions to use SharePoint Server 2016 cmdlets.

      注意

      如果您不具備上述權限,請連絡安裝程式系統管理員或 SQL Server 系統管理員要求權限。如需 PowerShell 權限的其他資訊,請參閱 Add-SPShellAdminIf you do not have permissions, contact your Setup administrator or SQL Server administrator to request permissions. For additional information about PowerShell permissions, see Add-SPShellAdmin.

  2. 啟動 SharePoint 管理命令介面。Start the SharePoint Management Shell.

  3. 在 PowerShell 命令提示字元中,輸入下列命令:At the PowerShell command prompt, type the following command:

    Enable-SPTimerJob StateServiceExpiredSessionJobDefinition
    

如需詳細資訊,請參閱 Enable-SPTimerJob建議您在執行命令列管理工作時使用 Windows PowerShell。Stsadm 命令列工具已過時,但為與舊版產品相容,仍會隨附提供。For more information, see Enable-SPTimerJob. We recommend that you use Microsoft PowerShell when performing command-line administrative tasks. The Stsadm command-line tool has been deprecated, but is included to support compatibility with previous product versions.