sql 2008,一次数据库服务意外停止并且启动后,发现有数据库不能打开,没有备份。
sql errorlog:Msg 5171, Level 16, State 1, Line 1
S:\MSSQL10_50.MSSQLSERVER\MSSQL\DATA\odb.mdf is not a primary database file.dbcc checkdb 不能运行。怎么办啊,解决后多少分都行!

解决方案 »

  1.   

    进管理器把MDF改成primary 主文件组
      

  2.   

    MDF在primary 主文件组,搜索网络说mdf 文件坏掉了
    救命啊,大侠~~
      

  3.   

    http://topic.csdn.net/u/20120713/10/f715a108-5324-486e-be1b-27dd8ac1a94e.html?60357
    按那个置疑的办法整整看。
      

  4.   

    如果是mdf文件损坏了比较麻烦啊
    参考:这个问题通常发生如果您的SQL Server的MDF文件得到了损坏。
    密度板修复是可能的,被称为第三方应用的 SQL恢复软件的帮助。这些软件有助于在每一个中密度纤维板腐败的情况下,从而使你拥有完美的中密度纤维板恢复。
      

  5.   

    数据库重启后,什么没显示,只有选择该数据库时报错,不可用。
    我查了查网上方法,现在问题:
    DBCC CheckDB ('odb', REPAIR_ALLOW_DATA_LOSS) Msg 922, Level 14, State 1, Line 1
    Database 'odb' is being recovered. Waiting until recovery is finished.然后按照方法:
    Follow the following steps: 
    1 stop sql server 
    2 rename your db files or move them to another location 
    3 start sql server 
    4 remove the database from the list 
    5 create a new database with the same name and the same datafiles 
    6 set this database in emergency mode 
    7 stop sql server 
    8 copy your original db files back 
    9 start sql server还是不行