用命令实现SQLServerr的备份与还原
一、备份数据库,命令如下:
USE master;
GO
BACKUP DATABASE mytest TO DISK='E:\disk\mytest.bak' /* mytest为数据库名称,'E:\disk\mytest.bak'为备份路径 */
二、还原数据库
USE master;
GO
RESTORE DATABASE mytest FROM DISK='E:\disk\mytest.bak' WITH REPLACE
一、备份数据库,命令如下:
USE master;
GO
BACKUP DATABASE mytest TO DISK='E:\disk\mytest.bak' /* mytest为数据库名称,'E:\disk\mytest.bak'为备份路径 */
二、还原数据库
USE master;
GO
RESTORE DATABASE mytest FROM DISK='E:\disk\mytest.bak' WITH REPLACE