監視錯誤記錄Monitoring the Error Logs

本主題適用於: 是SQL Server (僅限 Windows)否Azure SQL Database否Azure SQL 資料倉儲否平行處理資料倉儲 THIS TOPIC APPLIES TO: yesSQL Server (Windows only)noAzure SQL DatabasenoAzure SQL Data WarehousenoParallel Data Warehouse

[SQL Server]SQL Server 將特定系統事件和使用者自訂事件記錄到 [SQL Server]SQL Server 錯誤記錄檔和 MicrosoftMicrosoft Windows 應用程式記錄檔中。 logs certain system events and user-defined events to the [SQL Server]SQL Server error log and the MicrosoftMicrosoft Windows application log. 這兩種記錄檔都會自動替所有記錄的事件加入時間戳記。Both logs automatically timestamp all recorded events. 請使用 [SQL Server]SQL Server 錯誤記錄檔中的資訊來解決 [SQL Server]SQL Server的相關問題。Use the information in the [SQL Server]SQL Server error log to troubleshoot problems related to [SQL Server]SQL Server.

Windows 應用程式記錄檔可針對 Windows 作業系統上所發生的事件,以及 [SQL Server]SQL Server[SQL Server]SQL Server Agent 中的事件,提供整體描述。The Windows application log provides an overall picture of events that occur on the Windows operating system, as well as events in [SQL Server]SQL Server and [SQL Server]SQL Server Agent. 使用「Windows 事件檢視器」可檢視 Windows 應用程式記錄檔,以及篩選資訊。Use the Windows Event Viewer to view the Windows application log and to filter the information. 例如,您可以篩選事件,例如資訊、警告、錯誤、成功稽核與失敗稽核。For example, you can filter events, such as information, warning, error, success audit, and failure audit.

比較錯誤與應用程式記錄輸出Comparing Error and Application Log Output

您可以同時使用 [SQL Server]SQL Server 錯誤記錄檔和 Windows 應用程式記錄檔,來找出問題的原因。You can use both the [SQL Server]SQL Server error log and the Windows application log to identify the cause of problems. 例如,在監視 [SQL Server]SQL Server 錯誤記錄檔時,您可能會收到不含原因資訊的錯誤訊息。For example, while monitoring the [SQL Server]SQL Server error log, you may encounter error messages that do not contain cause information. 藉由比較這些記錄之間的事件日期和時間,可以縮小可能原因的範圍。By comparing the dates and times for events between these logs, you can narrow the list of probable causes. Transact-SQLSQL Server Management Studio 記錄檔檢視器可讓您將 [SQL Server]SQL Server[SQL Server]SQL Server Agent 與 Windows 記錄檔整合為一份清單,以便輕鬆地了解相關的伺服器事件與 [SQL Server]SQL Server 事件。The Transact-SQLSQL Server Management Studio Log File Viewer lets you integrate [SQL Server]SQL Server, [SQL Server]SQL Server Agent, and the Windows logs into a single list, making it easy to understand related server events and [SQL Server]SQL Server events. 如需詳細資訊,請參閱《SQL Server 線上叢書》中的<記錄檔檢視器>主題。For more information, see the topic "Log File Viewer" in SQL Server Books Online.

本節內容In This Section

主題Topic DescriptionDescription
檢視 SQL Server 錯誤記錄Viewing the SQL Server Error Log 包含 [SQL Server]SQL Server 錯誤記錄檔及其檢視方式的詳細資訊。Contains information about the [SQL Server]SQL Server error log and how to view it.
檢視 Windows 應用程式記錄Viewing the Windows Application Log 包含 Windows 應用程式記錄檔及其檢視方式的詳細資訊。Contains information about the Windows application log and how to view it.