{"id":369,"date":"2024-03-05T08:55:00","date_gmt":"2024-03-05T13:55:00","guid":{"rendered":"https:\/\/www.sqltabletalk.com\/?p=369"},"modified":"2024-05-31T20:48:07","modified_gmt":"2024-06-01T01:48:07","slug":"implementing-high-availability-cdc-sql-server","status":"publish","type":"post","link":"https:\/\/www.sqltabletalk.com\/?p=369","title":{"rendered":"Ensuring Continuous Data Capture in SQL Server Across Failovers"},"content":{"rendered":"\n<p>This is a brief walkthrough of the process required to setup change data tracking (CDC) to be HADR aware. When setting up CDC for a database, SQL Server will create two SQL Agent jobs to manage change tracking. The most critical of these is the capture job which needs to be running continuously to capture all changes to the target tables. This can be an issue if the database is in an availability group and a failover occurs.<\/p>\n\n\n\n<p>Once a failover happens the CDC job on the original primary will fail because the database goes into read-only mode meaning CDC capture stops. We will walk through the required steps to configure the availability replicas to manage this properly and start the CDC job on the new primary after a failover has occurred. This will automate the process and eliminate the need for manual intervention after to a failover to ensure the CDC is working properly.<\/p>\n\n\n\n<p>Follow the steps below to implement AG aware CDC SQL Agent jobs:<\/p>\n\n\n\n<ol class=\"wp-block-list\" start=\"1\">\n<li>Login to the primary replica using SQL Server Management Studio.<\/li>\n\n\n\n<li>If CDC is not yet enabled on the target database, use the following command to setup the database for CDC. Be sure to replace [mydb] with the name of the target database.<\/li>\n<\/ol>\n\n\n<pre><code>USE [mydb]\nEXEC sys.sp_cdc_enable_db\nGO<\/code><\/pre>\n\n\n<ol class=\"wp-block-list\" start=\"3\">\n<li>Now that CDC is enabled at the database level, we need to enable CDC on the specific tables we\u2019d like to track. Use the following command to add a table and replace mytable with your table name:<\/li>\n<\/ol>\n\n\n<pre><code>EXEC sys.sp_cdc_enable_table\n    @source_schema = N'dbo',\n    @source_name   = N'mytable',\n    @role_name     = NULL,\n    @supports_net_changes = 1\nGO<\/code><\/pre>\n\n\n<p>For a complete explanation of the above two TSQL statements please refer to the official Microsoft documentation link below:<\/p>\n\n\n\n<p><a href=\"https:\/\/learn.microsoft.com\/en-us\/sql\/relational-databases\/track-changes\/enable-and-disable-change-data-capture-sql-server?view=sql-server-ver16\">Enable and Disable change data capture &#8211; SQL Server | Microsoft Learn<\/a><\/p>\n\n\n\n<ol class=\"wp-block-list\" start=\"4\">\n<li>The previous step created two SQL Agent jobs. An example can be seen below:<\/li>\n<\/ol>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"938\" height=\"126\" src=\"https:\/\/www.sqltabletalk.com\/wp-content\/uploads\/2024\/02\/image-15.png\" alt=\"\" class=\"wp-image-371\" srcset=\"https:\/\/www.sqltabletalk.com\/wp-content\/uploads\/2024\/02\/image-15.png 938w, https:\/\/www.sqltabletalk.com\/wp-content\/uploads\/2024\/02\/image-15-300x40.png 300w, https:\/\/www.sqltabletalk.com\/wp-content\/uploads\/2024\/02\/image-15-768x103.png 768w, https:\/\/www.sqltabletalk.com\/wp-content\/uploads\/2024\/02\/image-15-850x114.png 850w\" sizes=\"auto, (max-width: 938px) 100vw, 938px\" \/><\/figure>\n\n\n\n<p>These two jobs need to be edited to make them AG aware. The capture job has two steps which need edited and the cleanup job has one step requiring modification. Each of these steps need the following TSQL placed at the beginning of each agent job step:<\/p>\n\n\n<pre><code>DECLARE @DatabaseName SYSNAME = DB_NAME()\nIF (SELECT sys.fn_hadr_is_primary_replica(@DatabaseName)) = 1\nBEGIN\n    -- Insert the operations to be performed when the condition is true here\nEND<\/code><\/pre>\n\n\n<p>The following screenshot shows an example where step 2 of the capture job has been edited to be AG aware:<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"678\" height=\"355\" src=\"https:\/\/www.sqltabletalk.com\/wp-content\/uploads\/2024\/02\/image-16.png\" alt=\"\" class=\"wp-image-372\" srcset=\"https:\/\/www.sqltabletalk.com\/wp-content\/uploads\/2024\/02\/image-16.png 678w, https:\/\/www.sqltabletalk.com\/wp-content\/uploads\/2024\/02\/image-16-300x157.png 300w\" sizes=\"auto, (max-width: 678px) 100vw, 678px\" \/><\/figure>\n\n\n\n<ol class=\"wp-block-list\" start=\"5\">\n<li>We will next need to add another schedule to the capture job which attempts to start the job every minute. This is needed so that CDC begin capturing as soon as possible after a failover event. Below is an example of such a schedule being configured:<\/li>\n<\/ol>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"623\" height=\"494\" src=\"https:\/\/www.sqltabletalk.com\/wp-content\/uploads\/2024\/02\/image-17.png\" alt=\"\" class=\"wp-image-373\" srcset=\"https:\/\/www.sqltabletalk.com\/wp-content\/uploads\/2024\/02\/image-17.png 623w, https:\/\/www.sqltabletalk.com\/wp-content\/uploads\/2024\/02\/image-17-300x238.png 300w\" sizes=\"auto, (max-width: 623px) 100vw, 623px\" \/><\/figure>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Once the new schedule is created, your schedules should look something like this:<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"847\" height=\"214\" src=\"https:\/\/www.sqltabletalk.com\/wp-content\/uploads\/2024\/02\/image-18.png\" alt=\"\" class=\"wp-image-374\" srcset=\"https:\/\/www.sqltabletalk.com\/wp-content\/uploads\/2024\/02\/image-18.png 847w, https:\/\/www.sqltabletalk.com\/wp-content\/uploads\/2024\/02\/image-18-300x76.png 300w, https:\/\/www.sqltabletalk.com\/wp-content\/uploads\/2024\/02\/image-18-768x194.png 768w\" sizes=\"auto, (max-width: 847px) 100vw, 847px\" \/><\/figure>\n\n\n\n<ol class=\"wp-block-list\" start=\"6\">\n<li>You will now need to script out the two CDC jobs on the primary replica so we can recreate the jobs on the secondary replica. This can be done by expanding the SQL Server Agent node in Object Explorer and scripting out the job as seen in the screenshot below:<\/li>\n<\/ol>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"803\" height=\"341\" src=\"https:\/\/www.sqltabletalk.com\/wp-content\/uploads\/2024\/02\/image-19.png\" alt=\"\" class=\"wp-image-375\" srcset=\"https:\/\/www.sqltabletalk.com\/wp-content\/uploads\/2024\/02\/image-19.png 803w, https:\/\/www.sqltabletalk.com\/wp-content\/uploads\/2024\/02\/image-19-300x127.png 300w, https:\/\/www.sqltabletalk.com\/wp-content\/uploads\/2024\/02\/image-19-768x326.png 768w\" sizes=\"auto, (max-width: 803px) 100vw, 803px\" \/><\/figure>\n\n\n\n<ol class=\"wp-block-list\" start=\"7\">\n<li>Before we connect to the secondary replica we need to capture some SQL statements to populate the cdc_jobs table as seen in the screenshot below:<\/li>\n<\/ol>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"856\" height=\"308\" src=\"https:\/\/www.sqltabletalk.com\/wp-content\/uploads\/2024\/02\/image-20.png\" alt=\"\" class=\"wp-image-376\" srcset=\"https:\/\/www.sqltabletalk.com\/wp-content\/uploads\/2024\/02\/image-20.png 856w, https:\/\/www.sqltabletalk.com\/wp-content\/uploads\/2024\/02\/image-20-300x108.png 300w, https:\/\/www.sqltabletalk.com\/wp-content\/uploads\/2024\/02\/image-20-768x276.png 768w, https:\/\/www.sqltabletalk.com\/wp-content\/uploads\/2024\/02\/image-20-850x306.png 850w\" sizes=\"auto, (max-width: 856px) 100vw, 856px\" \/><\/figure>\n\n\n\n<p>Copy the SQL statements generated under Messages and save them for later. We will use these statements to copy the contents of your cdc_jobs table in MSDB on the secondary replica. The following is the code snippet above that can be pasted into the editor:<\/p>\n\n\n<pre><code>DECLARE @Database NVARCHAR(255) = 'testdb' \/* Your DATABASE NAME goes here *\/\n    , @Fields NVARCHAR(200) = '[job_type], [job_id], [maxtrans], [maxscans], [continuous], [pollinginterval], [retention], [threshold]'\n    , @SQL NVARCHAR(1000);\n\nSET @SQL = 'SET NOCOUNT ON;\n\nDECLARE @Insert VARCHAR(MAX);\n\nSELECT @Insert = ISNULL(@Insert + '' UNION '', ''INSERT INTO msdb.dbo.cdc_jobs([database_id], '\n    + @Fields + ')'') + CHAR(13) + CHAR(10) + ''SELECT DB_ID(''''' + @Database + '''''),'' + '\n    + REPLACE(REPLACE(REPLACE(@Fields, '', '', '' + '', '' + ''), ''['', '''''''' + CAST(''), '']', ' AS VARCHAR(max)) + '''''''')\n    + ' FROM msdb.dbo.cdc_jobs WHERE database_id = DB_ID(''' + @Database + ''');\n\nPRINT @Insert';\n\nEXEC sp_executesql @SQL;\n<\/code><\/pre>\n\n\n<ol class=\"wp-block-list\" start=\"8\">\n<li>Connect to the secondary replica and run the following query to ensure CDC has been enabled on the secondary as well:<\/li>\n<\/ol>\n\n\n<pre><code>SELECT name, is_cdc_enabled FROM sys.databases;<\/code><\/pre>\n\n\n<ol class=\"wp-block-list\" start=\"9\">\n<li>Now we will recreate the cdc_jobs table in the MSDB database. The script to create this table can be found below:<\/li>\n<\/ol>\n\n\n<pre><code>CREATE TABLE [dbo].[cdc_jobs] (\n    [database_id] [int] NOT NULL,\n    [job_type] [nvarchar](20) NOT NULL,\n    [job_id] [uniqueidentifier] NULL,\n    [maxtrans] [int] NULL,\n    [maxscans] [int] NULL,\n    [continuous] [bit] NULL,\n    [pollinginterval] [bigint] NULL,\n    [retention] [bigint] NULL,\n    [threshold] [bigint] NULL,\n    PRIMARY KEY CLUSTERED (\n        [database_id] ASC, \n        [job_type] ASC\n    )\n    WITH (\n        PAD_INDEX = OFF, \n        STATISTICS_NORECOMPUTE = OFF, \n        IGNORE_DUP_KEY = OFF, \n        ALLOW_ROW_LOCKS = ON, \n        ALLOW_PAGE_LOCKS = ON\n    ) ON [PRIMARY]\n) ON [PRIMARY];\n<\/code><\/pre>\n\n\n<p><\/p>\n\n\n\n<ol class=\"wp-block-list\" start=\"10\">\n<li>Now that we have a cdc_jobs table created on the secondary, we will now need to populate it with the data captured from the primary in step 7. Execute the SQL statements captured against the MSDB database on the secondary. You may want to confirm that the cdc_jobs table on the secondary does indeed match the primary\u2019s version. An example of a cdc_jobs table after the copy can be seen below:<\/li>\n<\/ol>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"890\" height=\"188\" src=\"https:\/\/www.sqltabletalk.com\/wp-content\/uploads\/2024\/02\/image-21.png\" alt=\"\" class=\"wp-image-377\" srcset=\"https:\/\/www.sqltabletalk.com\/wp-content\/uploads\/2024\/02\/image-21.png 890w, https:\/\/www.sqltabletalk.com\/wp-content\/uploads\/2024\/02\/image-21-300x63.png 300w, https:\/\/www.sqltabletalk.com\/wp-content\/uploads\/2024\/02\/image-21-768x162.png 768w, https:\/\/www.sqltabletalk.com\/wp-content\/uploads\/2024\/02\/image-21-850x180.png 850w\" sizes=\"auto, (max-width: 890px) 100vw, 890px\" \/><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<ol class=\"wp-block-list\" start=\"11\">\n<li>How that we have updated the cdc_jobs table on the secondary replica, we need to create the cdc_jobs_view system view in the MSDB database which is required by the CDC SQL Agent Jobs:<\/li>\n<\/ol>\n\n\n<pre><code>CREATE VIEW dbo.cdc_jobs_view AS<br \/>SELECT<br \/>  [database_id],<br \/>  [job_type],<br \/>  [job_id],<br \/>  [maxtrans],<br \/>  [maxscans],<br \/>  [continuous],<br \/>  [pollinginterval],<br \/>  [retention],<br \/>  [threshold]<br \/>FROM dbo.cdc_jobs;<\/code><\/pre>\n\n\n<ol class=\"wp-block-list\" start=\"12\">\n<li>Now that the SQL Agent jobs are created, we need to update the cdc_jobs table in MSDB to reflect the correct job IDs. Run the following script on the secondary replica to update cdc_jobs:<\/li>\n<\/ol>\n\n\n<pre><code>UPDATE c\nSET c.job_id = s.job_id\nFROM msdb.dbo.sysjobs s\nJOIN msdb.dbo.cdc_jobs c ON s.name = 'cdc.' + DB_NAME(c.database_id) + '_' + c.job_type\nWHERE DB_NAME(c.database_id) = 'testdb';\n<\/code><\/pre>\n\n\n<ol class=\"wp-block-list\" start=\"13\">\n<li>Before we test the setup with a failover, be sure that all CDC jobs and job schedules are enabled. When a failover occurs, the agent job on the original primary will fail because the database goes into read-only mode. Within a minute of the failover, the new primary will execute its CDC capture job and it will proceed with change capture for the table.<\/li>\n<\/ol>\n\n\n\n<p>In conclusion, setting up Change Data Capture (CDC) to be High Availability Disaster Recovery (HADR) aware is an essential step for ensuring data integrity and continuity in SQL Server environments. Through the detailed walkthrough provided, database administrators can effectively manage and automate CDC operations across primary and secondary replicas, thereby minimizing downtime and manual intervention in the event of failovers. By leveraging SQL Server Management Studio, specific T-SQL commands, and the Query Store, this setup not only enhances the resilience of your database system but also ensures that data changes are continuously captured, even in complex high availability scenarios. Implementing these steps will lead to a more robust and reliable database system, ready to handle the challenges of today&#8217;s data-driven environments.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Discover how to configure Change Data Capture (CDC) in SQL Server to be High Availability (HADR) aware. This guide covers step-by-step instructions to ensure continuous data capture and system resilience across failovers, minimizing manual intervention and maximizing uptime.<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[36,94,35,21],"tags":[38],"class_list":["post-369","post","type-post","status-publish","format-standard","hentry","category-availability-groups","category-change-data-capture","category-data-integrity","category-tutorial","tag-availability-groups"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.1.1 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Implementing High Availability-aware CDC in SQL Server | A Complete Guide<\/title>\n<meta name=\"description\" content=\"Discover how to configure Change Data Capture (CDC) in SQL Server to be High Availability (HADR) aware. This guide covers step-by-step instructions to ensure continuous data capture and system resilience across failovers, minimizing manual intervention and maximizing uptime.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.sqltabletalk.com\/?p=369\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Implementing High Availability-aware CDC in SQL Server | A Complete Guide\" \/>\n<meta property=\"og:description\" content=\"Discover how to configure Change Data Capture (CDC) in SQL Server to be High Availability (HADR) aware. This guide covers step-by-step instructions to ensure continuous data capture and system resilience across failovers, minimizing manual intervention and maximizing uptime.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.sqltabletalk.com\/?p=369\" \/>\n<meta property=\"og:site_name\" content=\"SQL Table Talk\" \/>\n<meta property=\"article:published_time\" content=\"2024-03-05T13:55:00+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-06-01T01:48:07+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.sqltabletalk.com\/wp-content\/uploads\/2024\/02\/image-15.png\" \/>\n<meta name=\"author\" content=\"Yvonne Vanslageren\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Yvonne Vanslageren\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"6 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.sqltabletalk.com\/?p=369#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.sqltabletalk.com\/?p=369\"},\"author\":{\"name\":\"Yvonne Vanslageren\",\"@id\":\"https:\/\/www.sqltabletalk.com\/#\/schema\/person\/68bb31b454bafe9e139183ed4f3e9082\"},\"headline\":\"Ensuring Continuous Data Capture in SQL Server Across Failovers\",\"datePublished\":\"2024-03-05T13:55:00+00:00\",\"dateModified\":\"2024-06-01T01:48:07+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.sqltabletalk.com\/?p=369\"},\"wordCount\":935,\"commentCount\":5,\"publisher\":{\"@id\":\"https:\/\/www.sqltabletalk.com\/#\/schema\/person\/1947e42a9438bccd91691d8b791888e0\"},\"image\":{\"@id\":\"https:\/\/www.sqltabletalk.com\/?p=369#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.sqltabletalk.com\/wp-content\/uploads\/2024\/02\/image-15.png\",\"keywords\":[\"availability groups\"],\"articleSection\":[\"Availability Groups\",\"Change Data Capture\",\"Data Integrity\",\"Tutorial\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.sqltabletalk.com\/?p=369#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.sqltabletalk.com\/?p=369\",\"url\":\"https:\/\/www.sqltabletalk.com\/?p=369\",\"name\":\"Implementing High Availability-aware CDC in SQL Server | A Complete Guide\",\"isPartOf\":{\"@id\":\"https:\/\/www.sqltabletalk.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.sqltabletalk.com\/?p=369#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.sqltabletalk.com\/?p=369#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.sqltabletalk.com\/wp-content\/uploads\/2024\/02\/image-15.png\",\"datePublished\":\"2024-03-05T13:55:00+00:00\",\"dateModified\":\"2024-06-01T01:48:07+00:00\",\"description\":\"Discover how to configure Change Data Capture (CDC) in SQL Server to be High Availability (HADR) aware. This guide covers step-by-step instructions to ensure continuous data capture and system resilience across failovers, minimizing manual intervention and maximizing uptime.\",\"breadcrumb\":{\"@id\":\"https:\/\/www.sqltabletalk.com\/?p=369#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.sqltabletalk.com\/?p=369\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.sqltabletalk.com\/?p=369#primaryimage\",\"url\":\"https:\/\/www.sqltabletalk.com\/wp-content\/uploads\/2024\/02\/image-15.png\",\"contentUrl\":\"https:\/\/www.sqltabletalk.com\/wp-content\/uploads\/2024\/02\/image-15.png\",\"width\":938,\"height\":126},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.sqltabletalk.com\/?p=369#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.sqltabletalk.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Ensuring Continuous Data Capture in SQL Server Across Failovers\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.sqltabletalk.com\/#website\",\"url\":\"https:\/\/www.sqltabletalk.com\/\",\"name\":\"SQL Table Talk\",\"description\":\"Breaking Down SQL Server, One Post at a Time.\",\"publisher\":{\"@id\":\"https:\/\/www.sqltabletalk.com\/#\/schema\/person\/1947e42a9438bccd91691d8b791888e0\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.sqltabletalk.com\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\/\/www.sqltabletalk.com\/#\/schema\/person\/1947e42a9438bccd91691d8b791888e0\",\"name\":\"Stephen Planck\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.sqltabletalk.com\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/64181114edc3de3d99072c049bcec024f025c9536dc89fc8ff1bac58976ca81e?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/64181114edc3de3d99072c049bcec024f025c9536dc89fc8ff1bac58976ca81e?s=96&d=mm&r=g\",\"caption\":\"Stephen Planck\"},\"logo\":{\"@id\":\"https:\/\/www.sqltabletalk.com\/#\/schema\/person\/image\/\"},\"sameAs\":[\"https:\/\/dexterwiki.com\",\"https:\/\/www.linkedin.com\/in\/stephen-planck-4611b692?trk=people-guest_people_search-card&challengeId=AQErf8gbBmcVMwAAAYsyIsxO-0UvU8z7cHrBpZoo_n3xt9qEKpRN5B_jd_LmAMu-OfeArkQ7GDjobJ2uRoQQV35EQdh_rR6kxA&submissionId=09de7067-c335-8e17-40b8-8dc32b60ed6c&challengeSource=AgEcUCw35zpPmAAAAYsyI4vAWhJTV7Nt4vZYKc3V1qiDBpCkKgUvtlOBgYXcE84&challegeType=AgE_wZiTT09IAQAAAYsyI4vDmNvbZIYe6XHju5V2bXVvM3IVxnJslgY&memberId=AgESFTkUShzs_gAAAYsyI4vGYk0Gic1uc5kB6cKOABA26Gw&recognizeDevice=AgHdSZyUSI5CEwAAAYsyI4vKd_koF9JgpsCJShT8QfbK1QMiv8SI\",\"https:\/\/www.youtube.com\/linuxmate\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.sqltabletalk.com\/#\/schema\/person\/68bb31b454bafe9e139183ed4f3e9082\",\"name\":\"Yvonne Vanslageren\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.sqltabletalk.com\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/22c274a7a354b81a0a8dc5b23e8e0be9bdd81a6bc0541474cfb6b954d6bb2089?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/22c274a7a354b81a0a8dc5b23e8e0be9bdd81a6bc0541474cfb6b954d6bb2089?s=96&d=mm&r=g\",\"caption\":\"Yvonne Vanslageren\"},\"url\":\"https:\/\/www.sqltabletalk.com\/?author=2\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Implementing High Availability-aware CDC in SQL Server | A Complete Guide","description":"Discover how to configure Change Data Capture (CDC) in SQL Server to be High Availability (HADR) aware. This guide covers step-by-step instructions to ensure continuous data capture and system resilience across failovers, minimizing manual intervention and maximizing uptime.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.sqltabletalk.com\/?p=369","og_locale":"en_US","og_type":"article","og_title":"Implementing High Availability-aware CDC in SQL Server | A Complete Guide","og_description":"Discover how to configure Change Data Capture (CDC) in SQL Server to be High Availability (HADR) aware. This guide covers step-by-step instructions to ensure continuous data capture and system resilience across failovers, minimizing manual intervention and maximizing uptime.","og_url":"https:\/\/www.sqltabletalk.com\/?p=369","og_site_name":"SQL Table Talk","article_published_time":"2024-03-05T13:55:00+00:00","article_modified_time":"2024-06-01T01:48:07+00:00","og_image":[{"url":"https:\/\/www.sqltabletalk.com\/wp-content\/uploads\/2024\/02\/image-15.png","type":"","width":"","height":""}],"author":"Yvonne Vanslageren","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Yvonne Vanslageren","Est. reading time":"6 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.sqltabletalk.com\/?p=369#article","isPartOf":{"@id":"https:\/\/www.sqltabletalk.com\/?p=369"},"author":{"name":"Yvonne Vanslageren","@id":"https:\/\/www.sqltabletalk.com\/#\/schema\/person\/68bb31b454bafe9e139183ed4f3e9082"},"headline":"Ensuring Continuous Data Capture in SQL Server Across Failovers","datePublished":"2024-03-05T13:55:00+00:00","dateModified":"2024-06-01T01:48:07+00:00","mainEntityOfPage":{"@id":"https:\/\/www.sqltabletalk.com\/?p=369"},"wordCount":935,"commentCount":5,"publisher":{"@id":"https:\/\/www.sqltabletalk.com\/#\/schema\/person\/1947e42a9438bccd91691d8b791888e0"},"image":{"@id":"https:\/\/www.sqltabletalk.com\/?p=369#primaryimage"},"thumbnailUrl":"https:\/\/www.sqltabletalk.com\/wp-content\/uploads\/2024\/02\/image-15.png","keywords":["availability groups"],"articleSection":["Availability Groups","Change Data Capture","Data Integrity","Tutorial"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.sqltabletalk.com\/?p=369#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.sqltabletalk.com\/?p=369","url":"https:\/\/www.sqltabletalk.com\/?p=369","name":"Implementing High Availability-aware CDC in SQL Server | A Complete Guide","isPartOf":{"@id":"https:\/\/www.sqltabletalk.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.sqltabletalk.com\/?p=369#primaryimage"},"image":{"@id":"https:\/\/www.sqltabletalk.com\/?p=369#primaryimage"},"thumbnailUrl":"https:\/\/www.sqltabletalk.com\/wp-content\/uploads\/2024\/02\/image-15.png","datePublished":"2024-03-05T13:55:00+00:00","dateModified":"2024-06-01T01:48:07+00:00","description":"Discover how to configure Change Data Capture (CDC) in SQL Server to be High Availability (HADR) aware. This guide covers step-by-step instructions to ensure continuous data capture and system resilience across failovers, minimizing manual intervention and maximizing uptime.","breadcrumb":{"@id":"https:\/\/www.sqltabletalk.com\/?p=369#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.sqltabletalk.com\/?p=369"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.sqltabletalk.com\/?p=369#primaryimage","url":"https:\/\/www.sqltabletalk.com\/wp-content\/uploads\/2024\/02\/image-15.png","contentUrl":"https:\/\/www.sqltabletalk.com\/wp-content\/uploads\/2024\/02\/image-15.png","width":938,"height":126},{"@type":"BreadcrumbList","@id":"https:\/\/www.sqltabletalk.com\/?p=369#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.sqltabletalk.com\/"},{"@type":"ListItem","position":2,"name":"Ensuring Continuous Data Capture in SQL Server Across Failovers"}]},{"@type":"WebSite","@id":"https:\/\/www.sqltabletalk.com\/#website","url":"https:\/\/www.sqltabletalk.com\/","name":"SQL Table Talk","description":"Breaking Down SQL Server, One Post at a Time.","publisher":{"@id":"https:\/\/www.sqltabletalk.com\/#\/schema\/person\/1947e42a9438bccd91691d8b791888e0"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.sqltabletalk.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":["Person","Organization"],"@id":"https:\/\/www.sqltabletalk.com\/#\/schema\/person\/1947e42a9438bccd91691d8b791888e0","name":"Stephen Planck","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.sqltabletalk.com\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/64181114edc3de3d99072c049bcec024f025c9536dc89fc8ff1bac58976ca81e?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/64181114edc3de3d99072c049bcec024f025c9536dc89fc8ff1bac58976ca81e?s=96&d=mm&r=g","caption":"Stephen Planck"},"logo":{"@id":"https:\/\/www.sqltabletalk.com\/#\/schema\/person\/image\/"},"sameAs":["https:\/\/dexterwiki.com","https:\/\/www.linkedin.com\/in\/stephen-planck-4611b692?trk=people-guest_people_search-card&challengeId=AQErf8gbBmcVMwAAAYsyIsxO-0UvU8z7cHrBpZoo_n3xt9qEKpRN5B_jd_LmAMu-OfeArkQ7GDjobJ2uRoQQV35EQdh_rR6kxA&submissionId=09de7067-c335-8e17-40b8-8dc32b60ed6c&challengeSource=AgEcUCw35zpPmAAAAYsyI4vAWhJTV7Nt4vZYKc3V1qiDBpCkKgUvtlOBgYXcE84&challegeType=AgE_wZiTT09IAQAAAYsyI4vDmNvbZIYe6XHju5V2bXVvM3IVxnJslgY&memberId=AgESFTkUShzs_gAAAYsyI4vGYk0Gic1uc5kB6cKOABA26Gw&recognizeDevice=AgHdSZyUSI5CEwAAAYsyI4vKd_koF9JgpsCJShT8QfbK1QMiv8SI","https:\/\/www.youtube.com\/linuxmate"]},{"@type":"Person","@id":"https:\/\/www.sqltabletalk.com\/#\/schema\/person\/68bb31b454bafe9e139183ed4f3e9082","name":"Yvonne Vanslageren","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.sqltabletalk.com\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/22c274a7a354b81a0a8dc5b23e8e0be9bdd81a6bc0541474cfb6b954d6bb2089?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/22c274a7a354b81a0a8dc5b23e8e0be9bdd81a6bc0541474cfb6b954d6bb2089?s=96&d=mm&r=g","caption":"Yvonne Vanslageren"},"url":"https:\/\/www.sqltabletalk.com\/?author=2"}]}},"jetpack_featured_media_url":"","jetpack-related-posts":[],"jetpack_sharing_enabled":true,"jetpack_likes_enabled":true,"_links":{"self":[{"href":"https:\/\/www.sqltabletalk.com\/index.php?rest_route=\/wp\/v2\/posts\/369","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.sqltabletalk.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.sqltabletalk.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.sqltabletalk.com\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.sqltabletalk.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=369"}],"version-history":[{"count":3,"href":"https:\/\/www.sqltabletalk.com\/index.php?rest_route=\/wp\/v2\/posts\/369\/revisions"}],"predecessor-version":[{"id":605,"href":"https:\/\/www.sqltabletalk.com\/index.php?rest_route=\/wp\/v2\/posts\/369\/revisions\/605"}],"wp:attachment":[{"href":"https:\/\/www.sqltabletalk.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=369"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.sqltabletalk.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=369"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.sqltabletalk.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=369"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}