Quantcast
Channel: Forum Getting started with SQL Server
Viewing all articles
Browse latest Browse all 7129

Problem with attach a database to perform data restore on an existing db

$
0
0
Hello,

I have to restore a production database because a bad wited procedure had deleted some data in the tables but the development team doesn't know what is exactly missing.

The only way to recover data using our backup solution is to restore the sql file and attache them to a new database.

I renamed the recovered datafile and I tried to perform the attach but I receive this error



Msg 5120, Level 16, State 101, Line 1
Unable to open the physical file "L:\xxx\log_log.ldf". Operating system error 32: "32(The process cannot access the file because it is being used by another process.)".
File activation failure. The physical file name "L:\xxx\log_log.ldff" 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 'RecoverdDatabase'. CREATE DATABASE is aborted.



I know that there is the option ATTACH_FORCE_REBUILD_LOG but I don't know if its mess up the recovered data or worst if it's dangerous for real data in production 



Kind regards



Luca Pozzoli


Viewing all articles
Browse latest Browse all 7129

Trending Articles