SQL Server的备份与恢复
SQL Server:
备份命令:
BACKUP
DATABASE test
TO disk = ‘c:\test‘
WITH FORMAT,
NAME = ‘Full Backup of MyNwind‘
解释如下:
NAME = ‘Full Backup of MyNwind‘ --这个是备注,随便写。
还原命令:
USE master
GO
RESTORE DATABASE test_wt
FROM disk = ‘c:\test_wt‘
GO
mysql:
备份:backup database dbname to disk=‘;d:\dbn.aa‘;
恢复:restore database dbname from disk=‘;d:\dbn.aa‘;
注意:1.在WIN下,路径用path/filename.sql是不行的,那就用path\filename.sql
2. 恢复必须在单用户模式下操作才能够成功,我们需要断开其他用户的连接,并且切换到其他数据库,才能够成功