首页 >计算机类 >微软认证 > >You are the administrator of two SQL Server 2000 computers. One of these servers contains a 4-GB database named marketing. You want to remove the marketing database from one server and add it to the o

You are the administrator of two SQL Server 2000 computers. One of these servers contains a 4-GB database named marketing. You want to remove the marketing database from one server and add it to the o

时间:2019-10-25 06:47浏览次数:

What should you do?

A.Detach the database from the original server by using the sp_detach_db stored procedure. Copy the database and the transaction log files to the new server, and attach them by using the sp_attach_db stored procedure.

B.Use the DTS export wizard to transfer all database objects from the original server to the new server. Drop the database from the original server.

C.Run a full backup of the database on the original server. Create a new database named marketing on the new server. Restore the backup in the new marketing database. Drop the database from the original server.

D.Shut down the original server. Copy the database and the transaction log files to the new server. Use the DISK INIT and DISK REFIT statements to attach the data file to the new server. Drop the database from the original server.

参考答案

正确答案:A
解析:Explanation:Detachingandattachingdatabasesissometimesausefultechniqueforquicklymovingadatabasefromonecomputertoanother.Tomoveadatabase,ordatabasefile,toanotherserverordiskthedatabasemustfirstbedetachedfromtheoriginalserverordisk;movedtotheotherserverordiskandthenattachedontheserverordisk.Inadditionthenewlocationofthemovedfile(s)mustbespecified.Thesp_detach_dbstoredprocedureisusedtodetachthedatabaseandcanrunUPDATESTATISTICSonalltablesbeforedetachingthedatabasewhilethesp_attach_dbstoredprocedureisusedtoattachthedatabaseinitsnewlocation.IncorrectAnswers:B:DTScanimportdatafromatextfileorfromanOLEDBdatasourcesuchasaMicrosoftAccess2000databaseintoSQLServer.ItcanalsoexportdatafromSQLServertoanOLEDBdatadestination.Itprovidesforhigh-speeddataloadingfromtextfilesintoSQLServertables.However,itisnotthefastestwaytomoveawholedatabasefromoneservertoanother.C:Beforeadatabasecanberestoredfromabackuptoanewlocation;thedatabasemustfirstberecreatedinthedestinationasthebackupholdsonlythedatafilesthatbelonginthevarioustables.Itdoesnotholdthetabledefinitions.Thisisnotthefastestmethodtomoveadatabase.D:TheDISKINITandDISKREFITcommandscannotbeusedtomoveadatabasefromoneservertoanother.Note:DISKINITandDISKREINITarefeaturesthatareusedinaSQLServer6.x.inSQLServer6.x,DISKINITisusedtocreatedatabaseortransactionlogdevicestostorethespecifieddatabaseortransactionlogwhenDISKINITfollowedeitheraCREATEDATABASEorALTERDATABASEstatementwhileDISKREINITisusedtorestoredeviceentriestoappropriatesystemtableswhenthedeviceentrywasmissingfromsysdevices.InSQLServer2000theCREATEDATABASEandALTERDATABASEstatementsallowforthecreationofseparatedataandlogfiles.BothCREATEDATABASEandALTERDATABASEcreateoperatingsystemfilesanddatabasesinasinglestep.ItisthusrecommendedthatallreferencestoDISKINITshouldberemovedinSQLServer2000andreplacedwithreferencestoeitherCREATEDATABASEorALTERDATABASE.

    阅读排行