SQL Server 7.0 ??????? ????? ?? ???????????? ?? ??? ??? ??? ????? ?? ??? ?? ?? ??? ??

???? ?????? ???? ??????
???? ID: 304692 - ?? ???????? ?? ?????? ??? ?? ?? ???? ???? ???? ??.
??? ?? ??????? ???? | ??? ?? ??????? ????

?? ????? ??

??????

?? ???? ????? ???? ?? ?? ???????????? ?? ???? ?????? ????? ??????????? ?? ??? ?? ???? ??? ??? ?? ????? ??????? ????? ?? ?? ?? ???? ???? SQL Server 7.0 ??????? ?? ?????? ?? ??? ??????? ?? ????? ?? ???????????? ???? ?? ??? ???? ????? ??????? ?? ????? ?? ????? ?? ???? ??????? ?? ?? ???? ????? ???, ?? ??????? ???????????? ???? ?? ?? ?? ?? ???? ?? ????? ?? ???? ???????? ???????? ?????? ?? ????? ???? ?? ???? ??? ???? ??????? ?? ??? Microsoft ???????? ??? ???? ????? ?? ??? ????? ???? ?????? ?? ????? ????:
224071SQL Server ??????? ??? SQL Server Detach ?? ??????? ?????? ?? ????? ?? ???? ?? ????? ?? ?? ???? ?? ??? ???? ????
???:: ?? ???? ??? ?? ????????? SQL Server 2000 ?? ??? ???? ???? ???

SQL Server 7.0 ???????????? ???? ?? ??????????,????,msdb?? ????? ?????? ??????? SQL Server 2000 ?? ???? SQL Server 7.0 ?????? ??????? SQL Server 2000 ?? ??? ???? ???? ????

???? ???????

?? ???? ??? ???????? ?? ???? ?? ????? assumptions ???:
  • SQL Server 7.0 ?? ?????? ??????? D:\Mssql7 ?????????? ??? ??, ?? ??????? ??????? ?? ??? ??????? D:\Mssql7\data ??????? ?????????? ??? ????? ????
  • SQL Server 7.0 ?? ??????? ????? C:\Mssql7 ?????????? ??? ??, ?? ??????? ????? ?? ??? ??????? C:\Mssql7\data ??????? ?????????? ??? ????? ????

??????????????

  • ???? ??????? ????? ?? ??? ??????? ?? ??????? ????? ?? ??? particularly ?????????????????? ?? ???,???????????, ??msdb???????:.
  • ???? ?????? ?????????? ??????????? ????
  • ?? ????? ??? ?? ??????? ??? ?? ????? ??????? ?? ?? ???????????? ???? ????? ??? ?? ??? ?? ?? ??? ???? ?? ??? ??????? ?? ??? ?? ???????? ???

    ???:: ????????? ???? ?? ??? ??????? ??? ?? ????? ??? ?? ????? ?? ???????????? ???? ????? ??? ?? ??? ??????? ?? ???, ??? ?? ?????? ???????? ??????? ????? ???? ????? ????mydbdata.bak??????? ?? ????? ??? ????? ?? ??? ??:
    RESTORE FILELISTONLY FROM DISK='d:\mssql7\backup\mydbdata.bak'
    go
    					
  • ????? ?? ?????? SQL Server 7.0 ??????? ???? ????? ?? ?????? ????? ?? ??? ?? ????????
??? ?? ???? ??????? ?? ???? ?? ?? ???? ???? ????? ???? ?? ?? ????????? ?? ????? ???????? ?, ?? ??? SQL ????? ?? ??????? ???? ?? ????, SQL ????? ?????? ??? ?? ???? SQL Server 7.0 ???????? ?????? ???? ? ????????? ?? ????? ?? ??? ?????

