Sql server restore script(还原数据库正确的步骤)
2012-10-17 16:56
387 查看
Database YourDB has full backup YourBaackUpFile.bak. It can be restored using following two steps.
Step 1: Retrive the Logical file name of the database from backup.
Step 2: Use the values in the LogicalName Column in following Step.
Step 1: Retrive the Logical file name of the database from backup.
RESTORE FILELISTONLY FROM DISK = 'D:BackUpYourBaackUpFile.bak' GO
Step 2: Use the values in the LogicalName Column in following Step.
----Make Database to single user Mode ALTER DATABASE YourDB SET SINGLE_USER WITH ROLLBACK IMMEDIATE
----Restore Database RESTORE DATABASE YourDB FROM DISK = 'D:BackUpYourBaackUpFile.bak' WITH MOVE 'YourMDFLogicalName' TO 'D:DataYourMDFFile.mdf', MOVE 'YourLDFLogicalName' TO 'D:DataYourLDFFile.ldf'
/*If there is no error in statement before database will be in multiuser mode. If error occurs please execute following command it will convert database in multi user.*/ ALTER DATABASE YourDB SET MULTI_USER GO
相关文章推荐
- Sql Server Restore Script-1
- SQL Server Assembly (SQL CLR) 还原数据库后的问题
- SQL Server Management Studio完整备份与还原数据库
- MS SQL Server 2000 数据库使用备份还原造成dbo登录名丢失解决法(转)
- jdbc准备篇之sql server 2008新建数据库,新建登录名详细步骤
- 转摘--MS SQL Server 2000 数据库使用备份还原造成的孤立用户和对象名‘xxx’无效的错误的解决办法
- SQL Server Reporting Service 报错:报表服务器无法解密用于访问报表服务器数据库中的敏感数据或加密数据的对称密钥,必须还原备份密钥或删除所有加密的内容。
- 转帖:MS SQL Server 2000 数据库使用备份还原造成的孤立用户和对象名‘xxx’无效的错误的解决办法
- MS SQLServer数据库日志文件丢失的还原方法
- 在SQL Server Management Studio中还原数据库
- SQL-SERVER 数据库备份 ftp 传到远程服务器 加 restore 数据库 一条龙 附源码
- MS SQL Server 2000 数据库使用备份还原造成dbo登录名丢失解决法
- shrink log和查询数据库 backup,restore,shrink 进度 和 还原历史 的sql (for sqlserver)re
- SQL Server中如何用mdf,ldf文件还原数据库
- SQL Server Reporting Service 报错:报表服务器无法解密用于访问报表服务器数据库中的敏感数据或加密数据的对称密钥,必须还原备份密钥或删除所有加密的内容。
- asp.net 数据库备份还原(sqlserver+access)
- 利用SQL SERVER MANAGER STUDIO 备份数据库和还原数据库 SQL SERVER2005
- 《MS SQL Server 2000管理员手册》系列——33. 还原及回复数据库
- Microsoft SQL Server 2005或者2008还原2000数据库备份的方法
- SqlServer Management Studio还原数据库时左上角出现LSN已断开连接报错