如何使用維護模式暫停監視How to suspend monitoring temporarily by using maintenance mode

重要

已不再支援此版本的 Operations Manager,建議升級至 Operations Manager 2019This version of Operations Manager has reached the end of support, we recommend you to upgrade to Operations Manager 2019.

Operations Manager 的監視模式可讓您避免受監視的物件 (例如電腦、SQL 資料庫或分散式應用程式) 離線進行維護時可能發生的任何警告或錯誤。Maintenance mode in Operations Manager enables you to avoid any alerts or errors that might occur when a monitored object, such as a computer, a SQL database, or distributed application, is taken offline for maintenance. 維護模式會暫停下列功能:Maintenance mode suspends the following features:

  • 規則和監視Rules and monitors

  • 通知Notifications

  • 自動回應Automatic responses

  • 狀態變更State changes

  • 新警示New alerts

例如,在 Windows Server 上執行的 Exchange 信箱角色會套用 Exchange Server Service Pack。For example, an Exchange mailbox role running on a Windows server will have an Exchange Server service pack applied. 此軟體更新維護約需 60 分鐘才能完成。This software update maintenance is expected to take 60 minutes to complete. 在此期間,將無法使用在此伺服器上執行的信箱資料庫。During this time, the Mailbox database running on this server will not be available.

在此案例中,您可以讓「Exchange 信箱」角色與包含的元件進入維護模式,而不需要讓整部電腦進入維護模式。In this case, you can put the Exchange Mailbox role and contained components into Maintenance Mode instead of putting the entire computer into Maintenance Mode. 如此一來,在專門維護 Exchange Server 應用程式時,您就可以繼續監視伺服器上執行的其他元件,包括 Windows 作業系統。This way you can continue to monitor the other components running on the server, including the Windows operating system, while maintenance is performed specifically to the Exchange Server application.

您可以選取一或多個監視的物件,並將它們放入指定維護模式,或者可以配合服務或維護期間定義排程,日後根據選擇的排程自動將它們放入維護模式。You can either select one or more monitoring objects and place them into maintenance mode on-demand, or you can define schedules aligned with your service or maintenance windows, and automatically place them into maintenance mode in the future according to the schedule you choose. 使用新的排程功能,您可以︰With the new scheduling feature, you can:

  • 排程未來每日、每週或每月的維護模式。Schedule maintenance mode at a future time daily, weekly, or monthly.

  • 選擇讓不同類別的實體和群組在單一排程中進入維護模式。Choose different classes of entities and groups to put to maintenance as a part of a single schedule.

  • 從單一畫面檢視所有維護模式排程。View all the maintenance mode schedules from a single screen.

  • 針對相同的受監視實體排定多個工作。Schedule multiple jobs for the same monitored entity.

重要

