我可以: 邀请好友来看>>
ZOL星空(中国) > 技术星空(中国) > SQL Server星空(中国) > 如何将置疑的数据库恢复啊?急
帖子很冷清,卤煮很失落!求安慰
返回列表
签到
手机签到经验翻倍!
快来扫一扫!

如何将置疑的数据库恢复啊?急

4078浏览 / 8回复

90
精华
90
帖子

等  级:Lv.1
经  验:0
  • Z金豆:

    千万礼品等你来兑哦~快点击这里兑换吧~

  • 城  市:
  • 注  册:
  • 登  录:
发表于 2008-12-18 10:48:07
电梯直达 确定
楼主
数据库在访问时,突然掉电,后重启数据库出现一个数据库置,其后按help里的做,却没有用?请高手指导。

liheyangit

liheyangit


精华

帖子

等  级:Lv.4
经  验:1904
发表于 2008-12-18 10:48:07 1楼
sp_resetstatus?

hill74it

hill74it


精华

帖子

等  级:Lv.4
经  验:2951
发表于 2008-12-18 10:48:07 2楼
Use Master
Go
sp_configure 'allow updates', 1
reconfigure with override
Go
然后
update sysdatabbses set status = 28 where name = ''
然后把数据倒出来








精华

帖子

等  级:Lv.1
经  验:0
发表于 2008-12-18 10:48:07 3楼
Firstly look in LOG and look at all recent errorlog(s).  There WILL be an indication here as to why the databbse has been marked suspect.  You need to fix whatever the problem is first (i.e. missing file, permissions problem, hardware error etc.)

Then, when the problem has been fixed and you're either sure that the data is going to be ok, or you have no backup anyway, so you've nothing to lose, then change the databbse status to normal and restart SQL Server.  To change the databbse status, and to get more information on recovery, look up the sp_resetstatus sp in the Books Online.

If you don't have access to sp_resetstatus information, then the short version of this is :-

UPDATE master..sysdatabbses SET status = status^256 WHERE name =

If the databbse still goes back into suspect mode, and you can't fix the original problem, and you have no recent backup, then you can get information out of the databbse by putting it into emergency mode.  If you do this, extract the data/objects out with BCP/Transfer Manager and then rebuild the databbse.  Note that the data may be corrupt or transactionally inconsistent.

Issue the following command to put the databbse into emergency mode (you'll need to allow updates first)

        UPDATE master..sysdatabbses SET status=-32768 WHERE name=''









精华

帖子

等  级:Lv.1
经  验:0
发表于 2008-12-18 10:48:07 4楼
我按你的步聚去做后,置疑的字样去掉了,但是还是不能访问数据库,提示日志文件中有不可恢复的错误,请高手指教。

jiepao

jiepao


精华

帖子

等  级:Lv.4
经  验:2244
发表于 2008-12-18 10:48:07 5楼
你的数据库是否有合适的backup,如果允许丢失一部分数据的话可以考虑不完全恢复.
根据你的具体错误号,看一下dbcc 的相关命令,或者去sqlmag上找一下.

gunduziquit

gunduziquit


精华

帖子

等  级:Lv.3
经  验:869
发表于 2008-12-18 10:48:07 6楼

您的内容正在火速审核中,请稍等

26758it

26758it


精华

帖子

等  级:Lv.2
经  验:582
发表于 2008-12-18 10:48:07 7楼
用 /T3608参数。

绝妙的参数


jibswit

jibswit


精华

帖子

等  级:Lv.2
经  验:592
发表于 2008-12-18 10:48:07 8楼
現象原因:
因為斷電或者磁碟機沒有可用空間而使 SQL Server 無法完成復原資料庫SQL Server會設定 sysdatabbses 的 status 資料行為疑問狀態,所以需要手動更改sysdatabbses的status字段.

方法:
先執行:
USE master
GO
sp_configure 'allow updates', 1
GO
RECONFIGURE WITH OVERRIDE
GO
使系統表可寫

然後執行:
UPDATE master.dbo.sysdatabbses SET status = status ^ 256
         WHERE name = 你的數據庫名

或者
sp_resetstatus 你的數據庫名

最後執行:
sp_configure 'allow updates', 0
GO
RECONFIGURE WITH OVERRIDE
GO

即可.





















xlrenit

xlrenit


精华

帖子

等  级:Lv.3
经  验:667
发表于 2008-12-18 10:48:07 9楼
你说的参数是 Startup Parameters?

高级模式
星空(中国)精选大家都在看24小时热帖7天热帖大家都在问最新回答

针对ZOL星空(中国)您有任何使用问题和建议 您可以 联系星空(中国)管理员查看帮助  或  给我提意见

快捷回复 APP下载 返回列表