Moving Database Files on SQL Server Always On

I think all of us know how to move files for SQL Server databases from disk to another disk but today I will explain how we can do it on SQL Server always on to reduce the downtime and taking new backup to return the database to always-on again. Let us start on the technical steps.

  • Preparations Steps
  • Check the current DB Files locations
  • Check Always on Health Status
  • Disable all backup jobs on Primary and secondary servers
  • Suspend the data movement on Secondary server
  • Remove Database from Primary server
  • Update DB files by new disk location on secondary server
  • Stop SQL Server instance on Secondary server
  • Move (CUT) DB Files from old location to new Location (Past)
  • Start the SQL Server instance again
  • Verify the DB File Location Using T-SQL on the post
  • Join the DB to availability group from Primary server
  • Check SQL Server always on Health Status Using T-SQL on the post
  • Enable the SQL Server Jobs\
  • Failover the SQL Server for Primary (X) to Secondary Server (Y) and do the same steps on (X)

Let’s Start The Technical Demo

Continue reading “Moving Database Files on SQL Server Always On”