SQL Server還原選項:
--建立備份裝置
sp_addumpdevice 'disk',jasonbak ,'C:\jason.bak'
--備份
backup database northwind to jasonbak
with noinit--(附加,不加參數時預設)
with init--(重寫備份裝置的內容)
with format--(重新格式化備份裝置,使用)
--還原
restore filelistonly from jasonbak
--查看檔案清單(只能看到第一個備份內容)
restore headeronly from a]
--查看裝置內內容
restore verifyonly from a
--校正
restore database pubs from jasonbak
restore database northwind from jasonbak with file=2
restore database northwind from jasonbak with norecovery
restore log northwind from jasonbak with file=2
--Changed to Simple修改恢複模型後一定要完全備份資料庫
backup database northwind to jasonbak with format
--change back to Full
create table jason2 (Idd int)
backup log northwind to jasonbak
restore verifyonly from jasonbak
drop database northwind
restore database northwind from jasonbak with norecovery
restore log northwind from jasonbak with file=2
--Full Backup nw
--Create Table1 ,write down the time
--Create Table2 ,write down the time
--Backup Log
--Drop nw
--Recover Nw
--Recover Table1, No table2
backup database northwind to jasonbak with format
Create table table1 (IDD int) --21.13.26
Create table table2 (IDD int) --21.13.35
backup log northwind to jasonbak
restore northwind from jasonbak with stopat=""