Thursday, January 11, 2018

Always on group database fails. May be not accessible or recovery mode. This may due to some incident happened in the database server.

1.       Always on group database fails. May be not accessible or recovery mode. This may due to some incident happened in the database server.

Soution: set online database from primary database. Eg: let’s say you have two servers and each server has two availability groups. Server1 has availGroup1 as primary and server2 has availGroup2 as primary. The database ‘myDB’ has failed and it’s a member of availGroup2. AvailGroup2 resides in server2 and try to bring the ‘myDB’ online in server2.

ALTER DATABASE MyDB SET ONLINE

If you execute this in other server, you might get the error as

-----------------------------------------------------
Msg 5052, Level 16, State 1, Line 2
ALTER DATABASE is not permitted while a database is in the Restoring state.
Msg 5069, Level 16, State 1, Line 2

ALTER DATABASE statement failed.
---------------------------------------------------------

Give little time. Server2, MyDb will come online.
After MyDB comes online add database to the AvailGroup2 from the server2 and connect with the MyDb in the server1.




No comments:

Post a Comment