精华帖 (0) :: 良好帖 (0) :: 新手帖 (0) :: 隐藏帖 (0)
|
|
---|---|
作者 | 正文 |
发表时间:2011-07-22
sqlserver版本:2008 某个数据库,在sqlserver 2008 r2 下创建 尝试将备份还原的别的机子上,均报如下错误:
执行 Transact-SQL 语句或批处理时发生了异常。 (Microsoft.SqlServer.ConnectionInfo) The Cause of the Problem is that the Drive in which your Source Data base files are located is not present in your server where you want to restore the database. Please use the SQLCMD Promt and use the Manula RESTORE command with REPLACE and MOVE option .But before using the Restore command get the logical file name of your source database syntax : RESTORE DATABASE [TestServer28Sep2010] FROM DISK = 'C:\BackUp\TestServer28Sep2010.bak' WITH REPLACE , MOVE 'SourceLogicalFileName_Data' TO 'D:\JapanTestServerDB\TestServer28Sep2010.mdf', MOVE SourceLogicalFileName_log' TO 'D:\JapanTestServerDB\Server28Sep2010.ldf'
因此,请使用如下方法还原: 1. 从 cmd 进入 sqlcmd . 2. 输入 以下语句,再输入 go 即可执行: RESTORE DATABASE 还原后的数据库名 FROM DISK = 'D:\yjdb\pms_yj_20110722.bak(备份文件)' WITH REPLACE , MOVE 'pms_yujia(曾经的mdf逻辑名)' TO 'D:\yjdb\pms_yujia.mdf(mdf还原后的路径)', MOVE 'pms_yujia_log(曾经的ldf逻辑名)' TO 'D:\yjdb\pms_yujia_log.ldf(ldf还原后的路径)' 声明:ITeye文章版权属于作者,受法律保护。没有作者书面许可不得转载。
推荐链接
|
|
返回顶楼 | |
浏览 9103 次