請參閱下列設定和使用維護排程功能的重要資訊︰See the following important Information about configuring and working with the Maintenance Schedule feature:

  • 您可以變更執行中排程的結束時間,但此變更只會套用到正在執行的排程。You can change when a running schedule will end, but the change will only apply to the schedule that is running. 如果您想要編輯該排程日後每次的結束時間,您必須先停止排程,然後再套用變更。If you want to edit the end time for future runs of that schedule, you must first stop the schedule and then apply your changes.

  • 使用 Operations Manager 2019 UR2,當維護排程變更時,會花費最久的時間。With Operations Manager 2019 UR2, the furthest time is taken when a maintenance schedule is changed. 請參閱詳細範例See detailed example.

  • 建立或編輯維護排程時,一次不能包含超過 216 個物件。While creating or editing a maintenance schedule, you cannot include more than 216 Objects at a time. 如果物件數目超過 216 個,則會出現下列錯誤訊息:用戶端已中斷與伺服器的連線。請呼叫 ManagementGroup.Reconnect() 以重新建立連線。If the number of objects exceeds 216, the following error message appears: The client has been disconnected from the server. Please call ManagementGroup.Reconnect() to reestablish the connection.

    若要包含超過 216 個物件,請建立單一或多個群組,以納入想要新增至維護排程的所有物件,然後依據目標群組來建立或編輯維護排程。To include more than 216 objects, create a single or multiple groups with all of the objects you would like to add to the maintenance schedule, and then create or edit a maintenance schedule targeting the group(s). 您一次不能包含超過 216 個群組物件。You cannot include more than 216 group objects at a time.

  • 指定主控管理伺服器角色之 Windows 電腦的指定時區會套用到維護排程。The time zone specified for the Windows computer hosting the Management Server role will be applied to the maintenance schedule.

  • 維護排程不會自動套用日光節約時間的變更。Changes to accommodate daylight savings time are not automatically applied to maintenance schedules. 您必須手動編輯排程,調整日光節約時間。You must manually edit the schedule to adjust for daylight savings time.

  • 您可以查詢 Operations Manager 資料庫的 MaintenanceModeHistory 資料表,取得受監視實體進入維護模式時間的歷史資料。You can get historical data for when a monitored entity went into maintenance mode by querying the MaintenanceModeHistory table in the Operations Manager database.

  • System Center Operations Manager SDK 帳戶必須是下列 SQL Server 角色之一的成員,才能利用維護模式功能︰The System Center Operations Manager SDK account must be a member of one of the following SQL Server roles in order to take advantage of the Maintenance Mode feature:

    • SQLAgentUserRoleSQLAgentUserRole
    • SQLAgentReaderRoleSQLAgentReaderRole
    • SQLAgentOperatorRoleSQLAgentOperatorRole

    如需設定 SDK 動作帳戶的詳細資訊,請參閱 Operations Manager 的帳戶資訊For more information about setting the SDK action account, see Account Information for Operations Manager

  • 列於「操作資料庫帳戶」設定檔下的帳戶,應該具備 MSDB 資料庫中的 SQLAgentOperatorRole 權限。The accounts that are listed under the Operational Database Account profile should have SQLAgentOperatorRole permission on the MSDB database.
  • 如果列於「操作資料庫帳戶」設定檔下的所有帳戶並不具備 MSDB 資料庫中存取 SQLAgentOperatorRole 的權限,請將 MSDB 資料庫中的 SQLAgentOperatorRole 權限指派給 Operational Database Account 設定檔下的每個帳戶。If any accounts that are listed under the Operational Database Account profile do not have access to the SQLAgentOperatorRole permission on the MSDB database, assign the SQLAgentOperatorRole permission on the MSDB database to each account under the Operational Database Account profile.
  • 如果在「操作資料庫帳戶」設定檔下並未列出您的任何帳戶,那麼在「預設動作帳戶」設定檔中的帳戶應該具備 MSDB 資料庫中的 SQLAgentOperatorRolee 權限。If you do not have any accounts listed under the Operational Database Account profile, then the accounts that are available under the Default Action Account profile should have the SQLAgentOperatorRole permission on the MSDB database. 系統會在安裝全新 SCOM 2019 期間自動授與此權限。This permission is granted automatically during the fresh installation of SCOM 2019. 不過,如果是從舊版 SCOM 升級至 SCOM 2019,必須手動授與此權限However, in case of an upgrade to SCOM 2019 from a previous version of SCOM, this permission needs to be granted manually

為支援直接從代理程式管理的電腦起始維護模式的案例,Operations Manager 現在支援允許系統管理員直接從電腦的維護模式中設定電腦,不需要從 Operations 主控台執行此作業。To support the scenario of initiating maintenance mode directly from the agent-managed computer, Operations Manager now supports allowing a system administrator to set the machine in maintenance mode directly from the computer itself, without needing to perform it from the Operations console. 它可以使用新的 PowerShell Cmdlet Start-SCOMAgentMaintenanceMode 執行。It can be performed with the new PowerShell cmdlet Start-SCOMAgentMaintenanceMode.

下一節說明如何使用指定維護模式功能的不同選項。The following section describes how to work with the different options for the on-demand maintenance mode feature.

指定維護模式On-Demand Maintenance Mode

若要讓受監視物件進入維護模式To put a monitored object into maintenance mode

  1. 使用屬於 Operations Manager 系統管理員角色成員的帳戶登入電腦。Log on to the computer with an account that is a member of the Operations Manager Administrators role.

  2. 在 Operations 主控台中,按一下 [監視] 。In the Operations console, click Monitoring.

  3. 在 [監視] 工作區展開 [監視] ,然後按一下 [Windows 電腦] 。In the Monitoring workspace, expand Monitoring, and then click Windows Computers.

  4. 在 [Windows 電腦] 窗格中,在要讓其進入維護模式的電腦上按一下滑鼠右鍵,按一下 [維護模式] ,然後按一下 [開始維護模式] 。In the Windows Computers pane, right-click the computer that you want to place into maintenance mode, click Maintenance Mode, and then click Start Maintenance Mode. 您可以使用 Ctrl+滑鼠左鍵或 Shift+滑鼠左鍵,選取要讓其進入維護模式的多部電腦。You can use ctrl+click or shift+click to select multiple computers to place into maintenance mode.

  5. 在 [維護模式設定] 對話方塊的 [套用到] 下方,如果電腦要進入維護模式,請按一下 [僅限選取的物件] ;否則,請按一下 [選取的物件以及其包含的所有物件] 。In the Maintenance Mode Settings dialog box, under Apply to, click Selected objects only if the computer is to be placed into maintenance mode; otherwise, click Selected objects and all their contained objects.

  6. 如果這是計劃的事件,請選取 [已計劃] ,否則維持不選取。Select Planned if this is a planned event; otherwise, leave it cleared.

  7. 在 [類別] 清單中,按一下適當的維護類別。In the Category list, click the appropriate maintenance category.

  8. 在 [期間] 下,選取並輸入 [分鐘數] ,或選取並輸入 [特定結束時間] ,然後按一下 [確定] 。Under Duration, select and enter the Number of minutes or select and enter the Specific end time, and then click OK. 在 [電腦] 窗格中,您選取的電腦的 [維護模式] 欄中會出現維護模式圖示。A maintenance mode icon appears in the Computers pane, in the Maintenance Mode column for the computer you selected.

    注意

    [分鐘數] 的最小值為 5。The minimum value for Number of minutes is 5. 最大值為 1,051,200 (2 年)。The maximum value is 1,051,200 (2 years). 若要啟動維護模式,最長等候時間是 5 分鐘。To start the maintenance mode, the maximum wait time is 5 minutes.

