1. backup
1.1 backup database
BACKUP DATABASE [_db] TO DISK = N'C:\dbBackupTest\MC\db\test' WITH NOINIT , NOUNLOAD , NAME = N'_db backup', NOSKIP , STATS = 10, NOFORMAT
1.2 backup transaction log
BACKUP LOG [db] TO DISK = N'C:\dbBackupTest\MC\db\testlog' WITH NOINIT , NOUNLOAD , NAME = N'_db backup', NOSKIP , STATS = 10, NOFORMAT
--restore
--allow transaction log restore after database restore
RESTORE DATABASE [_db] FROM DISK = N'C:\dbBackupTest\MC\cdsdb\_db_200905090700.BAK' WITH FILE = 1, NOUNLOAD , STATS = 10, NORECOVERY
--allow more transaction log restore after transaction log restore
RESTORE LOG [_db] FROM DISK = N'C:\dbBackupTest\MC\db\_db_tlog_200905091000.TRN' WITH FILE = 1, NOUNLOAD , STATS = 10, NORECOVERY
--last transaction log, put the db operational
RESTORE LOG [_db] FROM DISK = N'C:\dbBackupTest\MC\db\_db_tlog_200905100600.TRN' WITH FILE = 1, NOUNLOAD , STATS = 10, RECOVERY
No comments:
Post a Comment