DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Please enter at least three characters to search
Refcards Trend Reports
Events Video Library
Refcards
Trend Reports

Events

View Events Video Library

Zones

Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks

Last call! Secure your stack and shape the future! Help dev teams across the globe navigate their software supply chain security challenges.

Modernize your data layer. Learn how to design cloud-native database architectures to meet the evolving demands of AI and GenAI workloads.

Releasing software shouldn't be stressful or risky. Learn how to leverage progressive delivery techniques to ensure safer deployments.

Avoid machine learning mistakes and boost model performance! Discover key ML patterns, anti-patterns, data strategies, and more.

Related

  • How to Restore a Transaction Log Backup in SQL Server
  • How to Attach SQL Database Without a Transaction Log File
  • A Deep Dive into Apache Doris Indexes
  • Spring Boot Sample Application Part 1: Introduction and Configuration

Trending

  • AI-Based Threat Detection in Cloud Security
  • Teradata Performance and Skew Prevention Tips
  • A Guide to Container Runtimes
  • How to Build Scalable Mobile Apps With React Native: A Step-by-Step Guide
  1. DZone
  2. Data Engineering
  3. Databases
  4. [Fixed] Database in Recovery Mode SQL Server 2014

[Fixed] Database in Recovery Mode SQL Server 2014

Database in Recovery Mode SQL Server 2014.

By 
Daniel Calbimonte user avatar
Daniel Calbimonte
·
Jun. 24, 21 · Review
Likes (2)
Comment
Save
Tweet
Share
8.1K Views

Join the DZone community and get the full member experience.

Join For Free

Summary

This post discusses the instances that put a SQL Server 2014 database in recovery mode and what causes the database to get stuck in recovery. Also, it discusses the methods to restore the database. 

You may find a SQL Server 2014 database in recovery mode when you restart the SQL Server service or restore a database from SQL Server Management Studio (SSMS). Also, a database goes into recovery mode if you restart a system abnormally. The database goes into recovery in such a scenario until all the active transactions are committed or rolled back. Let the recovery process complete, and the database comes back online.

However, the database gets stuck in the recovery mode at times, increasing downtime. This may happen due to any of these reasons:

  • Huge uncommitted transactions: The recovery process may slow down if you have huge uncommitted transactions that you need to record in the transaction log file. 
  • Lack of space: Some space is reserved in a log file by SQL Server to record the rollback transaction. In some situations, the rollback fails when there is no more unused space.
  • Too many virtual log files (VLFs): A transaction log file comprises smaller files (i.e., virtual log files). All the log records are written in VLFs. Lots of virtual log files can cause the database recovery to slow down.   

If you need to restore your database, you can use a few methods to bring the database online.

How to Restore SQL Server 2014 Database in Recovery Mode?

Note: Avoid bringing the database online using the RESTORE ...WITH RECOVERY command, running it will make the database go through the recovery process again to get the database to a consistent state.

Following are the two methods you can use to restore the database to its normal state:

Method 1 – Remove MDF/LDF Files and Delete the Database

Note: Do not try the below steps on a production database. 

You can try to delete the database and restore it from an updated backup. However, you may fail to delete the database stuck in recovery mode. To perform the restore process, you will first need to find and remove MDF and LDF files and then delete the database. Before removing the database files, create a backup of those files. After creating the backup, follow these steps:

  • Launch SSMS and connect to an instance of SQL Server 2014. 
  • From the Object Explorer pane, expand the Databases node, and then right-click on the database you want to delete. Select Properties.
  • From the ‘Database Properties’ window, click on the Files option under Select a page from the left pane. 
  • In the screen that appears, select the MDF and LDF files, and then click on the Remove button.

Database Properties Screenshot

After removing the SQL database files, try deleting the database and then restore the original DB from backup.

Method 2 – Use SQL Recovery Tool

If nothing works, using a SQL database recovery tool can help restore the database to its original form with minimal or no downtime. It helps repair the database MDF/NDF file and recover all of the file contents. You can use the repaired file to restore the database. However, choosing the right SQL recovery tool is crucial to regain access to the database and its data.

Conclusion

A database may go into recovery mode on restarting your SQL Server after a crash or trying to restore the database. Some of you may find that the recovery process is taking longer to complete or is stuck. This may happen if there are huge transactions that need to be committed or rolled back. Also, too many virtual log files or a lack of space to record the uncommitted transactions can also delay the recovery. If you need to restore the database urgently, you can delete the database and restore it from an updated backup copy. If this doesn’t work, using Stellar Repair for MS SQL can help you restore the database to its original, intact state.

Database sql

Opinions expressed by DZone contributors are their own.

Related

  • How to Restore a Transaction Log Backup in SQL Server
  • How to Attach SQL Database Without a Transaction Log File
  • A Deep Dive into Apache Doris Indexes
  • Spring Boot Sample Application Part 1: Introduction and Configuration

Partner Resources

×

Comments
Oops! Something Went Wrong

The likes didn't load as expected. Please refresh the page and try again.

ABOUT US

  • About DZone
  • Support and feedback
  • Community research
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Core Program
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 3343 Perimeter Hill Drive
  • Suite 100
  • Nashville, TN 37211
  • support@dzone.com

Let's be friends:

Likes
There are no likes...yet! 👀
Be the first to like this post!
It looks like you're not logged in.
Sign in to see who liked this post!