若要編輯受監視物件的維護模式設定To edit maintenance mode settings for a monitored object

  1. 使用屬於 Operations Manager 系統管理員角色成員的帳戶登入電腦。Log on to the computer with an account that is a member of the Operations Manager Administrators role.

  2. 在 Operations 主控台中,按一下 [監視] 。In the Operations console, click Monitoring.

  3. 在 [監視] 工作區展開 [監視] ,然後按一下 [Windows 電腦] 。In the Monitoring workspace, expand Monitoring, and then click Windows Computers.

  4. 在 [Windows 電腦] 窗格中,以滑鼠右鍵按一下欲編輯設定的電腦,再按一下 [維護模式] ,然後按一下 [編輯維護模式設定] 。Right-click the computer in the Windows Computers pane whose settings you want to edit, click Maintenance Mode, and then click Edit Maintenance Mode settings.

  5. 在 [維護模式設定] 對話方塊中,編輯您要變更的設定,然後按一下 [確定] 。In the Maintenance Mode Settings dialog box, edit the settings you want to change, and then click OK.

若要停止受監視物件上的維護模式To stop maintenance mode on a monitored object

  1. 使用屬於 Operations Manager 系統管理員角色成員的帳戶登入電腦。Log on to the computer with an account that is a member of the Operations Manager Administrators role.

  2. 在 Operations 主控台中,按一下 [監視] 。In the Operations console, click Monitoring.

  3. 在 [監視] 工作區展開 [監視] ,然後按一下 [Windows 電腦] 。In the Monitoring workspace, expand Monitoring, and then click Windows Computers.

  4. 在 [Windows 電腦] 窗格中,在要讓其離開維護模式的電腦上按一下滑鼠右鍵,按一下 [維護模式] ,然後按一下 [停止維護模式] 。In the Windows Computers pane, right-click the computer that you want to take out of maintenance mode, click Maintenance Mode, and then click Stop Maintenance Mode.

  5. 在 [維護模式] 對話方塊中,執行下列動作:Do the following in the Maintenance Mode dialog box:

    1. 如果您將電腦置於維護模式時選取 [選取的物件以及其包含的所有物件] ,請選取 [移除所包含的物件] ,然後按一下 [是] 。If you selected Selected objects and all their contained objects when you placed the computer into maintenance mode, select Remove contained objects and then click Yes.

    2. 如果選取了 [僅限選取物件] ,請清除 [移除所包含的物件] ,然後按一下 [是] 。If you selected Selected objects only, clear Remove contained objects and then click Yes.

  6. 在 [Windows 電腦] 窗格中,維護模式圖示會從您選取的電腦之 [維護模式] 欄中消失。In the Windows Computers pane, the maintenance mode icon disappears from the Maintenance Mode column for the computer you selected.

    注意

    由於 Operations Manager 僅每 5 分鐘輪詢維護模式設定一次,因此維護模式中的物件排定移除可能會延遲。Because Operations Manager polls maintenance mode settings only once every 5 minutes, there can be a delay in an object's scheduled removal from maintenance mode.

從目標系統啟用Enable from Target System

