创建数据库快照

 

 
  
  1. create database 快照数据库名  
  2. on  
  3. (  
  4. name=数据库属性名,  
  5. filename='快照文件存储路径' 
  6. )  
  7. as snapshot of 被快照的数据库名;  
  8. go 

例:

 

 
  
  1. create database test_snapshot_1    
  2. on    
  3. (   
  4.  name=data1,    
  5. filename='c:\snapshot\test_snap_1.ss'   
  6. )    
  7. as snapshot of data_test_1;    
  8. go  

还原数据库快照

 

 
  
  1. restore database 快照数据库名  
  2. from database_snapshot='快照数据库名' 
  3. go 

例:

 

 
  
  1. restore database test_snapshot_1  
  2. from database_snapshot='test_snapshot_1' 
  3. go