新建“計划(Maintenance Plan)”時,記得執行計划需把SQL的“代理服務(SQL Server Agent)”也開啟
出現對話框
:“SQL Server 阻止了對組件 'Agent XPs' 的 過程 'dbo.sp_set_sqlagent_properties' 的訪問,因為此組件已作為此服務器安全配置的一部分而被關閉。SQL Server 阻止了對組件 'Agent XPs' 的 過程 'dbo.sp_set_sqlagent_properties' 的訪問,因為此組件已作為此服務器安全配置的一部分而被關閉。系統管理員可以通過使用 sp_configure 啟用 'Agent XPs'。有關啟用 'Agent XPs' 的詳細信息,請參閱 SQL Server 聯機叢書中的 "外圍應用配置器"。 (.Net SqlClient Data Provider) 。”
執行下面SQL語句進行解決:
1 sp_configure 'show advanced options', 1; 2 go 3 reconfigure; 4 go 5 6 sp_configure 'Agent XPs', 1; 7 go 8 reconfigure; 9 go
數據庫計划的使用場景:
開啟“代理服務(SQL Server Agent)”,新建“計划(Maintenance Plan)”,每周三、周五、周日晚上1點鍾執行備份計划,進行完全備份KenmuPortal數據庫,備份文件存放在“C:\KenmuTemp\BackUp”文件夾中,只保存最新一周的bak備份文件。
結果: