Resize the Job History LogResize the Job History Log

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

重要

Azure SQL Database 受控執行個體目前支援多數 (但非全部) 的 SQL Server Agent 功能。On Azure SQL Database Managed Instance, most, but not all SQL Server Agent features are currently supported. 如需詳細資料,請參閱 Azure SQL Database 受控執行個體與 SQL Server 之間的 T-SQL 差異See Azure SQL Database Managed Instance T-SQL differences from SQL Server for details.

此主題描述如何使用 SQL Server Management StudioSQL Server Management Studio 設定 MicrosoftMicrosoft SQL ServerSQL Server Agent 作業記錄的大小限制。This topic describes how to set size limits for MicrosoftMicrosoft SQL ServerSQL Server Agent job history logs by using SQL Server Management StudioSQL Server Management Studio.

開始之前Before You Begin

安全性Security

如需詳細資訊,請參閱< 實作 SQL Server Agent 安全性>。For detailed information, see Implement SQL Server Agent Security.

使用 SQL Server Management StudioUsing SQL Server Management Studio

根據原始大小調整作業記錄大小To resize the job history log based on raw size

  1. [物件總管] 中,連接到 SQL Server Database EngineSQL Server Database Engine的執行個體,然後展開該執行個體。In Object Explorer, connect to an instance of the SQL Server Database EngineSQL Server Database Engine, and then expand that instance.

  2. 以滑鼠右鍵按一下 [SQL Server Agent] ,然後按一下 [屬性] 。Right-click SQL Server Agent, and then click Properties.

  3. 選取 [記錄] 頁面,然後確認已選取 [限制作業記錄大小] 。Select the History page, and then confirm that Limit size of job history log is checked.

  4. [最大作業記錄大小] 方塊中,輸入作業記錄所允許的最大資料列數。In the Maximum job history log size box, enter the maximum number of rows the job history log should allow.

  5. [每項作業的作業記錄最大資料列數] 方塊中,輸入作業所允許的最大作業記錄資料列數。In the Maximum job history rows per job box, enter the maximum number of job history rows to allow for a job.

根據時間調整作業記錄大小To resize the job history log based on time:

  1. [物件總管] 中,連接到 SQL Server Database EngineSQL Server Database Engine的執行個體,然後展開該執行個體。In Object Explorer, connect to an instance of the SQL Server Database EngineSQL Server Database Engine, and then expand that instance.

  2. 以滑鼠右鍵按一下 [SQL Server Agent] ,然後按一下 [屬性] 。Right-click SQL Server Agent, and then click Properties.

  3. 選取 [記錄] 頁面,然後按一下 [自動移除代理程式記錄]Select the History page, and then click Automatically remove agent history.

  4. 選取適當的 [天] 、[週] 或 [月] 數。Select the appropriate number of Days, Weeks, or Months.