日本综合一区二区|亚洲中文天堂综合|日韩欧美自拍一区|男女精品天堂一区|欧美自拍第6页亚洲成人精品一区|亚洲黄色天堂一区二区成人|超碰91偷拍第一页|日韩av夜夜嗨中文字幕|久久蜜综合视频官网|精美人妻一区二区三区

RELATEED CONSULTING
相關咨詢
選擇下列產品馬上在線溝通
服務時間:8:30-17:00
你可能遇到了下面的問題
關閉右側工具欄

新聞中心

這里有您想知道的互聯(lián)網營銷解決方案
DB2在線備份,以及重定向恢復實戰(zhàn)演習!

以下的文章主要向大家描述的是DB2在線備份,以及重定向恢復的實際操作步驟,相信如果你掌握了DB2在線備份,以及重定向恢復的實際操作步驟,會在以后的學習或是工作中帶來很大的幫助。

目標:在數據庫服務器上備份,然后將這個備份重定向恢復到本機數據庫上。

1.先在數據庫服務器上執(zhí)行如下命令進行全盤DB2在線備份(包括日志) (db2 ? backup可以查看backup幫助信息)

 
 
 
  1. db2 backup db wdcs online to E:\Allan include logs 時間戳為20100420093345 

然后將該備份映像拷貝至本機的C:\temp路徑下

2.在數據庫服務器上執(zhí)行如下命令查看當前數據庫表空間情況

 
 
 
  1. db2 list tablespaces show detail 

3.在本地為原數據庫創(chuàng)建相應的表空間容器。進入cmd窗口執(zhí)行一下命令:

 
 
 
  1. mkdir C:\DB2 \NODE0000\wdcs\syscatspace C:\DB2 \NODE0000\wdcs\indexspace1   
  2. C:\DB2 \NODE0000\wdcs\systoolspace C:\DB2 \NODE0000\wdcs\systoolstmpspace  
  3. C:\DB2 \NODE0000\wdcs\tablespace1 C:\DB2 \NODE0000\wdcs\tempspace1 C:\DB2 \NODE0000\wdcs\userspace1  

 

4.在本地創(chuàng)建一個跟數據庫服務器上同名的空數據庫wdcs: create db wdcs

5.開始本機上執(zhí)行數據庫恢復命令(將日志指定存放的路徑為:

 
 
 
  1. C:\db2workspace\wdcs_log)  
  2. db2 restore db wdcs from c:\temp taken at 20100420093345 into wdcs logtarget c:\db2workspace\wdcs_log redirect  

 

此時會提示要求指定存儲容器路徑

6.要恢復的本地數據庫表空間指定容器,執(zhí)行下列命令 ( 其中的數字:0,1,2,3,4,5,6,7,8是源數據庫的表空間標識,path后面的路徑就是上面第3步建的路徑,標識號和路徑一一對應 ,最后的file "c:\db2workspace\wdcscontainer\dms.dat" 50000;file "c:\db2workspace\wdcscontainer\index.dat" 50000 是重新建立DB2在線備份管理類型的表空間容器)

 
 
 
  1. db2 set tablespace containers for 0 using (path "c:\DB2\node0000\wdcs\syscatspace")  
  2. db2 set tablespace containers for 1 using (path "c:\DB2\node0000\wdcs\tempspace1")  
  3. db2 set tablespace containers for 2 using (path "c:\DB2\node0000\wdcs\userspace1")  
  4. db2 set tablespace containers for 3 using (path "c:\DB2\node0000\wdcs\systoolspace")  
  5. db2 set tablespace containers for 4 using (path "c:\DB2\node0000\wdcs\tablespace1")  
  6. db2 set tablespace containers for 5 using (path "c:\DB2\node0000\wdcs\indexspace1")  
  7. db2 set tablespace containers for 6 using (path "c:\DB2\node0000\wdcs\systoolstmpspace")  
  8. db2 set tablespace containers for 7 using (file "c:\db2workspace\wdcscontainer\dms.dat" 50000)  
  9. db2 set tablespace containers for 8 using (file "c:\db2workspace\wdcscontainer\index.dat" 50000) 

7.然后繼續(xù)執(zhí)行恢復:

 
 
 
  1. db2 restore db wdcs continue 

8. 最后要執(zhí)行前滾命:

 

 
 
 
  1. db2 rollforward db wdcs to end of logs and stop overflow log path (C:\db2workspace\wdcs_log)  

以上的相關內容就是對DB2在線備份,重定向恢復的介紹,望你能有所收獲。


當前名稱:DB2在線備份,以及重定向恢復實戰(zhàn)演習!
網站路徑:http://www.dlmjj.cn/article/dhcsshj.html