I have a database which is in always-on high availability mode synchronized with another database on a different instance. How can I restore from a .bak file into the primary database using T-SQL?
I'm new to high availability and I've been advised that I need to take the database out of high availability before I can do a restore and then put it back in high availability again but I'm not sure.
I'm hoping I can just restore straight into the primary while the AlwaysOn is still enabled and it will auto sync with the secondary.
If the Microsoft SQL database is part of the Microsoft SQL 2012 AlwaysOn Availability Groups (AAG), and restoring to the original location fails, perform the following tasks: 1. Remove the database to be restored away from the Availability Groups. For more information, see http://msdn.microsoft.com/en-us/library/hh213326.aspx. 2. Use the Restore Manager to restore the database to all nodes in the AAG group. 3. Add the database back to the Availability Groups. For more information, see http://msdn.microsoft.com/en-us/library/hh213078.aspx.