资源描述:
《数据库置疑修复(database query repair)》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库。
1、数据库置疑修复(Databasequeryrepair)Databasequerysolution:(1)ifitisaseriousdoubt,solveitlikethisStoptheSQLserviceandbackupthedatafileofyourquerydatabase(copytheMDF,LDFfiledirectly)ThenstarttheSQLserviceanddeletethequerydatabaseThenfollowthestepsbelow:1.createanewdatabasewiththesa
2、mename2.stopSQLserveragain(payattentionnottoseparatethedatabase)3.overwritethenewdatabasewiththedatafileoftheoriginaldatabase4.restartSQLServer5.whenyouopentheenterprisemanager,therewillbedoubt,firstofall,intheSQLqueryanalyzertoexecutethefollowingstatement(notethedatabase
3、namemodification)6.aftercompletion(refreshdatabase)cangenerallyaccessthedatainthedatabase,atthistime,thedatabaseitselfisgenerallyaproblem,thesolutionistouseThescriptofthedatabasecreatesanewdatabaseandguidesthedatainUSEMASTERGOSP_CONFIGURE'ALLOWUPDATES',1RECONFIGUREWITHOVE
4、RRIDEGOUPDATESYSDATABASESSETSTATUS=32768WHERENAME='querydatabasename'GoSp_dboption'querydatabasename','singleuser','true'GoDBCCCHECKDB(querydatabasename)GoUpdatesysdatabasessetstatus=28wherename='querydatabasename'GoSp_configure'allowupdates',0reconfigurewithoverrideGoSp_
5、dboption'querydatabasename','singleuser','false'Go------------------------------------------------------------------------------------------------------------------------(2)ResetdoubtstateIfSQLServerisnolongeravailablebecausethediskdrivespace,andcannotcompletetherecoveryo
6、fthedatabase,thentheMicrosoft?SQLServer?2000and1105willreturnanerrorinthesysdatabasesstatuscolumnfordoubt.Followthestepsbelowtosolvethisproblem:Executivesp_resetstatus.AddadatafileorlogfiletothedatabaseusingALTERDATABASE.StopandrestartSQLServer.Withtheadditionalspaceprovi
7、dedbythenewdatafileorlogfile,SQLServershouldbeabletocompletethedatabaserecovery.Freeingdiskspaceandrerunningrecoveryoperations.Sp_resetstatusclosesthequeryflagofthedatabase,butkeepsotheroptionsofthedatabaseintact.Notethatyoucanusesp_resetstatusonlywhenyouareundertheguidan
8、ceofyourprimarysupportproviderorwhenyouhaveasolutionthatisrecommended.Otherwise,itmaydamagetheda