SQL Server Management Studio备份和还原数据库的操作
环境:windows10、已经部署好sql server 2008 R2、能成功连接到数据库;
例如:备份class1数据库
BACKUP DATABASE [class1] TO DISK = N'D:\program files\sql server\MSSQLSERVER\MSSQL10_50.MSSQLSERVER\MSSQL\Backup\class1.bak' WITH NOFORMAT, NOINIT, NAME = N'class1-完整 数据库 备份', SKIP, NOREWIND, NOUNLOAD, STATS = 10
GO
备份日志
BACKUP LOG [class1] TO DISK = N'D:\program files\sql server\MSSQLSERVER\MSSQL10_50.MSSQLSERVER\MSSQL\Backup\class2.bak' WITH NOFORMAT, NOINIT, NAME = N'class1-事务日志 备份', SKIP, NOREWIND, NOUNLOAD, STATS = 10
GO
还原
RESTORE DATABASE [class1] FROM DISK = N'D:\program files\sql server\MSSQLSERVER\MSSQL10_50.MSSQLSERVER\MSSQL\Backup\class2.bak' WITH FILE = 1, NOUNLOAD, STATS = 10
GO
版权声明:本文为HelloWorld_4396原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。