SCM 服務 - 設定 SQL Server 錯誤記錄檔SCM Services - Configure SQL Server Error Logs

適用於: 是SQL Server 否Azure SQL Database 否Azure Synapse Analytics (SQL DW) 否平行處理資料倉儲 APPLIES TO: yesSQL Server noAzure SQL Database noAzure Synapse Analytics (SQL DW) noParallel Data Warehouse

此主題描述如何檢視或修改 SQL ServerSQL Server 錯誤記錄檔的回收方式。This topic describes how to view or modify the way SQL ServerSQL Server error logs are recycled.

若要開啟 [設定 SQL Server 錯誤記錄檔] 對話方塊To open the Configure SQL Server Error Logs dialog box

  1. 在 [物件總管] 中展開 SQL Server 執行個體,展開 [管理] ,以滑鼠右鍵按一下 [SQL Server 記錄檔] ,然後按一下 [設定] 。In Object Explorer, expand the instance of SQL Server, expand Management, right-click SQL Server Logs, and then click Configure.

  2. [設定 SQL Server 錯誤記錄檔] 對話方塊中,從下列選項中進行選擇。In the Configure SQL Server Error Logs dialog box, choose from the following options.

    A.a. 記錄檔計數Log files count

    限制回收錯誤記錄檔之前,所允許的檔案數目Limit the number of the error log files before they are recycled

    核取進行錯誤記錄檔的回收之前,可建立之錯誤記錄檔的數目。Check to limit the number of error logs created before they are recycled. 每次啟動 SQL ServerSQL Server 的執行個體,就會建立一個新的錯誤記錄檔。A new error log is created each time an instance of SQL ServerSQL Server is started. SQL ServerSQL Server 會保留前六個記錄檔備份,除非您核取此選項,並在下面另行指定錯誤記錄檔的最大數目。retains backups of the previous six logs, unless you check this option, and specify a different maximum number of error log files below.

    錯誤記錄檔的最大數目Maximum number of error log files

    指定回收之前建立之錯誤記錄檔的最大數目。Specify the maximum number of error log files created before they are recycled. 預設值為 6,這是回收錯誤記錄檔之前,SQL ServerSQL Server 保留的現有一個備份記錄檔與五個先前備份記錄檔。The default is 6, one current and the 5 previous backup logs that SQL ServerSQL Server retains before recycling them.

    B.b. 記錄檔大小Log file size

    錯誤記錄檔大小上限 (KB)Maximum size for error log file in KB

    您可以設定每個檔案的大小量 (以 KB 為單位)。You can set the size amount of each file in KB. 如果您將其保留為 0,則記錄大小不受限制。If you leave it at 0 the log size is unlimited.