WEB开发网
开发学院数据库MySQL 在附加多个.MDF文件时重新建立日志 阅读

在附加多个.MDF文件时重新建立日志

 2010-06-21 00:00:00 来源:WEB开发网   
核心提示: 'C:\Data\MyDB18.mdf'结果:Msg 8144, Level 16, State 2, Procedure sp_attach_db, Line 0Procedure or function sp_attach_db has too many arguments

'C:\Data\MyDB18.mdf'

结果:

Msg 8144, Level 16, State 2, Procedure sp_attach_db, Line 0

Procedure or function sp_attach_db has too many arguments specified.

因为我们将附加更多的文件,所以我们不使用sp_attach_single_file_db系统存储过程。所以让我们使用带有“for ATTACH_REBUILD_LOG”的“Create database”语句试着附加它们。执行下面的事务SQL语句。

 CREATE DATABASE MyDB1
  ON
  (FILENAME = 'C:\Data\MyDB1.mdf'),
  (FILENAME = 'C:\Data\MyDB2.mdf'),
  (FILENAME = 'C:\Data\MyDB3.mdf'),
  (FILENAME = 'C:\Data\MyDB4.mdf'),
  (FILENAME = 'C:\Data\MyDB5.mdf'),
  (FILENAME = 'C:\Data\MyDB6.mdf'),
  (FILENAME = 'C:\Data\MyDB7.mdf'),
  (FILENAME = 'C:\Data\MyDB8.mdf'),
  (FILENAME = 'C:\Data\MyDB9.mdf'),
  (FILENAME = 'C:\Data\MyDB10.mdf'),
  (FILENAME = 'C:\Data\MyDB11.mdf'),
  (FILENAME = 'C:\Data\MyDB12.mdf'),
  (FILENAME = 'C:\Data\MyDB13.mdf'),
  (FILENAME = 'C:\Data\MyDB14.mdf'),
  (FILENAME = 'C:\Data\MyDB15.mdf'),
  (FILENAME = 'C:\Data\MyDB16.mdf'),
  (FILENAME = 'C:\Data\MyDB17.mdf'),
  (FILENAME = 'C:\Data\MyDB18.mdf')
  for ATTACH_REBUILD_LOG
  GO
  结果:
  File activation failure. The physical file name "C:\Data\MyDB1.ldf" may be incorrect.
  File activation failure. The physical file name "C:\Data\MyDB2.ldf" may be incorrect.
  File activation failure. The physical file name "C:\Data\MyDB3.ldf" may be incorrect.
  File activation failure. The physical file name "C:\Data\MyDB4.ldf" may be incorrect.
  File activation failure. The physical file name "C:\Data\MyDB5.ldf" may be incorrect.
  File activation failure. The physical file name "C:\Data\MyDB6.ldf" may be incorrect.
  File activation failure. The physical file name "C:\Data\MyDB7.ldf" may be incorrect.
  File activation failure. The physical file name "C:\Data\MyDB8.ldf" may be incorrect.
  File activation failure. The physical file name "C:\Data\MyDB9.ldf" may be incorrect.
  File activation failure. The physical file name "C:\Data\MyDB10.ldf" may be incorrect.
  File activation failure. The physical file name "C:\Data\MyDB11.ldf" may be incorrect.
  File activation failure. The physical file name "C:\Data\MyDB12.ldf" may be incorrect.
  File activation failure. The physical file name "C:\Data\MyDB13.ldf" may be incorrect.
  File activation failure. The physical file name "C:\Data\MyDB14.ldf" may be incorrect.
  File activation failure. The physical file name "C:\Data\MyDB15.ldf" may be incorrect.
  File activation failure. The physical file name "C:\Data\MyDB16.ldf" may be incorrect.
  File activation failure. The physical file name "C:\Data\MyDB17.ldf" may be incorrect.
  New log file 'C:\Data\MyDB1_log.LDF' was created.

总结

本篇文章介绍了在附加多个.MDF文件时怎样重建日志。

上一页  1 2 3 4 

Tags:附加 多个 MDF

编辑录入:爽爽 [复制链接] [打 印]
赞助商链接