SQL Server附加數(shù)據(jù)庫(kù)出錯(cuò)的破解方案
此文章主要講述的是SQL Server附加數(shù)據(jù)庫(kù)出錯(cuò)的正確解決方法,以下的文章將會(huì)為你提供相應(yīng)的解決方案,以下就是相關(guān)內(nèi)容的描述,你如果對(duì)其有興趣的話你就可以點(diǎn)擊以下的文章進(jìn)行觀看了。
在QA里執(zhí)行sp_attach_db或者sp_attach_single_file_db,出現(xiàn)提示:錯(cuò)誤1813:未能打開新數(shù)據(jù)庫(kù)’dbname’,create database 將終止。設(shè)備激活錯(cuò)誤。物理文件名’d:sql servermssqldatadbname _log.ldf&rsq
在QA里執(zhí)行sp_attach_db或者sp_attach_single_file_db,出現(xiàn)提示:錯(cuò)誤1813:未能打開新數(shù)據(jù)庫(kù)’dbname’,create database 將終止。設(shè)備激活錯(cuò)誤。物理文件名’d:sql servermssqldatadbname _log.ldf’可能有誤!
后來(lái)到baidu里找到相關(guān)的方法,不錯(cuò),問(wèn)題解決了。
SQL Server附加數(shù)據(jù)庫(kù)出錯(cuò)的解決方法按下面的步驟處理:
1.新建一個(gè)同名的數(shù)據(jù)庫(kù)2.再停掉sqlserver服務(wù)(注意不要分離數(shù)據(jù)庫(kù))
3.用原數(shù)據(jù)庫(kù)的數(shù)據(jù)文件覆蓋掉這個(gè)新建的數(shù)據(jù)庫(kù)4.再重啟sqlserver服務(wù)
5.此時(shí)打開企業(yè)管理器時(shí)會(huì)出現(xiàn)置疑,先不管,執(zhí)行下面的語(yǔ)句(注意修改其中的數(shù)據(jù)庫(kù)名)6.完成后一般就可以訪問(wèn)數(shù)據(jù)庫(kù)中的數(shù)據(jù)了。這時(shí),數(shù)據(jù)庫(kù)本身一般還有問(wèn)題,解決辦法是:利用數(shù)據(jù)庫(kù)的腳本創(chuàng)建一個(gè)新的數(shù)據(jù)庫(kù),然后通過(guò)DTS將數(shù)據(jù)導(dǎo)進(jìn)去就行了
use master
go
sp_configure ’allow updates’,1 reconfigure with override
go
update sysdatabases set status =32768 where name=’置疑的數(shù)據(jù)庫(kù)名’
go
sp_dboption ’置疑的數(shù)據(jù)庫(kù)名’, ’single user’, ’true’
go
dbcc checkdb(’置疑的數(shù)據(jù)庫(kù)名’)
go
update sysdatabases set status =28 where name=’置疑的數(shù)據(jù)庫(kù)名’
go
sp_configure ’allow updates’, 0 reconfigure with override
go
sp_dboption ’置疑的數(shù)據(jù)庫(kù)名’, ’single user’, ’false’
go
以上的相關(guān)內(nèi)容就是對(duì)SQL Server附加數(shù)據(jù)庫(kù)出錯(cuò)的解決方法的介紹,望你能有所收獲。
【編輯推薦】
- SQL Server數(shù)據(jù)文件監(jiān)控與數(shù)據(jù)文件的查看
- SQL Server 2008稀疏列與列集的經(jīng)驗(yàn)總結(jié)
- SQL Server排序遇到NULL,不怕不帕!
- SQL Server獲取表的容量很簡(jiǎn)單!
- SQL Server行轉(zhuǎn)列的什么情況下被用?

















