Rahman Agoro, the frontline SQL DBA

Just another WordPress.com weblog

SQL 2014 Replication Error The process could not execute ‘sp_replcmds’ on ‘xxxxxxxxxxxx’. (Source: MSSQL_REPL, Error number: MSSQL_REPL20011)

Posted by rahmanagoro on October 20, 2016


After spending some time away from SQL replication (SQL 2014), I find myself working with this brilliant piece of technology again. In this particular case I had to test, support and troubleshoot replication even without having any knowledge of its setup.

I had this error come up during one of my investigations when I check the log reader agent within SQL server replication monitor.

Error messages:

  • The process could not execute ‘sp_replcmds’ on ‘XXXServerXXX’. (Source: MSSQL_REPL, Error number: MSSQL_REPL20011)
    Get help: http://help/MSSQL_REPL20011
  • 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. (Source: MSSQLServer, Error number: 15517)
    Get help: http://help/15517
  • The process could not execute ‘sp_replcmds’ on ‘XXXSERVERXXX’. (Source: MSSQL_REPL, Error number: MSSQL_REPL22037)
    Get help: http://help/MSSQL_REPL22037

 

After doing some investigations, I found that the database in question didn’t have an owner specified.

I changed the owner of the database and hey pronto, the agent started to work again.

 

Use DatabaseName
GO
sp_changedbowner 'sa'
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

 
%d bloggers like this: