sp_configure命令开启组件Agent XPs,数据库计划(Maintenance Plan)

9/1/2015来源:SQL技巧人气:3762

sp_configure命令开启组件Agent XPs,数据库计划(Maintenance Plan)新建“计划(Maintenance Plan)”时,记得执行计划需把SQL的“代理服务(SQL ServerAgent)”也开启出现对话框:“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 go3 reconfigure;4 go5 6 sp_configure 'Agent XPs', 1;7 go8 reconfigure;9 go 

数据库计划的使用场景:开启“代理服务(SQL Server Agent)”,新建“计划(Maintenance Plan)”,每周三、周五、周日晚上1点钟执行备份计划,进行完全备份KenmuPortal数据库,备份文件存放在“C:\KenmuTemp\BackUp”文件夹中,只保存最新一周的bak备份文件。ipYtGK0p8sK5u/XPHoyqITJ48C6QEuCIxfQB1ZzAmkBygv0D6edufl/cU4yvWNgPUAHwrHhh9ZWvyvD8kfekq1ZHXV/CcUt+srfMdbyv/NvptnnZd3pyAifWteXt7fGLHB9o37i0w7H3yy8uFlqiXL5fNXVS1YoXzoied57moOCwARymGBHBYAMnxrG4gQ4MG8vP982CCQDhI7/+RK8UPLlYufkv5k6dqHnim94y3it0r+gXte3v8eyFqjpcTweqWiR6bcuVHTXmrcuabGKtb2PK/et/GFRoW+YYWuu8LcJNPuX6XdVrnJusGwt0RrlVS/sVHbUaLdLte9olS0PVfTW6bY/ky1rUz5Zrluh9TYWWw4UGCwlQQtxYZtYrNto9ZSoust1dSvramTm16Xqw9IzM2rTDulysYi7QGxylpoaC2t3rPBWFem3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