I am testing the AlwaysOn feature of SQL Server 2012. I have 2 servers set up and can successfully create availability groups and fail them over between servers. However, any databases that DO NOT belong to an availability group are stuck in a status of "Restoring" on the secondary server. I have started from scratch several times, and the same thing happens to these databases. Is this normal behavior? I was assuming that databases that don't belong to an AG would simply not show up on the secondary server.
How did you setup your Availability Group? It sounds like what happened is you blanketed the backups and restores from the primary replica server to the secondary replica server.
In other words, you did a:
to all databases on the primary and a
to all the backups aimed at the secondary replica server (proper operations for future AG databases). If you don't join one of those databases to the availability group then it'll stay in that restoring state.
The main question here is, if
I have a half-answer at least. My first attempt at creating an Availability Group consisted of every database. I later decided to only try a few databases in a group. So I deleted the databases on the secondary after removing them from the AG. Subsequent attempts to create availability groups with a limited set of databases triggered the stuck "Restoring" state. I am not sure why. I stopped SQL Server on the secondary, deleted the mdf and ldf files, then restarted SQL Server. All databases still showed "Restoring", but I was able to delete them in SSMS. I now have just the databases that I intended to have in the availability group showing on the secondary as "Synchronized"