{"id":350,"date":"2020-10-01T09:46:09","date_gmt":"2020-10-01T09:46:09","guid":{"rendered":"https:\/\/kindsonthegenius.com\/mssql\/?p=350"},"modified":"2020-10-01T09:46:09","modified_gmt":"2020-10-01T09:46:09","slug":"ms-sql-server-high-availability","status":"publish","type":"post","link":"https:\/\/www.kindsonthegenius.com\/mssql\/ms-sql-server-high-availability\/","title":{"rendered":"MS SQL Server &#8211; High Availability"},"content":{"rendered":"<p>High Availability(HA) describe methods used to ensure that the database is available close to 24\/7 365 days under every circumstance. This is a very important aspect of a DBAs work. In this tutorials, we would examine 5 different technologies to achieve high availability.<\/p>\n<ol>\n<li><a href=\"#t1\">Database Replication<\/a><\/li>\n<li><a href=\"#t2\">Log Shipping<\/a><\/li>\n<li><a href=\"#t3\">Database Mirroring<\/a><\/li>\n<li><a href=\"#t4\">Clustering<\/a><\/li>\n<li><a href=\"#t5\">Always On Availability<\/a><\/li>\n<\/ol>\n<p>&nbsp;<\/p>\n<h4><strong id=\"t1\">1. Database Replication<\/strong><\/h4>\n<p>In this approach, we copy object from a database to another database. These objects can be tables, view, stored procedures etc. It can be scheduled to run as SQL Server Agent jobs. There are three components which includes<\/p>\n<ul>\n<li><strong>Publisher<\/strong> &#8211; this is the primary server holding the data to be replicated.<\/li>\n<li><strong>Distributor<\/strong> &#8211; this is an optional database that stores the replicated data from the publisher<\/li>\n<li><strong>Subscriber<\/strong> &#8211; this is the destination server where data is copied to<\/li>\n<\/ul>\n<p>You can find replication in SQL Server Management studio a shown in the figure below:<\/p>\n<figure id=\"attachment_352\" aria-describedby=\"caption-attachment-352\" style=\"width: 534px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/i0.wp.com\/www.kindsonthegenius.com\/mssql\/wp-content\/uploads\/sites\/11\/2020\/10\/Screenshot-2020-10-01-at-11.34.32.png?ssl=1\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-352\" src=\"https:\/\/i0.wp.com\/www.kindsonthegenius.com\/mssql\/wp-content\/uploads\/sites\/11\/2020\/10\/Screenshot-2020-10-01-at-11.34.32.png?resize=534%2C347&#038;ssl=1\" alt=\"Replication in MS SQL Server\" width=\"534\" height=\"347\" srcset=\"https:\/\/i0.wp.com\/www.kindsonthegenius.com\/mssql\/wp-content\/uploads\/sites\/11\/2020\/10\/Screenshot-2020-10-01-at-11.34.32.png?w=534&amp;ssl=1 534w, https:\/\/i0.wp.com\/www.kindsonthegenius.com\/mssql\/wp-content\/uploads\/sites\/11\/2020\/10\/Screenshot-2020-10-01-at-11.34.32.png?resize=300%2C195&amp;ssl=1 300w\" sizes=\"auto, (max-width: 534px) 100vw, 534px\" \/><\/a><figcaption id=\"caption-attachment-352\" class=\"wp-caption-text\">Replication in MS SQL Server<\/figcaption><\/figure>\n<p>&nbsp;<\/p>\n<h4><strong id=\"t2\">2. Database Mirroring<\/strong><\/h4>\n<p>In database mirroring, a database is copied from a primary instance called the principal to a secondary instance. Here, there are three components involved:<\/p>\n<ul>\n<li><strong>Principal<\/strong> &#8211; this is the primary instance containing the original data<\/li>\n<li><strong>Mirror<\/strong> &#8211; this is the instance where data would be mirrored to<\/li>\n<li><strong>Witness<\/strong> &#8211; optional instance that contains additional information<\/li>\n<\/ul>\n<p>Database mirroring may be removed in subsequent versions of SQL Server. Would be replaced with Always On Availability.<\/p>\n<p>However, to configure database mirroring, you can right-click on the database, Tasks &gt; Mirror. This is shown below:<\/p>\n<figure id=\"attachment_353\" aria-describedby=\"caption-attachment-353\" style=\"width: 666px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/i0.wp.com\/www.kindsonthegenius.com\/mssql\/wp-content\/uploads\/sites\/11\/2020\/10\/Screenshot-2020-10-01-at-11.37.00.png?ssl=1\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" class=\" wp-image-353\" src=\"https:\/\/i0.wp.com\/www.kindsonthegenius.com\/mssql\/wp-content\/uploads\/sites\/11\/2020\/10\/Screenshot-2020-10-01-at-11.37.00.png?resize=666%2C449&#038;ssl=1\" alt=\"Database Mirroring in SQL Server Management Studio\" width=\"666\" height=\"449\" srcset=\"https:\/\/i0.wp.com\/www.kindsonthegenius.com\/mssql\/wp-content\/uploads\/sites\/11\/2020\/10\/Screenshot-2020-10-01-at-11.37.00.png?w=811&amp;ssl=1 811w, https:\/\/i0.wp.com\/www.kindsonthegenius.com\/mssql\/wp-content\/uploads\/sites\/11\/2020\/10\/Screenshot-2020-10-01-at-11.37.00.png?resize=300%2C202&amp;ssl=1 300w, https:\/\/i0.wp.com\/www.kindsonthegenius.com\/mssql\/wp-content\/uploads\/sites\/11\/2020\/10\/Screenshot-2020-10-01-at-11.37.00.png?resize=768%2C518&amp;ssl=1 768w\" sizes=\"auto, (max-width: 666px) 100vw, 666px\" \/><\/a><figcaption id=\"caption-attachment-353\" class=\"wp-caption-text\">Database Mirroring in SQL Server Management Studio<\/figcaption><\/figure>\n<p>&nbsp;<\/p>\n<h4><strong id=\"t3\">3. Log Shipping<\/strong><\/h4>\n<p>This is a high availability and disaster recovery(DR) approach for SQL Server database. As the name shows, this method requires backup of database transaction logs. This backup is configured to run at intervals using SQL Server job. The following three components are involved:<\/p>\n<ul>\n<li><strong>Primary Server<\/strong> &#8211; this is source server holding the original database<\/li>\n<li><strong>Secondary Server<\/strong> &#8211; this is the destination server where the transaction logs are backed up to<\/li>\n<li><strong>Monitor Server<\/strong> &#8211; an optional server used for\u00a0 monitoring the log shipping status<\/li>\n<\/ul>\n<p>You can find Log Shipping in SQL server management studio when you right-click on the database &gt; Tasks &gt; Ship Transaction Logs. See figure below:<\/p>\n<figure id=\"attachment_354\" aria-describedby=\"caption-attachment-354\" style=\"width: 811px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/i0.wp.com\/www.kindsonthegenius.com\/mssql\/wp-content\/uploads\/sites\/11\/2020\/10\/Screenshot-2020-10-01-at-11.39.25.png?ssl=1\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-354\" src=\"https:\/\/i0.wp.com\/www.kindsonthegenius.com\/mssql\/wp-content\/uploads\/sites\/11\/2020\/10\/Screenshot-2020-10-01-at-11.39.25.png?resize=811%2C515&#038;ssl=1\" alt=\"Transaction Log Shipping in SQL Server\" width=\"811\" height=\"515\" srcset=\"https:\/\/i0.wp.com\/www.kindsonthegenius.com\/mssql\/wp-content\/uploads\/sites\/11\/2020\/10\/Screenshot-2020-10-01-at-11.39.25.png?w=811&amp;ssl=1 811w, https:\/\/i0.wp.com\/www.kindsonthegenius.com\/mssql\/wp-content\/uploads\/sites\/11\/2020\/10\/Screenshot-2020-10-01-at-11.39.25.png?resize=300%2C191&amp;ssl=1 300w, https:\/\/i0.wp.com\/www.kindsonthegenius.com\/mssql\/wp-content\/uploads\/sites\/11\/2020\/10\/Screenshot-2020-10-01-at-11.39.25.png?resize=768%2C488&amp;ssl=1 768w\" sizes=\"auto, (max-width: 811px) 100vw, 811px\" \/><\/a><figcaption id=\"caption-attachment-354\" class=\"wp-caption-text\">Transaction Log Shipping in SQL Server<\/figcaption><\/figure>\n<p>&nbsp;<\/p>\n<h4><strong id=\"t4\">4. MS SQL Database Clustering<\/strong><\/h4>\n<p>Here we are talking about Failover Clustering. In this approach, we create two or more servers(cluster) with similar access to shared storage disks that stored the database files. Here the servers are described as nodes and communicate via a network.<\/p>\n<ul>\n<li>Different nodes in a network(Virtual machines are used the the demo)<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<h4><strong id=\"t5\">5. Always On Availability<\/strong><\/h4>\n<p>This is a new feature in SQL Server 2016 and provides a high availability feature for mission critical databases. This relates to the Database Clustering. However, in this demo for this part we would set up a network with three nodes:<\/p>\n<ul>\n<li><strong>DC Server<\/strong> &#8211; this a Windows 2019 Server configured as a domain controller<\/li>\n<li><strong>Server 2<\/strong> &#8211; this is the primary node of the SQL Always On Availability group<\/li>\n<li><strong>Server 3<\/strong> &#8211; the secondary node of the SQL Server Always On Availability group<\/li>\n<\/ul>\n<p>You can find Always On Availability in Management studio as shown in the figure below<\/p>\n<figure id=\"attachment_356\" aria-describedby=\"caption-attachment-356\" style=\"width: 317px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/i0.wp.com\/www.kindsonthegenius.com\/mssql\/wp-content\/uploads\/sites\/11\/2020\/10\/Screenshot-2020-10-01-at-11.42.48.png?ssl=1\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-356\" src=\"https:\/\/i0.wp.com\/www.kindsonthegenius.com\/mssql\/wp-content\/uploads\/sites\/11\/2020\/10\/Screenshot-2020-10-01-at-11.42.48.png?resize=317%2C337&#038;ssl=1\" alt=\"Always On High Availability in Managment Studio\" width=\"317\" height=\"337\" srcset=\"https:\/\/i0.wp.com\/www.kindsonthegenius.com\/mssql\/wp-content\/uploads\/sites\/11\/2020\/10\/Screenshot-2020-10-01-at-11.42.48.png?w=317&amp;ssl=1 317w, https:\/\/i0.wp.com\/www.kindsonthegenius.com\/mssql\/wp-content\/uploads\/sites\/11\/2020\/10\/Screenshot-2020-10-01-at-11.42.48.png?resize=282%2C300&amp;ssl=1 282w\" sizes=\"auto, (max-width: 317px) 100vw, 317px\" \/><\/a><figcaption id=\"caption-attachment-356\" class=\"wp-caption-text\">Always On High Availability in Managment Studio<\/figcaption><\/figure>\n<p>&nbsp;<\/p>\n<p>Now we have given an overview of the 5 High Availability approaches to SQL Server. You can now look at the related sections to learn how to perform the step by step configuration for each approach.<\/p>\n<!-- AddThis Advanced Settings generic via filter on the_content --><!-- AddThis Share Buttons generic via filter on the_content -->","protected":false},"excerpt":{"rendered":"<p>High Availability(HA) describe methods used to ensure that the database is available close to 24\/7 365 days under every circumstance. This is a very important &hellip; <!-- AddThis Advanced Settings generic via filter on get_the_excerpt --><!-- AddThis Share Buttons generic via filter on get_the_excerpt --><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[23],"tags":[27,25,24,28,26],"class_list":["post-350","post","type-post","status-publish","format-standard","hentry","category-ms-sql-server","tag-clustering","tag-database-mirroring","tag-high-availability","tag-replication","tag-transaction-log-shipping"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.kindsonthegenius.com\/mssql\/wp-json\/wp\/v2\/posts\/350","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.kindsonthegenius.com\/mssql\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.kindsonthegenius.com\/mssql\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.kindsonthegenius.com\/mssql\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.kindsonthegenius.com\/mssql\/wp-json\/wp\/v2\/comments?post=350"}],"version-history":[{"count":3,"href":"https:\/\/www.kindsonthegenius.com\/mssql\/wp-json\/wp\/v2\/posts\/350\/revisions"}],"predecessor-version":[{"id":357,"href":"https:\/\/www.kindsonthegenius.com\/mssql\/wp-json\/wp\/v2\/posts\/350\/revisions\/357"}],"wp:attachment":[{"href":"https:\/\/www.kindsonthegenius.com\/mssql\/wp-json\/wp\/v2\/media?parent=350"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.kindsonthegenius.com\/mssql\/wp-json\/wp\/v2\/categories?post=350"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.kindsonthegenius.com\/mssql\/wp-json\/wp\/v2\/tags?post=350"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}