LogReader fails with Cannot execute as the database principal because the principal "dbo" does not exist

LogReader fails with error 15517:

2010-02-25 21:16:35.054 Status: 0, code: 20011, text: 'The process could not execute 'sp_replcmds' on 'CHRISSKACER'.'.
2010-02-25 21:16:35.056 The process could not execute 'sp_replcmds' on 'CHRISSKACER'.
2010-02-25 21:16:35.057 Status: 0, code: 15517, text: '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.'.
2010-02-25 21:16:35.058 Status: 0, code: 22037, text: 'The process could not execute 'sp_replcmds' on 'CHRISSKACER'.'.

The SQL Agent was configured to run using 'ChrisSkAcer\Chris'.  In login properties, this account has “system administrator” rights.  To eliminate JOB properties or SQL Agent authentication  as problem, tried running LogRead.exe from CMD prompt while logged on using the same administrator count.

c>logread.exe -Publisher [CHRISSKACER] -PublisherDB [AdventureWorksLT] -Distributor [CHRISSKACER] -DistributorSecurityMode 1 -continuous

>>same error.

--Connected to Publisher via SSMS and executed LogReader "read" stored proc as 'sa'


>>same error.

--display SQL Server login token (also called Security ID or SID)
select * from sys.login_token


--display dbo token in Published database
USE <Published DatabaseName>

select * from sys.user_token

>> dbo 0xA065CF7E784B9B5FE77C87709C280100

--confirms the DBO SID doesn't match login SID
--Change owner


sp_changedbowner 'ChrisSkAcer\Chris'

>> error login was already user in the database

--The login was a user, but not DBO
--DROP data base USER 'ChrisSkAcer\Chris' and added user back as DBO.

sp_changedbowner 'ChrisSkAcer\Chris'

Verify User SID

Needed to verify the user_token (SID) not matches the login_in SID used to identify the login when user first connects to SQL Server.

select * from sys.user_token

>> dbo 0x5EEC29DAFF38CF043B0FFE4AEB030000

Now the sys.login_token matches sys.user_token.  LogReader connected as DBO and processed commands

Comments (9)

  1. Hari says:

    even i am facing the same problem!!

    I've done following:-

    1. Setting up mirroring between two servers

    2. Common Distributor database is present in the mirror database

    3. Created transaction publication & push subscription in publisher( it was replicating data successfully)

    4. Manual failover to other server

    5. View snapshot agent tells 'No Replicated transactions'

    6. Error in View LogReader Agent Status "Could not restart……….."

    7. Issued the command "sp_replrestart"

            ERROR MESSAGE 'Cannot execute as the database principal because the principal "dbo" does not exist'

    PLZ help me out, stuck with this problem from 2 days

  2. Hari says:

    I'hve even checked the sid on both principal & Mirror.. they are same 🙁

  3. Sam says:

    I ran into this myself, the answer for me was to run:



  4. Parag says:

    Worked for me.

    Thanks a million!

  5. Praveen says:

    Changing the DB owner to sa worked for me

  6. Bethk says:

    I have been fighting with this problem for weeks, and changing the DB owner to sa worked for me too. Thank you!

  7. Rafael Bahia says:

    Changing to sa did not work for me. I had to use my own login as owner to get it working. My login is sysadmin.

  8. Arni Leibovits says:

    Note that if you change the Log Reader account, you may have to restart SQL Server. This fixed the problem for me.

  9. Sacheen Mahendrakar says:



Skip to main content