Delete manually delete data

I have a serious problem with one of my production bases.

The database was included to collect change data, which performed reasonably well. Last month we had a server crisis where several disks were damaged and data was lost. We then restore the database backups from tapes and restore them to the newly installed database server.

The problem I am currently facing is the following:

  • sys.database

    indicates that my database is not enabled for cdc
  • the database contains the schema cdc, user, tables, sp and functions.
  • sys.sp_cdc_enable_db

    throws an error stating that the schema and custom "cdc" already exist, so they cannot create them and enable the database for cdc
  • sys.sp_cdc_disable_db

    will not remove the remnants of the cdc as it believes the database is not enabled for the cdc
  • leftovers from the cdc cannot be manually deleted as they are all stored procedures and system functions.

So now I am stuck in a database that cannot be enabled for cdc since it already has all the cdc components and cdc cannot be disabled since it is not signaled in sys.database that cdc is enabled.

Is there any solution for my problems, execpt to create a new database and transfer the entire object (except cdc) and data to the new database?


source to share

All Articles