??????? ???????????? ???? ?? ???

  1. ???????????? ?????????????????:.

    ????? ?????? ???????????????? ??? ?? ???? ?????, Master.mdf ?? ?? ??? ????, ???? ??????? ????? ????? ??, Master_db.bak Mastlog.ldf ???
    1. ?? SQL ????? ?? ??????? ???? ?? ??? ????? ????????? ?? ????? ???? ?????:
      d:\mssql7\binn\sqlservr -c -m

      ???::-m???-??????????-??? ??? ????? SQL Server ??????? ???? ??? ??? ?????????? ??? ???, ?? ???? ??????????? ??? ??? ??????? ?? ?? ???? ???? ????? ??? ???? ????????? ?? ?????? ?? ?? ??????? ????? ??? SQL ?????? ???????? ????? ?? ?????? ???? ?? ???? ?? ??????? ?? ?????
    2. ??? SQL ????? ?????? ????????, ?? ????? ????? ???????? ?? ????? ???????????? ???? ?? ????????????????::
      RESTORE DATABASE master FROM disk='d:\mssql7\backup\master_db.bak'
      WITH MOVE 'master' to 'd:\mssql7\data\master.mdf',
      MOVE 'mastlog' to 'd:\mssql7\data\mastlog.ldf',
      REPLACE
      go
      ???:: SQL Server ?? ???? ???????? ??? ?? ???????????? ???? ?? ????????????????:.
    3. ?? SQL ????? ?? ??????? ???? ?? ??? ????? ????????? ?? ????? ???? ?????:
      d:\mssql7\binn\sqlservr -c -f -T3608 -T4022
      ???:: ?????? ?? ???????? ?? ????? ??, ?? ?????? ?????? ?????? ?? ???? ????
    4. ??? SQL ????? ?????? ????????, ????? ??? ?? ????? ??? ?? ????????? ????:

      ???????:: ?????? ???? ?????? ???????? ??? ??? ?? ????? ?????? ?? ?? ???? ???? SQL ????? ??????? ?? ???????????? ???? ??? ???? ?? ???? ?? ???? ???? Microsoft ?? ?????? ???? ?? ?? ?????? ??? ???? ?? ?????? ???????? ?? ???????????? ???????? ?? ?? ?? ???? ???? ???????? ?? ???? ????? ?? ?????? ?? ?????? ?????
      USE master
      go
      UPDATE sysdatabases SET filename='d:\mssql7\data\tempdb.mdf' WHERE name='tempdb'
      go
      ALTER DATABASE tempdb MODIFY FILE (name = tempdev, filename = 'd:\mssql7\data\tempdb.mdf')
      ALTER DATABASE tempdb MODIFY FILE (name = templog, filename = 'd:\mssql7\data\templog.ldf')
      go
      ?? ???????? confirming ????? ????? ??????? ???? ?????:
      ????? 'tempdev' sysaltfiles ??? ??????? ????? SQL ????? ?? ???????? ???? ?? ??? ?????? ????? ?? ??? ????

      ????? 'templog' sysaltfiles ??? ??????? ????? SQL ????? ?? ???????? ???? ?? ??? ?????? ????? ?? ??? ????
  2. ???????????? ???????????????:.

    ????? ?????? ?????????????? ??? ?? ???? ????? Model.mdf ?? ?? ??? ????, ???? ??????? ????? ????? ??, Model_db.bak Modellog.ldf ??? ??? ???? ??? ?? ????? ???? ????????????? ?? ??? ?? SQL ????? ??????? ?? ????? ???????? ??? ?? ??????? ?? ?? ?? ?? ????? ???? ????? ???, ?? ?? remap ?? ???? ??????????????:. ?? ????????? ?? ??? ???? ?? ????????? ?? ???? ???? ??northwind??????? ??pubs??? 4 ??? ????????
    1. ??? SQL ????? ?????? ????????, ????????? ??????? ?? ??? ???? ?? ??? ????? ???????? ??????????????? SQL Server ???????:
      exec sp_detach_db N'model'
      go
      ?? ???????? ????????? ?? ????????? ???? ?? ??? ???? ????? ????? ??????? ???? ??:
      '????' ??????????? detached ???????
      DBCC ???????? ?????? ??? DBCC ??????? ?????? ????? ??, ?? ???? ?????? ?????????? ?? ?????? ????
      ???:: ?? ??? ???? ?? ???????? ????????????? ?? ???? ???? ??? ???????? ?? ????? ?? ??????????????????? ???????? ??????? ???????????? ???? ?? ???? ?? ?????? ??????? ?? ??? ?????? ???? ?????? ?? ??????? ?? ??? ??? ???? ??? ??, ?? ?? ?????? ???????????? ??????? ?? ???????? ?? ??? ??????? ????? ???? ?? ?????
    2. ??? SQL ????? ?????? ????????, ?? ????? ????? ???????? ?? ????? ???????????? ???? ?? ??????????????::
      RESTORE DATABASE model FROM disk='d:\mssql7\backup\model_db.bak'
      WITH MOVE 'modeldev' TO 'd:\mssql7\data\model.mdf',
           MOVE 'modellog' TO 'd:\mssql7\data\modellog.ldf',
           REPLACE
      go
      ???:???????????? ???? ?? ??? SQL ????? ?? ??????? ??? ?????????????:.
  3. ???????????? ????msdb???????:.

    ????? ?????? ???msdb??????? ??? ?? ???? ?????, Msdbdata.mdf ?? ?? ??? ????, ???? ??????? ????? ????? ??, Msdb_db.bak Msdblog.ldf ???
    1. ?? SQL ????? ?? ??????? ???? ?? ??? ????? ????????? ?? ????? ???? ?????:
      d:\mssql7\binn\sqlservr -c -f -T3608 -T4022
    2. ??? SQL ????? ?????? ????????, ????????? ??? ???? ?? ??? ????? ???????? ?????????msdb???????::
      exec sp_detach_db N'msdb'
      go
    3. ??? SQL ????? ?????? ????????, ?? ????? ????? ???????? ?? ????? ???????????? ???? ?? ???msdb???????::
      RESTORE DATABASE msdb FROM disk='d:\mssql7\backup\msdb_db.bak'
      WITH MOVE 'msdbdata' TO 'd:\mssql7\data\msdbdata.mdf',
           MOVE 'msdblog' TO 'd:\mssql7\data\msdblog.ldf',
           REPLACE
      go
      ???:The connection to SQL Server is broken after you restore themsdb???????:.
  4. Thenorthwind, ??pubsdatabases:

    After you restore themasterdatabase, the system table entries for thenorthwinddatabase and thepubsdatabase are changed and the two database, like all of the other user databases, are in Suspect mode. If you want to reuse the original database files and re-attach them to the server, you can use the following example. Otherwise, if you want to restore a copy from backup, use themydbdatabase example that is described in step 6. Use the following example to update the system table references for thenorthwind???????:. Thenorthwinddatabase contains one data file, Northwind.mdf, and one log file, Northwind.ldf.
    1. Run the following command from a command prompt to start SQL Server:
      d:\mssql7\binn\sqlservr -c -f -T3608 -T4022
    2. In SQL Server Query Analyzer, execute the following stored procedure to detach thenorthwind???????::
      exec sp_detach_db N'northwind'
      go

      ???:: You may receive the following message that indicates that there is no access to physical files:
      Server: Msg 947, Level 16, State 1, Line 1 Error while closing database 'Northwind' cleanly.
      Successfully detached database 'northwind'.
      DBCC execution completed. If DBCC printed error messages, contact your system administrator.
    3. In SQL Server Query Analyzer, use the following syntax to attach thenorthwind???????::
      exec sp_attach_db N'northwind', N'd:\mssql7\data\northwnd.mdf', N'd:\mssql7\data\northwnd.ldf'
      go
  5. Remap thepubs???????:.

    Thepubsdatabase contains one data file, Pubs.mdf, and one log file, Pubs_log.ldf. You can remap thepubsdatabase in the same way that you remapped thenorthwind???????:.
  6. Restore themydb???????:.

    Themydbdatabase contains one data file, Mydbdata.mdf, and one log file, Mydblog.ldf, from the full database backup file, Mydb_db.bak.
    1. In SQL Server Query Analyzer, execute the following stored procedure to detach themydb???????::
      exec sp_detach_db N'mydb'
      go
    2. ??? SQL ????? ?????? ????????, ?? ????? ????? ???????? ?? ????? ???????????? ???? ?? ???mydb???????::
      RESTORE DATABASE mydb FROM disk='d:\mssql7\backup\mydb_db.bak'
      WITH MOVE 'mydbdata' TO 'd:\mssql7\data\mydbdata.mdf',
           MOVE 'mydblog' TO 'd:\mssql7\data\mydblog.ldf',
           REPLACE
      go
  7. SQL ????? ?? ??? ??????

    ??????????: ??? SQL ????? ??????? ?? ??? ?? ?? ?? ??? ???? ???????????? ?? ??? ????? ?? ??? ???? ??? ???? ?? ????????? ?????? ???????????????:.

    ?????? ?? ???, ?? ???? ?????????? SQL Server ???:

    • ?? ??????? ?? ????? ?? SOURCESVR TARGETSVR ??? ?? ?? ???? ???????? ?? ??? ?? ?? ???? ???????? ?? ???? ???????? ???
    • ??? SQL ????? ?? ????? ??? SOURCESVR TARGETSVR ??? ???? ???????? ???
    ??? ?? SQL ????? ?? ??? ????? ????? ???, ?? ???????? ?? ??? ?? SQL ????? ??? ?? ?????????? ???? ?? ??? ???????? ???????? ?? ????? ????:
    exec sp_dropserver 'SOURCESVR'
    go
    exec sp_addserver 'TARGETSVR', 'LOCAL'
    go
  8. SQL ????? ???? ?? ???????? ?????

