Skip to main content
Announcements
Qlik Connect 2025! Join us in Orlando join us for 3 days of immersive learning: REGISTER TODAY

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

No ratings
cancel
Showing results for 
Search instead for 
Did you mean: 
Steve_Nguyen
Support

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

Last Update:

Mar 1, 2022 6:17:39 AM

Updated By:

Sonja_Bauernfeind

Created date:

Feb 24, 2022 7:43:20 AM

A Qlik Replicate task is running without issue.

However, on the SQL source end, the Log Reader agent is failing to start which appears to be causing the LDF files to grow large and the Log Reader agent is failing to start as well. 

 

Environment:

Qlik Replicate  
SQL 2014

 

Resolution

When checking on the Log Reader Agent, it fails on error: refused because the job is already running from a request by Start Sequence

  1. We try to manually remove the Log Reader Agent, and then remove the AR_PUBLICATION_000x that Qlik Replicate creates and start over.
  2. On Start over, the Publication can not be removed.
  3. We have to use the two commands below:
    1. use master; sp_removedbreplication 'mydatabasenamehere'
    2. EXEC sp_replicationdboption @dbname = 'mydatabasenamehere', @optname = 'publish', @value = 'true'
  4. Then we let the Qlik Replicate task run so that it could create the Publication and the Log Reader Agent.
  5. Checking on the Log Reader Agent job now we have a new error: 

    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.

  6. We check the database that is used for Qlik Replicate, and the database does not have an owner.
    So we assign an owner to the database:  use [YourDatabaseName] EXEC sp_changedbowner 'sa'
  7. Now the Log Reader Agent job run without issue.

 

Cause 

The database used for Replication does not have an Owner. Make sure that the database has an owner assigned to it.

Labels (2)