无法启动的SQL Server实例

时间:2022-10-15 23:26:24

I needed to attach SQL Server 2008 database to server. There was no log file, just mdf file

我需要将SQL Server 2008数据库附加到服务器。没有日志文件,只有mdf文件

After some digging I found this How to recover database from MDF in SQL Server 2005? SO post.
So I tried following steps:

经过一番挖掘后,我发现了如何在SQL Server 2005中从MDF中恢复数据库?所以发帖。所以我尝试了以下步骤:

  • Create a new database with the same name and same MDF and LDF files
  • 创建具有相同名称和相同MDF和LDF文件的新数据库
  • Stop sql server
  • 停止sql server
  • Replace the MDF file with the original
  • 将MDF文件替换为原始文件

When I next tried to Start SQL Server it failed.

当我下次尝试启动SQL Server时,它失败了。

Now it became worse, cannot even start the service. How do I get service back Any idea ?

现在它变得更糟,甚至无法启动服务。我如何获得服务任何想法?

无法启动的SQL Server实例

2 个解决方案

#1


0  

Did you try just removing the files? It would complain about that, but most probably work..

你试过删除文件了吗?它会抱怨,但最有可能工作..

BTW: When I want to quickly remove some log files (from a development server) I just detach the DB in question, delete the LDF, then attach again, deleting the LDF from the attaching dialog as I do so.. The LDF is not really needed for the attaching process.

BTW:当我想快速删除一些日志文件(来自开发服务器)时,我只是分离有问题的数据库,删除LDF,然后再次附加,从附加对话框中删除LDF,因为我这样做.. LDF不是真正需要附加过程。

#2


0  

Finally I found the way to fix the issue the issue might be help full to some one

最后,我找到了解决问题的方法,问题可能对某些问题有所帮助

1). Look at ERRORLOG on SQL folder 
2). Check any Windows Application Error Log
3). Identified problem, and restart the SQL server Single user mode from command   prompt (sqlservr.exe -m) [Help][1] 
4). Repeat 1). and 2). if you get any errors
5). Remove the DB causing issues 
6). Restart the server with multi user mode

Problem has been resolved

问题已经解决

#1


0  

Did you try just removing the files? It would complain about that, but most probably work..

你试过删除文件了吗?它会抱怨,但最有可能工作..

BTW: When I want to quickly remove some log files (from a development server) I just detach the DB in question, delete the LDF, then attach again, deleting the LDF from the attaching dialog as I do so.. The LDF is not really needed for the attaching process.

BTW:当我想快速删除一些日志文件(来自开发服务器)时,我只是分离有问题的数据库,删除LDF,然后再次附加,从附加对话框中删除LDF,因为我这样做.. LDF不是真正需要附加过程。

#2


0  

Finally I found the way to fix the issue the issue might be help full to some one

最后,我找到了解决问题的方法,问题可能对某些问题有所帮助

1). Look at ERRORLOG on SQL folder 
2). Check any Windows Application Error Log
3). Identified problem, and restart the SQL server Single user mode from command   prompt (sqlservr.exe -m) [Help][1] 
4). Repeat 1). and 2). if you get any errors
5). Remove the DB causing issues 
6). Restart the server with multi user mode

Problem has been resolved

问题已经解决