最近想回顾下以前做的一个项目,发现了一个数据库文件,
是在sql2000上备份的一个数据库,现在不知道后缀名了,
于是,在sql2005上,将其重命名成Xyz.mdf后,附加数据库不成功;
重命名成Xyz.bak候,在sql2005上薪建个Xyz的库,经过跟一个哥们的讨论后,尝试使用下面的语句恢复数据库:
RESTORE DATABASE [DiningRoomMISData]
FROM DISK = N'C:"Program Files"Microsoft SQL Server"MSSQL.2"MSSQL"Backup"DDDMISData'
WITH FILE = 1, NOUNLOAD, STATS = 10
GO
结果弹出
“Msg 3159, Level 16, State 1, Line 1
The tail of the log for the database " DDDMISData " has not been backed up. Use BACKUP LOG WITH NORECOVERY to backup the log if it contains work you do not want to lose. Use the WITH REPLACE or WITH STOPAT clause of the RESTORE statement to just overwrite the contents of the log.
Msg 3013, Level 16, State 1, Line 1
RESTORE DATABASE is terminating abnormally.
”的提示未备份DDDMISData数据库。
根据提示改成:
RESTORE DATABASE [DiningRoomMISData]
FROM DISK = N'C:"Program Files"Microsoft SQL Server"MSSQL.2"MSSQL"Data"DiningRoomMIS2'
WITH FILE = 1, NOUNLOAD, STATS = 10 ,REPLACE
GO
后执行成功。
,其他的方法没尝试。哈哈