系統管理員可以使用 PowerShell Cmdlet Start-SCOMAgentMaintenanceMode,直接從受監視的 Windows 電腦啟用維護模式。Maintenance mode can be enabled directly from the monitored Windows computer by a systems administrator using the PowerShell cmdlet Start-SCOMAgentMaintenanceMode. 當系統管理員或操作員在電腦上執行此 PowerShell Cmdlet 時,命令會在 Operations Manager 事件記錄檔中記錄事件,並儲存維護活動所需的引數,例如期間、原因、註解及資訊 (像是系統叫用 Cmdlet 的時間)。When a systems administrator or operator runs this PowerShell cmdlet on the computer, the command logs an event in the Operations Manager event log, and stores arguments for the maintenance activity such as duration, reason, comment, and information (like the time when the cmdlet was invoked).

註解欄位包含使用者資訊,特別是引動維護模式的人。The comment field contains user information, specifically who has invoked maintenance mode. 鎖定代理程式的規則每 5 分鐘會執行一次,以 PowerShell 指令碼 ReadMaintenanceModeRegEntry.ps1 讀取代理程式的此登錄項目,然後將此項目標示為無效,以便下次的引動過程不會挑選此項目。A rule that targets the agent, runs every 5 minutes to read this registry entry on the agent with a PowerShell script ReadMaintenanceModeRegEntry.ps1, and then marks this entry as invalid so at next invocation it will not pick this entry. 屬於此規則且鎖定管理伺服器為目標的寫入動作,會記下此記錄,並根據從登錄讀取的記錄為代理程式設定維護模式。The write action, which is part of the rule and targets the management server, takes this record and sets maintenance mode for the agent based on the record read from the registry. 規則執行的頻率可用自訂間隔覆寫。The frequency the rule runs can be overridden to a custom interval.

從目標系統啟用Enable from Target System

伺服器管理員可以使用 PowerShell Cmdlet Start-SCOMAgentMaintenanceMode,直接從受監視的 Windows 電腦啟用維護模式。Maintenance mode can be enabled directly from the monitored Windows computer by a server administrator using the PowerShell cmdlet Start-SCOMAgentMaintenanceMode. 當伺服器系統管理員或操作員在電腦上執行 PowerShell Cmdlet 時,命令會記錄事件,而該事件會儲存維護模式所需的引數,例如持續時間、原因、註解和資訊,像是 Cmdlet 的引動過程時間。When server administrator or operator runs this PowerShell cmdlet on the computer, the command logs an event, which stores arguments for the maintenance mode, such as duration, reason, comment, and information like time of invocation of cmdlet.

鎖定代理程式的規則會讀取代理程式上的事件項目,並儲存在 Operations Manager 資料庫中。A rule that targets the agent, reads the event entry on the agent and stores this in Operations Manager database. 另一個規則 Microsoft.SystemCenter.Agent.MaintenanceMode.Trigger.Rule依預設每 4 分鐘會執行一次,並且會從 Operations Manager 資料庫中讀取此事件。There is another rule Microsoft.SystemCenter.Agent.MaintenanceMode.Trigger.Rule, which runs every 4 minutes by default, and reads this event from the Operations Manager database. 接著,規則會按照從事件中讀取的記錄,在代理程式上設定維護模式。It then sets maintenance mode on the agent, based on the record read from the event. 您可以用自訂的值來覆寫頻率規則。You can override the frequency rule to a custom value.

Start-SCOMAgentMaintenanceMode 語法如下:Start-SCOMAgentMaintenanceMode has the following syntax:

`Start-SCOMAgentMaintenanceMode -Duration <Double (in minutes)> [-Reason <string>] [-Comments <string>]`

注意

能夠接受的最小持續期間值為五 (5) 分鐘。The minimum duration value accepted is five (5) minutes.

Cmdlet 接受下列原因︰The following reasons are accepted by the cmdlet:

  • PlannedOtherPlannedOther
  • UnplannedOtherUnplannedOther
  • PlannedHardwareMaintenancePlannedHardwareMaintenance
  • UnplannedHardwareMaintenanceUnplannedHardwareMaintenance
  • PlannedHardwareInstallationPlannedHardwareInstallation
  • UnplannedHardwareInstallationUnplannedHardwareInstallation
  • PlannedOperatingSystemReconfigurationPlannedOperatingSystemReconfiguration
  • UnplannedOperatingSystemReconfigurationUnplannedOperatingSystemReconfiguration
  • PlannedApplicationMaintenancePlannedApplicationMaintenance
  • UnplannedApplicationMaintenanceUnplannedApplicationMaintenance
  • ApplicationInstallationApplicationInstallation
  • ApplicationUnresponsiveApplicationUnresponsive
  • ApplicationUnstableApplicationUnstable
  • SecurityIssueSecurityIssue
  • LossOfNetworkConnectivityLossOfNetworkConnectivity 

