As always, the script from this post can also be found on our GitHub repo, HERE You've got a SQL Server with a few hundred databases on it (to be honest it doesn't even need to be quite that many) and you need to move all the data and log files to a new location.... Continue Reading →
To use ALTER DATABASE, the database must be in a writable state in which a checkpoint can be executed. – when moving files on an Availability Group secondary.
Here's a little error that I stumbled across the other day when trying to migrate the data files of an Availability Group secondary node onto a nice new SAN. I started off by running the following command against the secondary server. ALTER DATABASE SQLUndercover MODIFY FILE (NAME = 'AG01', FILENAME = 'E:\DATA\AG01.mdf') There's nothing wrong... Continue Reading →