迁移sqlserver2000的一个优化的job到另外一台机器,直接从agent job中拷贝的脚本,
EXECUTE master.dbo.xp_sqlmaint N'-PlanID CA94858E-18C4-4712-9FC8-1D43369D2AB2 -Rpt "D:\Program Files\Microsoft SQL Server\MSSQL\LOG\DBMP30.txt" -DelTxtRpt 4WEEKS -WriteHistory -RebldIdx 20 -RmUnusedSpace 50 10 '
运行时报错Error 22029,
在DBMP30.txt中看到报错:
Microsoft (R) SQLMaint Utility (Unicode), Version Logged on to SQL Server 'JRZAPPDB' as 'NT AUTHORITY\SYSTEM' (trusted)
[Microsoft SQL-DMO] Error 21268: [SQL-DMO]Row or column specified is outside the range of the specified query result set.
在网上搜了下, 原来是plan iD的问题,因为用的之前DB的plan ID,在新DB中不存在,于是重新创建了一个,将ID填入就可以了。
查看PLAN_ID方法
select * from sysdbmaintplan_databases
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/23154475/viewspace-718997/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/23154475/viewspace-718997/
解决SQL Server 2000作业迁移过程中遇到的Error22029错误,通过更改PLAN_ID来适应新数据库环境。
2751

被折叠的 条评论
为什么被折叠?



