SQL Server 2005 Service Broker Error 15517

http://btburnett.com/2008/05/sql-server-2005-service-broker-error-15517.html

 

Sometimes I’ve run into the following error in the event log when using the service broker to do SQL command notifications with SQL 2005:

An exception occurred while enqueueing a message in the target queue. Error: 15517, State: 1. Cannot execute as the database principal because the principal “dbo” does not exist, this type of principal cannot be impersonated, or you do not have permission.

It tends to fill up the event log pretty badly when you see it.  I’ve especially seen it when I move the database from one server to another.  To fix it, use this command:

ALTER AUTHORIZATION ON DATABASE::[dbname] TO [SA]

This should fix it for you.

 

 

sp_cycle_errorlog
关闭当前的错误日志文件,并循环错误日志扩展编号(就像重新启动服务器)。新错误日志包含版本和版权信息,以及表明新日志已创建的一行。

语法
sp_cycle_errorlog

返回代码值
0(成功)或 1(失败)

结果集

注释
每次启动 SQL Server 时,当前错误日志重新命名为 errorlog.1;errorlog.1 成为 errorlog.2,errorlog.2 成为 errorlog.3,依次类推。sp_cycle_errorlog 使您得以循环错误日志文件,而不必停止而后再启动服务器。

权限
sp_cycle_errorlog 的执行许可权限仅限于 sysadmin 固定服务器角色的成员。

示例
EXEC sp_cycle_errorlog

 

 


DBCC ERRORLOG,执行一次,切换一次新文件,切换6次,那个大文件就消失了~

 

 

 

你可能感兴趣的:(SQL Server 2005 Service Broker Error 15517)