SQL 维护作业失败:“无效的对象名称‘Confluence.sys.Partitions’。将数据库上下文更改为‘主’
Posted
技术标签:
【中文标题】SQL 维护作业失败:“无效的对象名称‘Confluence.sys.Partitions’。将数据库上下文更改为‘主’【英文标题】:SQL maintenance job failing: "Invalid object name 'Confluence.sys.Partitions'. Changed database context to 'master' 【发布时间】:2020-05-18 08:50:44 【问题描述】:我的数据库名为“Confluence”。维护作业自 6 个月前设置以来一直失败。尝试手动运行作业也会失败并出现同样的错误。
Executed as user: NT Service\SQLSERVERAGENT. Microsoft (R) SQL Server Execute Package Utility Version 11.0.2100.60 for 64-bit Copyright (C) Microsoft Corporation. All rights reserved.
Started: 1:00:00 AM Progress: 2020-05-12 01:00:05.53
Source: AB5561C0-62BD-4185-A869-1AD993B98428
Executing query "DECLARE @Guid UNIQUEIDENTIFIER
EXECUTE msdb..sp...".: 100% complete End Progress
Error: 2020-05-12 01:02:57.66 Code: 0xC002F210
Source: Execute T-SQL Statement Task Execute SQL Task
Description: Executing the query "use master; exec ap_RebuildIndexes 30, 80, 'Confl..." failed with the following error: "Invalid object name 'Confluence.sys.Partitions'. Changed database context to 'master'. ".
Possible failure reasons: Problems with the query, "ResultSet" property not set correctly, parameters not set correctly, or connection not established correctly. End Error Warning: 2020-05-12 01:02:57.66 Code: 0x80019002 Source: Subplan_1 Description: SSIS Warning Code DTS_W_MAXIMUMERRORCOUNTREACHED. The Execution method succeeded, but the number of errors raised (1) reached the maximum allowed (1); resulting in failure. This occurs when the number of errors reaches the number specified in MaximumErrorCount. Change the MaximumErrorCount or fix the errors. End Warning DTExec: The package execution returned DTSER_FAILURE (1). Started: 1:00:00 AM Finished: 1:02:58 AM Elapsed: 177.607 seconds. The package execution failed. The step failed.
附加的屏幕截图显示了实际的维护工作(重建索引,然后更新称为“Confluence”的数据库的统计信息)。
你能帮忙吗?
SQL Server 实例是 SQL 2012 (SP1)。
【问题讨论】:
这能回答你的问题吗? How to solve 'invalid object name' in SQL Server? 【参考方案1】:我的提示:
Confluence 数据库在此服务器上不再存在或已重命名 数据库的默认排序规则已更改为区分大小写 检查或调试该存储过程或将其 CREATE PROC 脚本 (sp_RebuildIndexes) 发送给我们【讨论】:
以上是关于SQL 维护作业失败:“无效的对象名称‘Confluence.sys.Partitions’。将数据库上下文更改为‘主’的主要内容,如果未能解决你的问题,请参考以下文章
SQL Server 2008 R2中配置作业失败后邮件发送通知
添加Sql作业,新建步骤出现:从IClassFactory为CLSID为{AA40D1D6-CAEF-4A56-B9BB-D0D3DC976BA2}的COM组件创建实例失败