SQL Database State stuck in Restoring

Suddenly one of the production SharePoint site in one of our client site was down. When tried to browse the site was getting the error “Cannot connect to the configuration database. So i logged into the database server and was able to see the following: probsOne of the database was get stucked in the restoring mode. The rest of the databases was in the mode of restoring. I was waiting for more than one hour to let the restoring process get finish and unfortunately nothing happened. 😦

So the resolution is to:

Execute the following command in any case if your database get stucked at the time of restoring:

RESTORE DATABASE [DATABASENAME] WITH RECOVERY;

Once i execute the above i was getting the following error:

Msg 3104, Level 16, State 1, Line 1
RESTORE cannot operate on database ‘kiainternet01’ because it is configured for database mirroring. Use ALTER DATABASE to remove mirroring if you intend to restore the database.
Msg 3013, Level 16, State 1, Line 1
RESTORE DATABASE is terminating abnormally.

i didn’t aware the above database is configured for mirroring. So i had to switch off the mirroring temporarily using the following command:

ALTER DATABASE [DATABASENAME] SET PARTNER OFF;

upon that executed the following command:

RESTORE DATABASE [DATABASENAME] WITH RECOVERY;

finally the databases were online :

final

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: