Posts by Thetchina Moorthy Natarajan

Step-by-Step Guide for SQL Server Always on Failover

Step-by-Step Guide for SQL Server Always on Failover Introduction SQL Server Always On Availability Groups provide high availability and disaster recovery capabilities for SQL Server databases. Synchronous commit mode ensures that data is committed to both the primary and secondary replicas, guaranteeing data integrity during failover. This guide provides detailed steps for performing both manual and automatic failovers in an Always On Availability Group. Part 1: Preliminary Checks and Preparations Before initiating any failover, whether manual or automatic, ensure the environment is healthy and ready for the transition. Step 1: Prerequisites Check – Synchronization State: Confirm that all secondary replicas are in the SYNCHRONIZED state. – Query to Check Synchronization State: SELECT ag.name AS [AvailabilityGroupName], ar.replica_server_name AS [ReplicaServerName], drs.synchronization_state_desc AS [SynchronizationState] FROM sys.dm_hadr_availability_replica_states AS drs JOIN sys.availability_replicas AS ar ON drs.replica_id = ar.replica_id JOIN sys.availability_groups AS ag ON ar.group_id = ag.group_id WHERE drs.synchronization_state_desc = ‘SYNCHRONIZED’;   – Action: Ensure that all replicas are in the SYNCHRONIZED state to avoid any data loss during failover. – Verify Health of Availability Group: – Query to Check Availability Group Health: SELECT ag.name AS [AvailabilityGroupName], ags.primary_replica AS [PrimaryReplica], ags.operational_state_desc AS [OperationalState] FROM sys.dm_hadr_availability_group_states AS ags JOIN sys.availability_groups AS ag ON ags.group_id = ag.group_id;   – Action: Ensure that the OperationalState indicates a healthy state for a successful failover. Step 2: Validate Readiness for Failover…

Read More

Essential Guide for Regular MS SQL Server Patching

Essential Guide for Regular MS SQL Server Patching Introduction: In SQL Server management, keeping up with service packs and cumulative updates is not just a recommendation, it’s a necessity. Understanding these updates and their importance can make a significant difference in the performance, security, and reliability of your SQL Server environment. Table of Contents Pre-Check and Prerequisites before Patching. SQL Server 2022 Most recentPatch. Steps to Install the patch update. Post-Installation verification. Successfully upgraded Patching. Server restart Hack. Conclusion. Pre-Check and Prerequisites Before Patching: Before diving into the patching process, it’s essential to prepare thoroughly to avoid any disruption. ü Take necessary backups of application databases. ü Check Disk Space and System Requirements. ü Inform Stakeholders About Downtime ü Disable Scheduled Jobs: Temporarily disable any scheduled jobs that could interfere with the patching process. ü Apply the Patch in a Test Environment, before updating your live server, SQL Server 2022 Most recent Patch : The latest cumulative update for SQL Server 2022 is CU14 (KB5038325), released in July 2024. This update includes all fixes and improvements from previous updates and is essential for maintaining the security and performance of your SQL Server installations. Some notable features and improvements in CU14 include: ü General bug fixes and performance enhancements. ü Security updates ensure the system remains secure and reliable. ü Improvements in manageability and reliability to enhance overall system performance. Steps to Install the patch update: ü Run the Installer: Double-click the setup file to start the installer then patch installer will pop up. ü Accept License Terms: Review and accept the license terms to proceed with the installation. ü Select Features to Update:…

Read More