??????

???? ??????? ?? ???, Microsoft ?????? ??? ??? ???? ????? ?? ??? ????? ???? ?????? ????? ????::
224071SQL Server ??????? ??? SQL Server Detach ?? ??????? ?????? ?? ????? ?? ???? ?? ????? ?? ?? ???? ?? ??? ???? ????
314546??????? ?? SQL Server ??? ??? ???????? ?? ??? ?? ???? ?? ??? ???? ????
???:: ???????? ??????? ?? ??? ???? ???? ????????? ?????? ?? ???? ???-c,-m, ??-f, SQL Server ???????? ?????? ???? ?? ??? ????? ??????

???

???? ID: 304692 - ????? ???????: 04 ?????? 2010 - ??????: 2.0
???? ???? ???? ??:
  • Microsoft SQL Server 7.0 Standard Edition
??????: 
kbinfo kbmt KB304692 KbMthi
???? ?????? ????????
??????????: ?? ???? ?? ???? ??????? ?? ????? ?? Microsoft ????-?????? ?????????? ?????? ?????? ???? ??? ??. Microsoft ???? ??? ????-???????? ?? ????-???????? ????? ?????? ?? ???? ???????? ???? ?? ???? ????? ????? ??? ?? ??? ?????? ?? ???? ???? ???? ??? ????? ??. ???????, ????-???????? ???? ????? ???? ???? ???? ???. ?????, ????????, ?????-???? ?? ??????? ?? ???????? ?? ???? ???, ???? ?? ??? ?????? ???? ???? ??? ????? ??? ?? ???? ??. Microsoft ??????? ??? ???? ?? ?????? ?? ??????????, ????????? ?? ??? ?????? ?? ???? ????? ?? ???? ???????? ?? ??? ???? ????? ?? ??? ????????? ???? ??. Microsoft ????-?????? ?????????? ?? ????? ?????? ?? ?? ??? ??.
?????????? ?? ??????? ????????? ??????? ??:304692

??????????? ???

 

Contact us for more help

Contact us for more help
Connect with Answer Desk for expert help.
Get more support from smallbusiness.support.microsoft.com