The server principal "sa" is not able to access the database "xxxx" under the current security context

简介: 在SQL Server服务器上一个作业执行时,遇到下面错误信息: Message: Executed as user: dbo. The server principal "sa" is not able to access the database "xxxx" under the current security context. [SQLSTATE 08004] (Error 916). The step failed.   作业本身执行的存储过程非常简单,就是将数据库A中的历史数据处理过后,归档到A_History库中,结果就遇到这么一个问题。

在SQL Server服务器上一个作业执行时,遇到下面错误信息:

Message:

Executed as user: dbo. The server principal "sa" is not able to access the database "xxxx" under the current security context. [SQLSTATE 08004] (Error 916). The step failed.

clipboard

 

作业本身执行的存储过程非常简单,就是将数据库A中的历史数据处理过后,归档到A_History库中,结果就遇到这么一个问题。将作业的存储过程取出在SSMS客户端执行成功,没有问题,但是作业执行就遇到这个从我。后面折腾了一下,终于弄清楚了原委。 原来这个作业步骤的“Advanced”选项里面,设置成了Run as user 为dbo。

clipboard[1]

 

取消这个选项,问题即可解决。个人设置作业时从不设置此选项,但是有一些开发人员创建的作业就设置了此处选项,结果遇到了这个问题。

 

另外。我这篇博客SQL Agent Job 报“Access to the remote server is denied because the current security context is not trusted”里面遇到的其实也是这个问题。可笑当时虽然解决了,阴错阳差的解决了问题,但是还是没有找到Root Cause。 以此为戒!

 

相关文章
|
SQL 关系型数据库 MySQL
云服务器 ECS产品使用问题之出现“1044 - Access denied for user ‘root‘@‘%‘ to database ‘数据库名称‘”这样的错误,该怎么办
云服务器ECS(Elastic Compute Service)是各大云服务商阿里云提供的一种基础云计算服务,它允许用户租用云端计算资源来部署和运行各种应用程序。以下是一个关于如何使用ECS产品的综合指南。
|
安全 关系型数据库 MySQL
openvas报错Warning: Secinfo Database Missing SCAP and/or CERT database missing on OMP server.
openvas报错Warning: Secinfo Database Missing SCAP and/or CERT database missing on OMP server.
数据库bug-[08001] Could not create connection to database server. Attempted reconnect 3,主机名ip必须写对
数据库bug-[08001] Could not create connection to database server. Attempted reconnect 3,主机名ip必须写对
|
SQL Oracle 安全
Oracle Database Vault Access Control Components
Oracle Database Vault Access Control Components
236 0
|
关系型数据库 MySQL PHP
解决typecho出现“Database Server Error”错误
解决typecho出现“Database Server Error”错误
277 1
解决typecho出现“Database Server Error”错误
|
安全 关系型数据库 MySQL
【报错】sqli-labs靶场搭建出现“Unable to connect to the database: security”
【报错】sqli-labs靶场搭建出现“Unable to connect to the database: security”
2173 0
|
数据库
Could not create connection to database server. Attempted reconnect 3 times. Giving up.
Could not create connection to database server. Attempted reconnect 3 times. Giving up.
480 0
|
Java 关系型数据库 MySQL
报错:java.sql.SQLNonTransientConnectionException: Could not create connection to database server
报错:java.sql.SQLNonTransientConnectionException: Could not create connection to database server
4026 0
报错:java.sql.SQLNonTransientConnectionException: Could not create connection to database server
|
关系型数据库 MySQL PHP
解决typecho出现“Database Server Error”错误
解决typecho出现“Database Server Error”错误
638 0
解决typecho出现“Database Server Error”错误
|
SQL 缓存 算法
Access Path Selection in a Relational Database Management System
如果说选一篇在优化器框架上,被引用次数最多的文献,应该非这篇论文莫属了,还记得Andy Pavlo在cmu的课程中提到IBM Research的一群大神们,是怎么一人一个模块来负责System R的设计的,而关于Join order enumeration,Selinger可以说是开创了dynamic programing based 的bottom-up的搜索空间算法的先河,直至今日,很多成熟的商业或开源数据库系统仍在沿用这套框架,比如Oracle / DB2 / PostgreSQL ...
836 0
Access Path Selection in a Relational Database Management System

热门文章

最新文章