範例:Examples:

  1. 若要啟用五 (5) 分鐘的時間間隔以及主要原因 Planned 和次要原因 Other,請輸入︰To enable for an interval of five (5) minutes and with a major reason of Planned and minor reason Other type:

    Start-SCOMAgentMaintenanceMode -Duration 5 –Reason PlannedOther

  2. 若要啟用 10 分鐘間隔而且不指定任何原因,請輸入︰To enable for an interval of 10 minutes with no reason, type:

    Start-SCOMAgentMaintenanceMode -Duration 10

執行下列步驟,從目標 Windows 電腦啟動維護模式。Perform the following steps to initiate maintenance mode from the target Windows computer.

  1. 登入電腦。Log onto the computer.

  2. 在執行 Windows Server 2012 和更新版本的電腦上,若要以系統管理員身分從 [開始] 畫面執行 Windows PowerShell,請以滑鼠右鍵按一下 [Windows PowerShell] 磚,再按一下應用程式列的 [以系統管理員身分執行]。On computers running Windows Server 2012 and higher, to run Windows PowerShell as an administrator from the Start screen, right-click the Windows PowerShell tile, and in the app bar, click Run as administrator.

  3. 輸入 cd C:\Program Files\Microsoft Monitoring Agent\Agent將目錄切換至下列路徑 C:\Program Files\Microsoft Monitoring Agent\AgentChange directory to the following path C:\Program Files\Microsoft Monitoring Agent\Agent by typing cd C:\Program Files\Microsoft Monitoring Agent\Agent.

  4. 輸入 Import-module MaintenanceMode.dll 匯入模組 MaintenanceMode.dll。Import the module MaintenanceMode.dll by typing Import-module MaintenanceMode.dll.

  5. 輸入 Start-SCOMAgentMaintenanceMode 並使用參數設定維護模式要求。Type Start-SCOMAgentMaintenanceMode and use the parameters to configure the maintenance mode request.

注意

您可以在 Operations Manager 事件記錄檔中尋找事件識別碼 2222,後接一或多個事件識別碼為 1215 的事件。To confirm that the Maintenance Mode request is successful you can look in the Operations Manager Event Log for an Event ID 2222 followed by one or more events with Event ID 1215. 如果有事件識別碼 2222 但遺失識別碼 1215,表示遺失了維護模式要求。If Event ID 2222 is present but ID 1215 is missing, this indicates the maintenance mode request was missed. 您必須重新提出要求。You will need to re-raise the request.

您必須針對維護模式使用下列命令來移除登錄中的記錄,然後重新執行 Start-SCOMAgentMaintenanceMode Cmdlet,才能重新提出要求:Set-ItemProperty -Path "HKLM:\software\Microsoft\Microsoft Operations Manager\3.0\MaintenanceMode" -Name record -Value "" In order to re-raise the request you will need to remove the record in the registry for maintenance mode using following command and then re-run the Start-SCOMAgentMaintenanceMode cmdlet: Set-ItemProperty -Path "HKLM:\software\Microsoft\Microsoft Operations Manager\3.0\MaintenanceMode" -Name record -Value "" 

注意

要確認維護模式要求成功,請在 Operations Manager 事件記錄檔中尋找事件識別碼 2222,後接一個事件識別碼為 2223 的事件。To confirm that maintenance mode request is successful, look in the Operations Manager event log for event ID 2222 followed by an event with event ID 2223. 如果找不到事件識別碼 2223,請再次提交維護模式要求。In case event ID 2223 is not available, submit the maintenance mode request again.

排程維護模式Schedule maintenance mode

下節說明如何使用維護模式排程功能可用的不同選項。The following section describes how to work with the different options available for the maintenance mode scheduling feature.

在 Operations 主控台中建立維護排程Create Maintenance Schedule in the Operations console

