在 SharePoint Server 2016 中設定 SharePoint Health Analyzer 計時器工作Configure SharePoint Health Analyzer timer jobs in SharePoint Server 2016

摘要: 了解如何使用 SharePoint 管理中心網站或 Windows PowerShell 來設定健康情況資料收集計時器工作。Summary: Learn to configure health data collection timer jobs by using the SharePoint Central Administration website or Windows PowerShell.

SharePoint Health Analyzer 會使用計時器工作來收集健康情況資料,然後將資料寫入記錄資料夾和記錄資料庫。這份資料可在報告中用來顯示伺服器陣列中伺服器的健康情況。您可以重新排程這些計時器工作、立即執行這些工作,或者啟用或停用這些工作。SharePoint Health Analyzer uses timer jobs to collect health data and then writes the data to the logging folder and to the Logging database. This data is used in reports to display health of the farm servers. You can reschedule these timer jobs, run them immediately, or enable or disable them.

在該頁面上,您也可以設定使用狀況資料收集、事件收集及使用狀況資料收集設定。如需詳細資訊,請參閱<在 SharePoint Server 中設定 Usage and Health Data Collection>。On that page, you can also configure usage data collection, event selection, and usage data collection settings. For more information, see Configure usage and health data collection in SharePoint Server.

使用管理中心設定狀況資料收集計時器工作Use Central Administration to configure health data collection timer jobs

您可以使用管理中心設定健康情況資料收集計時器工作。You can use Central Administration to configure health data collection timer jobs.

使用管理中心來設定狀況資料收集計時器工作To configure health data collection timer jobs by using Central Administration

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

    注意

    狀況資料收集計時器工作設定會套用於整個伺服器陣列,無法針對伺服器陣列中的個別伺服器設定此工作。The health data collection timer job settings are farm-wide and cannot be set for individual servers in the farm.

  2. 在管理中心首頁上,按一下 [監視]*In Central Administration, on the Home page, click *Monitoring.

  3. 在 [監視]**** 頁面上,按一下 [報告]**** 區段中的 [設定 Usage and Health Data Collection]*On the Monitoring page, in the *Reporting section, click Configure usage and health data collection.

  4. 在 [設定 Usage and Health Data Collection]**** 頁面上,按一下 [健康情況資料收集]**** 區段中的 [啟用健康情況資料收集]*On the *Configure usage and health data collection page, in the Health Data Collection section, click Enable health data collection.

  5. 在 [健康情況資料收集]**** 區段中,按一下 [狀況記錄排程]*。隨即會開啟 [工作定義]* 頁面。此頁面會列出所有收集健康情況資料的計時器工作。In the Health Data Collection section, click Health Logging Schedule. The Job Definitions page opens. It lists all the timer jobs that collect health data.

  6. 在 [作業定義]**** 頁面上,按一下要設定的計時器工作。On the Job Definitions page, click the timer job that you want to configure.

  7. 在 [編輯計時器作業]**** 頁面的 [週期性排程]**** 區段中,變更計時器工作排程,然後按一下 [確定]*On the *Edit Timer Job page, in the Recurring Schedule section, change the timer job schedule, and then click OK.

使用 Windows PowerShell 設定狀況資料收集計時器工作Use Windows PowerShell to configure health data collection timer jobs

您可以使用 PowerShell 來設定健康情況收集計時器工作排程。You can configure the health data collection timer job schedule by using PowerShell.

使用 Windows PowerShell 設定狀況資料計時器工作To configure health data timer jobs by using Windows 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 memberships that are required beyond the minimums above.

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

      注意

      如果您不具備上述權限,請連絡安裝程式系統管理員或 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. 在 [開始]**** 功能表上,按一下 [所有程式]*On the *Start menu, click All Programs.

  3. 按一下 [SharePoint 2016]*Click *SharePoint 2016.

  4. 按一下 [SharePoint 2016 管理命令介面]*Click *SharePoint 2016 Management Shell.

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

    Set-SPTimerJob -Identity <SPTimerJobPipeBind> -Schedule <ScheduleString>
    

    Identity 參數的值可用來指定計時器工作。如果未使用 Identity 參數,則會設定所有計時器工作。若要查看所有計時器工作的清單,請輸入下列命令:The value of the Identity parameter specifies the timer job. If you do not use the Identity parameter, all timer jobs are configured. To see a list of all the timer jobs, type the following command:

    Get-SPTimerJob | Format-Table -property id,title
    

    <SPTimerJobPipeBind> 可以是格式為 12345678-90ab-cdef-1234-567890bcdefgh 的有效 GUID;有效的計時器工作名稱 (例如 TimerJob1);或有效之 SPTimerJob 物件的執行個體。<SPTimerJobPipeBind> can be a valid GUID, in the form 12345678-90ab-cdef-1234-567890bcdefgh; a valid name of a timer job (for example, TimerJob1); or an instance of a valid SPTimerJob object.

    使用 Schedule 參數的值來指定排程,其中 <排程字串> 為下列其中一項:Use the value of the Schedule parameter to specify the schedule, where <ScheduleString> is one of the following:

    • Every 5 minutes between 0 and 59Every 5 minutes between 0 and 59

    • Hourly between 0 and 59Hourly between 0 and 59

    • Daily at 15:00:00Daily at 15:00:00

    • Weekly between Fri 22:00:00 and Sun 06:00:00Weekly between Fri 22:00:00 and Sun 06:00:00

    • Monthly at 15 15:00:00Monthly at 15 15:00:00

    • Yearly at Jan 1 15:00:00Yearly at Jan 1 15:00:00

      若要查看計時器工作排程的範例,請輸入下列命令:To see examples of timer job schedules, type the following command:

    Get-SPTimerJob | Format-Table -property id,title,schedule
    

如需詳細資訊,請參閱<Get-SPTimerJob>和<Set-SPTimerJob>。For more information, see Get-SPTimerJob and Set-SPTimerJob.

注意

建議您在執行命令列管理工作時使用 Windows PowerShell。Stsadm 命令列工具已過時,但為與舊版產品相容,仍會隨附提供。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.

請參閱See also

概念Concepts

SharePoint Server 2016 監視概觀Overview of monitoring in SharePoint Server