Sql-server – Why is CDC capture failing due to a missing dbo principal

change-data-capturesql serversql-server-2008

I am having a problem running the CDC change capture job against some of my test databases.

The error message I'm getting is the following:

Executed as user: NT AUTHORITY\NETWORK SERVICE. 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. [SQLSTATE 42000] (Error 15517).

How can I fix this?

Best Answer

dbo is mapped to an invalid login. Re-map it to a valid one:

ALTER AUTHORIZATION ON DATABASE::[<dbname>] TO [sa];