Quantcast
Viewing all articles
Browse latest Browse all 15889

How to attach a database in standby mode(SQL 2012)?

Hi experts,

  Let's assume I build log shipping in standby and my OS disk fail. I reinstall a new OS and due to some reasons, I want to read the data in standby DB(allow data loss). How do I attach a database?

1. I attached DB and got an error: "Cannot attach a database that was being restored."

2. I try Paul Randal's way to "rebuild suspend DB" by creating a exactly, temporary database and detach,replace log file but failed. SQL 2012 knows the log file is incorrect.

3. I try create database FOR ATTACH_REBUILD_LOG but failed, too.

"File activation failure. The physical file name "f:\TCPLOG1\TCPLOG1.Ldf" may be incorrect.

The log cannot be rebuilt because there were open transactions/users when the database was shutdown, no checkpoint occurred to the database, or the database was read-only. This error could occur if the transaction log file was manually deleted or lost due to a hardware or environment failure.
Msg 1813, Level 16, State 2, Line 1
Could not open new database 'TCP'. CREATE DATABASE is aborted."


Viewing all articles
Browse latest Browse all 15889

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>