下列程序說明如何在 Operations 中為選取的受監視物件建立未來日期的維護排程。The following procedure describes how to create a maintenance schedule for selected monitored objects for a future date in the Operations console.

  1. 使用屬於 Operations Manager 系統管理員角色成員的帳戶登入電腦。Log on to the computer with an account that is a member of the Operations Manager Administrators role.

  2. 在 Operations 主控台中,按一下 [系統管理] 。In the Operations console, click Administration.

  3. [系統管理] 工作區中,展開 [裝置管理] ,然後按一下 「Maintenance Schedules」 (維護排程)。In the Administration workspace, expand Device Management, and then click Maintenance Schedules.

  4. 從 [工作] 窗格按一下 [建立維護排程]。From the Tasks pane, click Create Maintenance Schedule.

  5. 在 [建立維護排程精靈] 的 [物件選擇] 頁面,按一下 [加入/移除物件...],即會顯示 [建立群組精靈 - 物件選取項目] 對話方塊。In the Create Maintenance Schedule wizard, on the Object Selection page, click Add/Remove objects... and the Create Group Wizard - Object Selection dialog box appears.

  6. 在 [建立群組精靈 - 物件選取項目] 對話方塊中執行下列作業:In the Create Group Wizard - Object Selection dialog box, perform the following:

    1. 「Search for list」 (搜尋清單) 中已選取預設項目 [電腦]In the Search for list, the default item Computer is selected. 或者,您可以從下拉式清單選取 [電腦群組] 或特定的類別,例如 [SQL Server 2012 資料庫引擎]。Alternatively, you can select Computer Group or a specific class such as SQL Server 2012 DB Engine from the drop-down list.

    2. 選擇性地在 [依名稱部分篩選] 方塊中,鍵入完整或部分物件名稱,然後按一下 [搜尋]。Optionally, in the Filter by part of the name box, type all or part of the object name, and then click Search.

    3. 在 [可用項目] 方塊中,選取所要物件,按一下 [新增],然後按一下 [確定]。In the Available items box, select the desired objects, click Add, and then click OK.

  7. 按一下 [物件選擇] 頁面的 [下一步]。On the Object Selection page, click Next.

  8. 在 [建立維護排程精靈] 的 [排程] 頁面上,您可以指定下列維護排程︰In the Create Maintenance Schedule wizard, on the Schedule page, you can specify the following for your maintenance schedule:

    1. 選擇想要排程執行的頻率。Choose the frequency as to how often you would like it to run. 如果選取 [一次] 選項,工作只會依據選取的開始日期和時間執行一次。If you select the option Once, the task will only run one time based on the start date and time selected.

    2. 在 [期間] 下選取 [開始時間],為 [結束時間] 選取 [分鐘數],或選取並輸入 [特定結束時間]。Under Duration select the Start Time and for End Time, select the number of minutes or select and enter the Specific end time.

    3. 在 [排程的生效日] 下指定允許此排程生效的時間,如在一段時間後不再需要它,按一下 [排程的到期日] 選項,選取未來的到期日。Under Schedule is effective beginning, specify when this schedule is allowed to take effect and if you require it to no longer be valid after a period of time, click the option The schedule expires on and select a future expiration date.

      注意

      [分鐘數] 的最小值為 5。The minimum value for Number of minutes is 5. 最大值為 1,051,200 (2 年)。The maximum value is 1,051,200 (2 years). 若要啟動維護模式,最長等候時間是 5 分鐘。To start the maintenance mode, the maximum wait time is 5 minutes.

  9. 一旦完成設定排程選項,請按一下 [下一步]。Click Next once you have completed configuring the schedule options.

  10. 在 [建立維護排程精靈] 的 [詳細資料] 頁面上,指定下列各項︰In the Create Maintenance Schedule wizard, on the Details page, specify the following:

    1. 在 [排程名稱] 方塊中建立排程的名稱。Create a name for the schedule in the Schedule Name box.

    2. 如果這是計劃的事件,請選取 [已計劃] ,否則維持不選取。Select Planned if this is a planned event; otherwise, leave it cleared.

    3. 在 [類別] 清單中,按一下適當的維護類別。In the Category list, click the appropriate maintenance category.

    4. 如果想要立即啟用排程,請選取 [啟用排程];如果打算稍後再啟用排程,請清除它。Select Enable Schedule if you want to enable the schedule now, or clear it if you plan on enabling the schedule later.

  11. 按一下 [完成] 以儲存您的變更。Click Finish to save your changes.

新的排程會出現在維護排程清單中,您可以編輯、停用或刪除清單中的維護排程。The new schedule will appear in the list of maintenance schedules and you can edit, disable, or delete a maintenance schedule from the list. 從清單中選取排程,再從 [工作] 窗格選擇對應的選項即可。This can be accomplished by selecting the schedule from the list and choosing the corresponding option from the Tasks pane.

在 Web 主控台中建立維護排程Create maintenance schedule in the Web console

