--将数据库完整备份到物理备份设备 Backup database Practice_JWGL To disk = ‘E:\DataBase\Practice_JWGL_20141021.bak’ Go --将数据库差异备份到物理备份设备 Backup database Practice_JWGL To disk = ‘E:\DataBase\Practice_JWGL_20141021.bak’ With differential Go --验证物理备份设备上的备份文件是否有效 Restore verifyonly from disk = ‘E:\DataBase\ Practice_JWGL_20141021.bak’ go --完整的数据库还原 restore database Practice_JWGL from Practice_JWGL_20141021 with file=1, replace move ‘Practice_JWGL’ to ‘E:\DataBase\Practice_JWGL.mdf’, move ‘Practice_JWGL_log’ to ‘E:\DataBase\Practice_JWGL_log.ldf’ gowith file=1来指定选择备份文件中的第1个备份集。
--差异数据库还原 restore database Practice_JWGL from Practice_JWGL_20141021 with file=2 , recovery gowith norecovery 参数表明将数据库置于“正在还原”状态,并对提交的事务不进行任何操作。如果不写,默认with recovery表示回滚未提交的事务。
--打开master数据库 use master go --完整的数据库还原 restore database Practice_JWGL from Practice_JWGL_20141021 with file=1, norecovery, replace go --差异的数据库还原 restore database Practice_JWGL from Practice_JWGL_20141021 with file=2, norecovery go 尾日志数据库还原 restore log Practice_JWGL from Practice_JWGL_20141021 with file=3, recovery go
原文地址:http://blog.csdn.net/crazygolf/article/details/40377069