SQL 2008 R2 - MASTER.LDF corrupted without backup

October 22, 2015 at 14:32:32
Specs: Windows 64
Hello,

I have a SQL server that has a corrupt MASTER.LDF file, which prevents SQL services from starting at all.

Is there any way to start SQL services with just MASTER.MDF? So far I have tried renaming MASTER.LDF to MASTER.LDF.OLD and SQL reports that the file is missing and still does not start (although I do not get a corrupt message).

If I cannot start MASTER.MDF without the log file, is there a way to rebuild the log file?

Help is appreciated. Thanks!


See More: SQL 2008 R2 - MASTER.LDF corrupted without backup

Report •


#1
October 29, 2015 at 14:51:04
And you can get more helpful resources on following threads, where users share their knowledge about SQL databases

http://www.fixya.com/support/t25285...
http://ccm.net/forum/affich-777411-...


To find out what exactly gone wrong with database we tried following query
DBCC CHECKDB (‘YOUR_DATABASE_NAME’) WITH NO_INFOMSGS, ALL_ERRORMSGS
(It wasn’t much helpful in my case . I am just posting here in-case it hepls other !)
After a while we run another block of code , to put the database in emergency mode
EXEC sp_resetstatus ‘YOUR_DATABASE_NAME’;
ALTER DATABASE YOUR_DATABASE_NAME SET EMERGENCY
DBCC checkdb(‘YOUR_DATABASE_NAME’)
ALTER DATABASE YOUR_DATABASE_NAME SET SINGLE_USER WITH ROLLBACK IMMEDIATE
DBCC CheckDB (‘YOUR_DABASE_NAME’, REPAIR_ALLOW_DATA_LOSS)
ALTER DATABASE YOUR_DATABASE_NAME SET MULTI_USER
Finally we got database back online!


Report •

#2
August 9, 2016 at 11:31:59
There might be other options out there. This is something that worked for me once but there are no guarantees that it will work at all times.

Stop SQL Server instance -> Copy MDF and LDF files to another location -> Delete original MDF and LDF files -> Start SQL Server instance again -> Create new database with exact same name and file names -> Stop SQL Server -> overwrite newly created MDF and LDF.

After this your database should be back online. If it is then go ahead and put it into EMERGANCY mode and SINGLE USER mode.

Finally go ahead and execute DBCC CHECKDB like this

DBCC CHECKDB (databaseName, REPAIR_ALLOW_DATA_LOSS) WITH NO_INFOMSGS
If you can get to this and execute last command successfully you should be good. If not then your only options are restoring from backup and/or using 3rd party tools.


Report •

#3
August 29, 2016 at 02:31:39
you can attach .mdf without .ldf by rebuilding transaction log file. see here: http://www.sqlserverlogexplorer.com...

Report •
Related Solutions


Ask Question