Quantcast
Channel: SQL Server High Availability and Disaster Recovery forum
Viewing all articles
Browse latest Browse all 4689

Error in attachig database in sql server 2012

$
0
0
HI Experts,

I detached the database and was trying to re-attach the database but got the below error.

An error occurred while processing the log for database ''.  If possible, restore from backup. If a backup is not available, it might be necessary to rebuild the log.
Could not open new database 'livedb'. CREATE DATABASE is aborted. (Microsoft SQL Server, Error: 9004)


I executed this commands and got the errror 
 
sp_attach_single_file_db @DBNAME='livedb', @PHYSNAME='F:\Live Database\Livedb.mdf'

CREATE DATABASE [livedb] ON (FILENAME = N'F:\Live Database\Livedb.mdf')
FOR ATTACH_REBUILD_LOG;

CREATE DATABASE [Livedb] ON (FILENAME = N'F:\Live Database\Livedb.mdf')
FOR ATTACH;

File activation failure. The physical file name "F:\Live Database\Livedb.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 'livedb'. CREATE DATABASE is aborted.
Can anyone help to workaround for this above error...

Its very urgent

Thanks For help in advance 


Pavicoolman


Viewing all articles
Browse latest Browse all 4689

Trending Articles



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