Take the 2-minute tour ×
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

I was not able to start the SQL Server 2008 R2 production DB instance. After reading the log file error message is

" The log scan number passed to log scan in database ‘master’ is not valid. This error may indicate data corruption or that the log file (.ldf) does not match the data file (.mdf). If this error occurred during replication, re-create the publication."

After reading several post i realize that my MASTER DB file is corrupted. I have followed the below setup

Copy the Master.mdf and Masterlog.ldf file from Template location to My Database Data folder.

C:\Program Files\Microsoft SQL Server\MSSQL10_50.MSSQLSERVER\MSSQL\Binn\Templates to D:\MSSQL\MSSQL10_50.MSSQLSERVER\MSSQL\DATA

Note: Same error occur when i copy the all DB file like Master, MasterLog, MSDBData, MSDBlog, Model and ModelLog

When i run my MSSQLSEVER instance different problem occur.

In My server i had only C, D- Drive i dont have the E drive. How can i override these below error path.

Error LOG

2012-10-24 02:51:12.79 spid5s Error: 17204, Severity: 16, State: 1.

2012-10-24 02:51:12.79 spid5s FCB::Open failed: Could not open file e:\sql10_main_t.obj.x86fre\sql\mkmastr\databases\objfre\i386\MSDBData.mdf for file number 1. OS error: 3(The system cannot find the path specified.).

2012-10-24 02:51:12.79 spid5s Error: 5120, Severity: 16, State: 101.

2012-10-24 02:51:12.79 spid5s Unable to open the physical file

"e:\sql10_main_t.obj.x86fre\sql\mkmastr\databases\objfre\i386\MSDBData.mdf". Operating system error 3: "3(The system cannot find the path specified.)".

2012-10-24 02:51:12.79 spid5s Error: 17207, Severity: 16, State: 1.

2012-10-24 02:51:12.79 spid5s FileMgr::StartLogFiles: Operating system error 2(The system cannot find the file specified.) occurred while creating or opening file 'e:\sql10_main_t.obj.x86fre\sql\mkmastr\databases\objfre\i386\MSDBLog.ldf'. Diagnose and correct the operating system error, and retry the operation.

2012-10-24 02:51:12.79 spid5s File activation failure. The physical file name "e:\sql10_main_t.obj.x86fre\sql\mkmastr\databases\objfre\i386\MSDBLog.ldf" may be incorrect.
share|improve this question

migrated from stackoverflow.com Oct 24 '12 at 10:05

This question came from our site for professional and enthusiast programmers.

    
Do you have any backups? You could likely just restore a backup and be good to go. –  awright18 Oct 24 '12 at 8:37
3  
Where did you find advice to copy the master files from binn\templates into mssql\data? –  Remus Rusanu Oct 24 '12 at 9:39
1  
Do you have backups of master? –  swasheck Oct 24 '12 at 15:37

3 Answers 3

If you have copied the master to a different place that it was before, you have to change the path in Configuration Manager -> Right click on the SQL server instance -> Properties -> Advanced -> Startup Parameters. -d for the data file and -l for the path to the log file (the new ones!)

share|improve this answer

If the master database is corrupt you have two options. Hopefully you have a backup and can restore it. This link describes the steps: http://msdn.microsoft.com/en-us/library/ms190679.aspx

Alternatively, if you don't have a backup available you can reinstall SQL and then restore any backups that you do have. You'll have to reconfigure security, sp_configure settings, and possibly other things if you go this route.

share|improve this answer

Look here http://msdn.microsoft.com/en-us/library/dd207003.aspx. It's for 2012 but 2008 is basically the same. It describes how to use the setup.exe to rebuild the system databases. From there you have to do restores for your system databases & patch your instance but it works. If you don't have backups of your system databases you can copy the files off (not master obviously) and copy them back after the rebuild. It's not recommended but it will work.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.