如何和何時清除快取How and When to Clear the Cache

重要

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

在 System Center Operations Manager 中,針對 Operations 主控台或代理程式問題進行疑難排解時,您可能會看到「清除快取」的建議。In System Center Operations Manager, when troubleshooting an issue with the Operations console or with an agent, you may see recommendations to "clear the cache." 如需針對代理程式問題進行疑難排解的其他資訊,請參閱未受監視和灰色代理程式For additional information about troubleshooting an issue with an agent, see Not monitored and gray agents.

清除快取To clear the cache

下表說明如何和何時清除主控台快取或代理程式快取。The following table explains how and when to clear the console cache or agent cache.

快取Cache 如何清除How to clear When 結果Results
Operations 主控台Operations console 使用 /clearcache 參數來開啟 Operations 主控台。Open the Operations console with the /clearcache parameter. 如果您嘗試在檢視中擷取資料時發生錯誤 (例如 ObjectNotFoundExceptions),或是快取檔案成長地太大,而且您想要減少其在磁碟上的大小,請使用此方法來開啟 Operations 主控台。Use this method to open the Operations console if you experience errors trying to retrieve data in views, such as ObjectNotFoundExceptions, or when the cache file grows too large and you want to reduce its size on disk. 使用Opening the Operations console with
/clearcache 開啟 Operations 主控台時會刪除下列檔案:/clearcache deletes the following file:

%systemdrive%\Users*使用者名稱*\AppData%systemdrive%\Users*username*\AppData\
Local\MicrosoftLocal\Microsoft\
Microsoft.EnterpriseManagement.Monitoring.ConsoleMicrosoft.EnterpriseManagement.Monitoring.Console\
momcache.mdbmomcache.mdb
代理程式管理的電腦上的健全狀況服務Health service on agent-managed computer 1.在 [監視] 工作區中,展開 [Operations Manager] 1. In the Monitoring workspace, expand Operations Manager
然後展開 [代理程式詳細資料] 。and then expand Agent Details.
2.按一下 [代理程式健全狀況狀態] 。2. Click Agent Health State.
3.在 [代理程式狀態] 中,選取代理程式。3. In Agent State, select an agent.
4.在 [工作] 窗格中,按一下 [排清健全狀況服務狀態及快取] 。4. In the Tasks pane, click Flush Health Service State and Cache.
解除安裝並重新安裝代理程式之前,對代理程式問題進行疑難排解時,這應該是最後一個步驟。This should be the final step when troubleshooting issues with the agent, before uninstalling and reinstalling the agent. 清除代理程式快取可能會導致下列項目的資料遺失:Clearing the agent cache can cause data loss
該系統中的監視資料。of monitoring data from that system.

1.停止 Microsoft Monitoring Agent 服務。1. Stops the Microsoft Monitoring Agent service.
2.刪除健全狀況服務存放區檔案。2. Deletes the health service store files.
3.重設代理程式的狀態,包含所有規則、3. Resets the state of the agent, including all rules,
監視器、傳出資料,以及快取的monitors, outgoing data, and cached
管理組件。management packs.
4.啟動 Microsoft Monitoring Agent 服務。4. Starts the Microsoft Monitoring Agent service.

服務重新啟動時,代理程式會要求When the service restarts, the agent requests
來自其主要已指派configuration from its primary assigned
管理伺服器的設定。management server.
請注意: 因為此工作會刪除健全狀況服務Note: Because this task deletes the cached data
存放區檔案中的快取資料in the health service store files,
(包含這項工作本身的記錄),including the record of this task itself,
所以在工作完成時不會回報no task status is reported
任何工作狀態。on completion of the task.
管理伺服器上的健全狀況服務Health service on management server 1.在 [監視] 工作區中,展開 [Operations Manager] 1. In the Monitoring workspace, expand Operations Manager
然後展開 [管理伺服器] 。and then expand Management Server.
2.按一下 [管理伺服器狀態] 。2. Click Management Servers State.
3.在 [管理伺服器狀態] 中,選取管理伺服器。3. In Management Server State, select a management server.
4.在 [工作] 窗格中,按一下 [排清健全狀況服務狀態及快取] 。4. In the Tasks pane, click Flush Health Service State and Cache.
如果管理伺服器未運作、重新啟動尚未修正問題,而且您已耗盡其他疑難排解選項,請在管理伺服器上執行這項工作。Run this task on a management server when the management server is not functional, a restart has not fixed the problem, and you have exhausted other troubleshooting options. 清除代理程式快取可能會導致Clearing the agent cache can cause
從代理程式到管理伺服器之data loss of monitoring data from
監視資料的資料遺失。agents to the management server.

1.停止 Microsoft Monitoring Agent 服務。1. Stops the Microsoft Monitoring Agent service.
2.刪除健全狀況服務存放區檔案。2. Deletes the health service store files.
3.重設代理程式的狀態,包含所有規則、3. Resets the state of the agent, including all rules,
監視器、傳出資料,以及monitors, outgoing data, and
快取的管理組件。cached management packs.
4.啟動 Microsoft Monitoring Agent 服務。4. Starts the Microsoft Monitoring Agent service.
注意︰ 因為此工作會刪除健全狀況服務Note: Because this task deletes the cached
存放區檔案中的快取資料data in the health service store files,
(包含這項工作本身的記錄),including the record of this task itself,
所以在工作完成時將不會回報no task status will be reported
任何工作狀態。on completion of the task.

後續步驟Next steps