Recovery Database From Warm-Standy Mode

Kailash Chandra Behera | Saturday, June 25, 2016

Introduction

Some times you may get database error'Failed to update database because the database is read only' while inserting data into database or update the database, The reason is that your database might be in Warm-Stand by Mode or read only mode. The article describes how to recovery your database when the database is in Warm-Standby Mode.

Getting Started

When your database is in Warm-Standy Mode and to recovery from this, first you need to move or change from current database(the database you want recovery) connection to master database connection. Then you need to kill the database existing database (Current) user and then you have to restore the database.

After restoring the database, again you need to set the user of the database. Here bellow is the all the code syntax of SQL that recovers database from Warm-Standy Mode.

Killing Current Database User

 ALERT DATABASE database-name SET SINGLE_USER WITH ROLLBACK IMMEDIATE;  

Complete Recovering Database

 RESTORE DATABASE database-name WITH RECOVERY  

Setting Database Users

 ALERT DATABASE database-name SET MULTI_USER WITH ROLLBACK IMMEDIATE;  

Related Articles

  1. Enable SQL Remote Connection
  2. Encrypt data across communication channels
  3. List Out Store Procedures That Executes Frequently
  4. Install certificate to enable encrypted connections to the Database Engine in SQL Server
  5. Create SQL Job in SQL Server 2017“

Summary

This article described the syntax, how to recover database from Warm-Standy Mode. I hope this article may help you.

Thanks