下列程序說明如何在 Web 中為選取的受監視物件建立未來日期的維護排程。The following procedure describes how to create a maintenance schedule for selected monitored objects for a future date in the Web console.

  1. 在任何電腦上開啟網頁瀏覽器並輸入 http://<web host>/OperationsManager,其中 web host 是裝載 Web 主控台的電腦名稱。Open a web browser on any computer and enter http://<web host>/OperationsManager, where web host is the name of the computer hosting the web console.

  2. 從 Web 主控台的左窗格,按一下 [維護排程]。From the left pane in the Web console, click Maintenance Schedules.

  3. 從頁面的頂端,按一下 [+建立]。From the top of the page, click + Create.

  4. 在 [建立維護排程] 窗格中,執行下列動作:In the Create maintenance schedule pane, perform the following:

    1. 在 [搜尋類別] 中,已選取預設項目 [電腦]。In the Search for classes, the default item Computer is selected. 或者,您可以從下拉式清單選取 [電腦群組] 或特定的類別,例如 [SQL Server 2012 資料庫引擎]。Alternatively, you can select Computer Group or a specific class such as SQL Server 2012 DB Engine from the drop-down list.

    2. 選擇性地在 [依關鍵字篩選] 方塊中,輸入完整或部分的物件名稱,然後按一下 EnterOptionally, in the Filter by keyword box, type all or part of the object name, and then press Enter.

    3. 在 [可用物件] 方塊中,選取想要的物件。In the Available objects box, select the desired objects.

  5. 展開 [排程] 並在此區段中為您的維護排程指定下列項目:Expand Schedule and in this section, specify the following for your maintenance schedule:

    1. 選擇想要排程執行的頻率。Choose the frequency as to how often you would like it to run. 如果選取 [一次] 選項,工作只會依據選取的開始日期和時間執行一次。If you select the option Once, the task will only run one time based on the start date and time selected.

    2. 在 [期間] 下選取 [開始時間],為 [結束時間] 選取 [分鐘數],或選取並輸入 [特定結束時間]。Under Duration select the Start Time and for End Time, select the number of minutes or select and enter the Specific end time.

    3. 在 [排程的生效日] 下指定允許此排程生效的時間,如在一段時間後不再需要它,按一下 [排程的到期日] 選項,選取未來的到期日。Under Schedule is effective beginning, specify when this schedule is allowed to take effect and if you require it to no longer be valid after a period of time, click the option The schedule expires on and select a future expiration date.

      注意

      [分鐘數] 的最小值為 5。The minimum value for Number of minutes is 5. 最大值為 1,051,200 (2 年)。The maximum value is 1,051,200 (2 years). 若要啟動維護模式,最長等候時間是 5 分鐘。To start the maintenance mode, the maximum wait time is 5 minutes.

  6. 展開 [完成] 並在此區段中指定下列項目以完成您的自訂排程設定:Expand Completion and in this section, specify the following to complete the configuration of your custom maintenance schedule:

    1. 在 [排程名稱] 方塊中建立排程的名稱。Create a name for the schedule in the Schedule Name box.

    2. 從 [類別] 下拉式清單中,選取適當的維護類別,或將它維持為預設值 [其他 (已規劃)]。From the Category drop-down list, select the appropriate maintenance category or leave it at the default of other (Planned).

    3. (選擇性) 在 [註解] 方塊中,為已排定的維護工作輸入描述。Optionally, in the Comment box, enter a description for the scheduled maintenance task.

    4. 如果想要立即啟用排程,請選取 [啟用排程];如果打算稍後再啟用排程,請清除它。Select Enable Schedule if you want to enable the schedule now, or clear it if you plan on enabling the schedule later.

  7. 按一下 [完成] 以儲存您的變更。Click Finish to save your changes.

新的排程會出現在維護排程清單中,而且您可以編輯、停用、啟用或刪除該清單中的維護排程。The new schedule will appear in the list of maintenance schedules and you can edit, disable, enable, or delete a maintenance schedule from the list. 從該清單中選取排程,再從頁面頂端的功能表中選擇對應的選項即可。This can be accomplished by selecting the schedule from the list and choosing the corresponding option from the menu at the top of the page.

使用 SQL Always On 啟用排程維護模式Enable scheduled maintenance mode with SQL Always On

在舊版的 Operations Manager 中,當其他 SQL Server 執行個體上的複本發生容錯移轉時,以 Always On 可用性組中 SQL Server 執行個體為目標的維護排程,無法提供 Operations Manager 資料庫高可用性的功能。In earlier releases of Operations Manager, maintenance schedules that targeted instances of SQL Server in an Always On availability group to provide high availability of the Operations Manager databases did not work when failover to a replica on another SQL Server instance occurred. Operations Manager 2019 修正了這個問題以防止發生此行為,並確保維護排程會容錯移轉狀態中運作。Operations Manager 2019 includes a fix for this issue to prevent this behavior and ensures maintenance schedules work in a failover scenario.

