Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I've seen this error message in other posts. They didn't seem to help resolving our issue. We are trying this with two SQL Server 2008 servers. I backed up my database from the source server and then restored it on our destination server. We setup basic Transaction Replication. The Snapshot Agent is working fine. The Log Reader Agent fails with the error above. Is it most likely a login issue for this job or QueryTimeout?

share|improve this question
    
What does the logfile say? There should be more detail associated with this. –  Kenneth Jun 11 '10 at 14:30
    
Error messages: The process could not execute 'sp_replcmds' on 'SVR-DENVER'. (Source: MSSQL_REPL, Error number: MSSQL_REPL20011) Get help: 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: help/15517 The process could not execute 'sp_replcmds' on 'SVR-DENVER'. (Source: MSSQL_REPL, Error number: MSSQL_REPL22037) Get help: help/MSSQL_REPL22037 –  Rick Jun 14 '10 at 15:14
    
Does the database have an owner? –  Dee Yu Jun 16 '11 at 20:59
add comment

3 Answers

Create the logins on both principal & Mirror with the same LOGIN NAME and SID

Step1: Create a login 'abc' on principal

Step2: Copy the SID of the login using the below code:-

"use master Select SID, name, dbname from syslogins"

Step3: Create a login 'abc' in the mirror using the code below:-

CREATE LOGIN Test WITH PASSWORD = 'xyz', SID = 'SID of principal abc login'

Step4: Change the db owner of both mirror & principal databases using sp_changedbowner 'abc'

Step5: Your problem is solved :)

share|improve this answer
add comment

Rick, I don't have an answer as I have the same setup as you and getting the same error. However when I set up a new test database under SQL 2008 the replication works fine but the database I am trying to replicate started off life in SQL 2000 so I guess the issue is something to do with that??

share|improve this answer
add comment

Sounds like the account that the log reader is running under doesn't have rights in one or more of the databases.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.