代码改变世界

MS SQL Could not obtain information about Windows NT group/user 'domain\login', error code 0x5. [SQLSTATE 42000] (Error 15404)

2013-09-25 20:13  潇湘隐者  阅读(2920)  评论(1编辑  收藏  举报

最近碰到一个有趣的错误:海外的一台数据库服务器上某些作业偶尔会报错,报错信息如下所示:

-------------------------------------------------------------------------------------------------------------------------------------------------

日期 2013/9/15 12:00:00

日志 作业历史记录 (JOB_SYNCHRONIZING_ESCM_DATA_EAV)

步骤 ID 0

服务器 EGVNT02

作业名称 JOB_SYNCHRONIZING_ESCM_DATA_EAV

步骤名称 (Job outcome)

持续时间 00:04:34

SQL 严重性 0

SQL 消息 ID 0

已通过电子邮件通知的操作员

已通过网络发送通知的操作员

已通过寻呼通知的操作员

重试次数 0

消息

The job failed.  Unable to determine if the owner (domain\login) of job JOB_SYNCHRONIZING_ESCM_DATA_EAV has server access (reason: Could not obtain information about Windows NT group/user 'domain\login', error code 0x5. [SQLSTATE 42000] (Error 15404)).

-------------------------------------------------------------------------------------------------------------------------------------------------

 

 该数据库版本为Microsoft SQL Server 2008 R2 (RTM) - 10.50.1600.1 (X64)  ,使用domain\login创建的作业,该domain\login拥有sysadmin服务器角色,但是该服务器所属的是domain A, 而且不属于该系统下的Administator组成员。关于该数据库相关服务的登录账号如下所示:

clip_image002

 从网上搜索到资料如下所示:

This message is thrown if the SQL Server service uses an account that does not have sufficient administrative credentials on the Windows domain. In this situation, the xp_logininfo system stored procedure is run by using the security context of the SQL Server service. Because the account does not have sufficient administrative credentials to enumerate the properties of the user in the domain, the xp_logininfo system stored procedure fails, and you receive the 8198 error. To resolve this problem, change the startup account of the SQL Server service to a Windows domain account.

We need to either run the SQL service under domain account or use SQL authentication

 

翻译如下(仅供参考)如果SQL Server服务使用的帐户没有足够管理凭据,将会抛出此错误消息。对Windows域。在这种情况下,xp_logininfo系统存储过程使用SQL Server服务的安全上下文中运行。因为帐户没有足够的安全凭据,枚举用户在域的属性,xp_logininfo系统存储过程失败,您会收到8198错误。为了解决这个问题,更改SQL Server服务的启动帐户到Windows域帐户。

我们需要用域帐户或使用SQL身份验证运行SQL服务。

其实要解决这个问题也很方便,只需将作业的owner改为sa或本地域下拥有sysadmin角色的账号即可解决问题。但是对问题的本质还是迷糊,为什么大部分时候就能成功执行,偶尔就会出现这个错误呢?这点一直没让我弄明白。

 

参考资料:

http://www.sqldbadiaries.com/2011/02/25/unable-to-determine-if-the-owner-of-job-has-server-access/

http://www.sqlserver-wiki.com/2012/11/could-not-obtain-information-about.html