Bugs in Azure Portal With PITR Restore of a CDC-Enabled Database Between SQL Managed Instances

sguidos 10 Reputation points
2025-01-17T18:58:19.05+00:00

When using the Azure Portal to the a Point In Time Restore (PITR) of a database on SQL Managed Instance:

  • The restored database does not have the source database’s CDC Capture Retention period in its [msdb].[dbo].[cdc_jobs] record
  • The CDC Capture and Cleanup Jobs are always created, even if they do not exist on the source database’s Managed Instance
  • The CDC Cleanup Job is always enabled, even if it is disabled at the source database’s Managed Instance
  • The CDC Cleanup Job runs immediately, and not at the time next scheduled at the source database’s Managed Instance

 The cumulative impact of the above issues is that when you restore a CDC-enabled database, all CDC older than the default Retention period of 3 days is immediately deleted from the restored database, and there is nothing you can do to stop this.

 In addition, the Job Names for the SQL Server Agent Capture and Cleanup jobs are created using the [sys].[databases].physical_database_name] and not the [dbName].  Since the Azure UI for the PITR Restore requires that the destination database name does not exist on the destination SQL Managed Instance, those jobs should be named using the destination database name, which is what happens when you enable CDC on a new database.  Using the physical database name is confusing and requires the user to perform additional work to determine which SQL Server Agent Jobs belong to which restored database.

Not Monitored
Not Monitored
Tag not monitored by Microsoft.
41,446 questions
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.