backup/restore database

Posted neoo9901

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了backup/restore database相关的知识,希望对你有一定的参考价值。

backup database t-sql

1 BACKUP DATABASE [store] TO  DISK = ND:sql_backstore_backup_2019_01_30_102306_4000360.bak WITH NOFORMAT, NOINIT,  NAME = Nstore_backup_2019_01_30_102306_4000360, SKIP, REWIND, NOUNLOAD,  STATS = 10
2 GO
3 declare @backupSetId as int
4 select @backupSetId = position from msdb..backupset where database_name=Nstore and backup_set_id=(select max(backup_set_id) from msdb..backupset where database_name=Nstore )
5 if @backupSetId is null begin raiserror(N验证失败。找不到数据库“store”的备份信息。, 16, 1) end
6 RESTORE VERIFYONLY FROM  DISK = ND:sql_backstore_backup_2019_01_30_102306_4000360.bak WITH  FILE = @backupSetId,  NOUNLOAD,  NOREWIND

 

 

restore database

1 USE [master]
2 BACKUP LOG [store] TO  DISK = ND:sql_backstore_LogBackup_2019-01-30_10-44-29.bak WITH NOFORMAT, NOINIT,  NAME = Nstore_LogBackup_2019-01-30_10-44-29, NOSKIP, NOREWIND, NOUNLOAD,  NORECOVERY ,  STATS = 5
3 RESTORE DATABASE [store] FROM  DISK = NE:mssqlstore.bak WITH  FILE = 1,  MOVE Nstore TO ND:installstore.mdf,  MOVE Nstore_log TO ND:sql_datastore_log.LDF,  NOUNLOAD,  STATS = 5
4 
5 GO

 

以上是关于backup/restore database的主要内容,如果未能解决你的问题,请参考以下文章

转 RMAN: RAC Backup, Restore and Recovery using RMAN

HBase的备份以及恢复方案

mongodb内建角色

作业迁移

DC间SYSVOL共享不同步

Dropbox 迁移(API v1 已停用)iOS 目标 c(备份、恢复)