this type of principal cannot be impersonated, or youdo not have permission

Symptoms:
GGSCI> delete trandata dbo.*
2020-12-08 11:53:54 WARNING OGG-00782 Error in changing transaction logging for table: dbo.tab.
2020-12-08 11:53:54 ERROR OGG-05345 Failed to disable change data capture for table ‘dbo.tab in the database ‘tstdb’. SQL error: 15517: [Microsoft][
SQL Server Native Client 11.0][SQL Server]Cannot execute as the database principal because the principal “cdc” does not exist, this type of principal cannot be impersonated, or you do not have permission.
2020-12-08 11:53:54 WARNING OGG-00782 Error in changing transaction logging for table: dbo.road_scan_container_placards.
ERROR: ODBC Error occurred. See event log for details..

Cause:
missed cdc schema

Solution
https://dba.stackexchange.com/questions/39500/why-is-cdc-capture-failing-due-to-a-missing-dbo-principal
Database-> security-> User -> create new user -> General:
 – User type: SQL user without login
 – username: cdc
 – default schema: cdc
Owned schemas: cdc
Membership: cdc

GGSCI 6> delete trandata dbo.*
2020-12-08 12:02:47 INFO OGG-05250 Change data capture has been disabled for the database ‘tstdb’ successfully.

Enable CDC fails with error Msg 22830, Level 16, State 1, Procedure sp_cdc_enable_db_internal

 

Leave a Reply

Your email address will not be published. Required fields are marked *