指導方針Guidelines

  • 為了修正此問題,現有的排程會轉換到新的設計中。As part of fix for this issue, the existing schedules are converted to the new design. 這個程序會在升級至 Operations Manager 2019 時自動執行。This happens automatically while upgrading to Operations Manager 2019.

  • 系統會將在上述作業中遭受的任何失敗情況,擷取到下列資料庫表中:[OperationsManager].[dbo].[MaintenanceModeSchedulesMigrationLogs]Any failures in the above operation are captured in the following database table: [OperationsManager].[dbo].[MaintenanceModeSchedulesMigrationLogs]

  • 若有無法轉換至新設計的排程,應該在 Operations Manager 資料庫中執行下列指令碼以進行手動轉換。Schedules which fail to get converted to the new design, should be converted manually by executing the following scripts against the Operations Manager database. EXEC [dbo].[p_MaintenanceScheduleMigrateSchedule] '' 範例:EXEC [dbo].[p_MaintenanceScheduleMigrateSchedule] '1A6917C6-999C-E811-837B-02155DC77B3F'EXEC [dbo].[p_MaintenanceScheduleMigrateSchedule] '' Example: EXEC [dbo].[p_MaintenanceScheduleMigrateSchedule] '1A6917C6-999C-E811-837B-02155DC77B3F'

  • 若要將所有排程轉換至新設計中,請使用以下命令: Delete [OperationsManager].[dbo].[MaintenanceModeSchedulesMigrationLogs] EXEC [dbo].[p_MaintenanceScheduleMigrateExistingSchedules]To convert all the schedules to the new design, use the following command: Delete [OperationsManager].[dbo].[MaintenanceModeSchedulesMigrationLogs] EXEC [dbo].[p_MaintenanceScheduleMigrateExistingSchedules]

    注意

    部署升級之後,可能會觸發維護排程且最多延遲五 (5) 分鐘。After you deploy the upgrade, maintenance schedules might be triggered and have a maximum delay of five (5) minutes. 您可以覆寫維護模式規則,設定延遲的時間上限。You can configure the maximum delay by overriding the Maintenance Mode rule. 預設的 5 分鐘時間是為了避免大幅降低系統效能。The default value five minutes is to avoid causing a large performance decrease on the system.

排程重疊期間的最久結束時間Furthest end time during schedule overlap

注意

此功能適用於 UR2 和更新版本。This feature is applicable from UR2 and later.

目前如果物件的維護模式時段發生衝突,則新更新的結束時間會覆寫現有的排程時間。Currently, if there is a conflict in maintenance mode window for object(s), the newly updated end time overwrites the existing scheduled time. 而若最新的定義時間超過原本定義的時間,則電腦會按照新的時間停留在維護模式中。If the latest defined time is longer than previous value, then computer stays in maintenance mode for extended period. 但是,當最新的定義時間較短時,電腦則會在預期的時間之前離開維護模式,產生錯誤警示。However, when the latest defined time is shorter, then the computer comes out of maintenance mode, earlier than expected, generating false alerts.

例如,使用者 Dan 會在 Redmond 的所有代理程式中排程從上午 8 點到下午 3 點的每星期二進行維護。For example, user Dan schedules maintenance every Tuesday from 8AM – 3PM on all the agents in Redmond. 使用者 Ryan 會針對所有執行 SQL 伺服器的代理程式,建立另一個上午 10 點到下午 12 點的排程,在每個星期二啟動維護模式。User Ryan creates another schedule post Dan to start maintenance mode every Tuesday for all the agents running SQL server from 10AM-12PM. 執行 SQL 伺服器的 Redmond 中有 500 個代理程式,而這些代理程式現在會在下午12 點結束維護模式,而 Dan 會收到這些代理程式的錯誤警示和票證。There are 500 agents located in Redmond running SQL server and now they will exit maintenance mode at 12PM and Dan will receive false alerts and tickets for these agents.

上述案例所產生的錯誤警示,可能會花費大量的金錢和時間,讓組織無法解決真正重要的問題。False alerts generated by above scenario can cost a lot of money, time, and delay in addressing the real issues for an organization. 在更新彙總套件 2 中,如果某個物件正在執行多個 MM 排程,則最久的結束時間將會覆寫任何其他定義的結束時間。From Update Rollup 2, if multiple MM schedules are running for an object, furthest end time will overwrite any other defined end time.

使用 2019 UR2 時,若維護模式的結束時間發生衝突,則物件會在為物件所定義的最遠結束時間結束維護模式。With 2019 UR2, if there is a conflict in maintenance mode end time then object will exit maintenance mode at the furthest end time defined for the object. 在上述範例中,位於 Redmond 且具有 SQL 伺服器的伺服器將會在下午 3 點結束維護模式,這是為系統定義的最久結束時間。For the example above, servers which are in Redmond and have SQL server will exit maintenance mode at 3PM which is the furthest end time defined for them.

後續步驟Next steps

建立和管理群組Create and manage groups