sqlserver2008 3154

我在使用sqlserver2008时,使用别人发回的一个ceshishuju.bak文件进行还原我的数据库:CQMineOA,但是很不幸的报了3154错误。
报错为:
Msg 3634, Level 16, State 1, Line 1
The operating system returned the error '32(failed to retrieve text for this error. Reason: 15105)' while attempting 'RestoreContainer::ValidateTargetForCreation' on 'C:\Program Files\Microsoft SQL Server\MSSQL10.SQL2008TESTI\MSSQL\DATA\AdventureWorks_Data.mdf'.
Msg 3156, Level 16, State 8, Line 1
File 'AdventureWorks_Data' cannot be restored to 'C:\Program Files\Microsoft SQL Server\MSSQL10.SQL2008TESTI\MSSQL\DATA\AdventureWorks_Data.mdf'. Use WITH MOVE to identify a valid location for the file.
Msg 3634, Level 16, State 1, Line 1
The operating system returned the error '32(failed to retrieve text for this error. Reason: 15105)' while attempting 'RestoreContainer::ValidateTargetForCreation' on 'C:\Program Files\Microsoft SQL Server\MSSQL10.SQL2008TESTI\MSSQL\DATA\AdventureWorks_Log.ldf'.
Msg 3156, Level 16, State 8, Line 1
File 'AdventureWorks_Log' cannot be restored to 'C:\Program Files\Microsoft SQL Server\MSSQL10.SQL2008TESTI\MSSQL\DATA\AdventureWorks_Log.ldf'. Use WITH MOVE to identify a valid location for the file.
Msg 3119, Level 16, State 1, Line 1
Problems were identified while planning for the RESTORE statement. Previous messages provide details.
Msg 3013, Level 16, State 1, Line 1
RESTORE DATABASE is terminating abnormally.

在网上搜索了很久,前两个解决方案是:
【省略。。。找不到了】

后来在网上查了下。 我对sqlserver不是很熟,但是猜测是对方建的数据库是D盘的某某位置,并且数据库名就叫ceshishuju,所有要使用move命令来重定向。。。我大概这么理解,不求甚解先
restore database CQMineOA from disk = 'e:\ceshishuju.bak'   
WITH MOVE 'ceshishuju' TO 'E:\db\Microsoft SQL Server\MSSQL10.SQLEXPRESS\MSSQL\DATA\CQMineOA.mdf',
MOVE 'ceshishuju_log' TO 'E:\db\Microsoft SQL Server\MSSQL10.SQLEXPRESS\MSSQL\DATA\CQMineOA.ldf',
replace,NOUNLOAD,STATS=10 
GO



附上一个参考网站: http://www.eggheadcafe.com/community/sql-server/13/10084840/sql-server-2005-restore-from-a-different-sever.aspx

猜你喜欢

转载自13146489.iteye.com/blog/1447011