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.
3 Answers 3
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.
-
I did follow all steps on the MSDN that you provided and it works great. Thanks!Jerameel Resco– Jerameel Resco2015年06月27日 11:44:34 +00:00Commented Jun 27, 2015 at 11:44
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!)
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.
binn\templates
intomssql\data
?