Could not update the metadata that indicates database X is enabled for Change Data Capture. The error returned was 15517
Asked Answered
G

2

22

I use SQL Server 2008 and AdventureWorkDB.

I want enable Change Data Capture in my database.

I execute this command :

USE [AdventureWorksDB];
GO
EXEC sys.sp_cdc_enable_db ;

But i get this error :

Could not update the metadata that indicates database X is enabled for 
Change Data Capture. 
The failure occurred when executing the command 'SetCDCTracked(Value = 1)'. 
The error returned was 15517: 
    '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.'. 
Use the action and error to determine the cause of the failure and resubmit 
the request. 

How I can fix it ?

Gubernatorial answered 7/12, 2013 at 13:16 Comment(0)
G
50

After googling

I fix it with this command :

EXEC sp_changedbowner 'sa'

I must add DataBase owner to my database.

Gubernatorial answered 7/12, 2013 at 13:44 Comment(2)
I'm assuming you googled this: support.microsoft.com/en-us/help/913423/…Pusillanimous
My error was different to yours, but this answer resolved my issue. My error was: 'The database owner SID recorded in the master database differs from the database owner SID recorded in database 'XXX'. You should correct this situation by resetting the owner of database 'XXX' using the ALTER AUTHORIZATION statement.'. Use the action and error to determine the cause of the failure and resubmit the request.Crocodilian
C
1

This did not resolve my issue. I checked to make sure the svrname in sysservers was the same as the actual server name and I found a discrepancy. Apparently this was a repurposed server.

To check I used:

SELECT srvname AS OldName FROM master.dbo.sysservers
SELECT SERVERPROPERTY('ServerName') AS NewName

To resolve I used:

sp_dropserver '<oldname>';  
GO  
sp_addserver '<newname>', local;  
GO
Colophon answered 17/8, 2023 at 13:40 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.