中國最大的web開發(fā)資源網(wǎng)站及技術(shù)社區(qū),
先分離數(shù)據(jù)庫
企業(yè)管理器--右鍵suspect的數(shù)據(jù)庫--所有任務(wù)--分離數(shù)據(jù)庫
然后備份你的suspect數(shù)據(jù)庫的文件,再按下面的步驟處理:
1.新建一個同名的數(shù)據(jù)庫
2.再停掉sql server
3.用suspect數(shù)據(jù)庫的文件覆蓋掉這個新建的同名數(shù)據(jù)庫
4.再重啟sql server
5.此時打開企業(yè)管理器時新建的同名數(shù)據(jù)庫會出現(xiàn)置疑,先不管,執(zhí)行下面的語句(注意修改其中的數(shù)據(jù)庫名)
use master
go
sp_configure 'allow updates',1 reconfigure with override
go
update sysdatabases set status =32768 where name='his222'
go
sp_dboption 'test', 'single user', 'true'
go
dbcc checkdb('test')
go
update sysdatabases set status =28 where name='test'
go
sp_configure 'allow updates', 0 reconfigure with override
go
sp_dboption 'test', 'single user', 'false'
go
6.完成后一般就可以訪問數(shù)據(jù)庫中的數(shù)據(jù)了,這時,數(shù)據(jù)庫本身一般還要問題,解決辦法是,利用
數(shù)據(jù)庫的腳本創(chuàng)建一個新的數(shù)據(jù)庫,并將數(shù)據(jù)導(dǎo)進(jìn)去就行了.
如果這樣改不加數(shù)據(jù)庫狀態(tài),你就把數(shù)據(jù)庫導(dǎo)成一個新庫來代替舊庫吧
企業(yè)管理器--右鍵你的數(shù)據(jù)庫--所有任務(wù)--導(dǎo)出數(shù)據(jù)
--目標(biāo)標(biāo)數(shù)據(jù)庫選擇新建
--選擇"在兩個sql數(shù)據(jù)庫之間復(fù)制對象和數(shù)據(jù)"
--把"包含擴(kuò)展屬性"選上,其他的根據(jù)需要選擇
--最后完成