程序師世界是廣大編程愛好者互助、分享、學習的平台,程序師世界有你更精彩!
首頁
編程語言
C語言|JAVA編程
Python編程
網頁編程
ASP編程|PHP編程
JSP編程
數據庫知識
MYSQL數據庫|SqlServer數據庫
Oracle數據庫|DB2數據庫
 程式師世界 >> 數據庫知識 >> DB2數據庫 >> DB2教程 >> 兩種DB2分區數據庫恢復方式

兩種DB2分區數據庫恢復方式

編輯:DB2教程

DB2分區數據庫恢復分為·分區間串行方式和分區間並行方式。下面就為您詳細介紹這兩種DB2分區數據庫恢復方式,供您參考學習。

分區數據庫的恢復操作:

由於備份和恢復操作都只作用於當前數據庫分區,因此也可分為串行和並行的方式。為了在前滾恢復中介紹OVERFLOW 選項的使用,這裡我們將 SAMPLE 數據庫恢復到同實例的一個名為SAMPNEW的新數據庫中,其命令應為:

·DB2分區數據庫恢復--分區間串行方式:

  1. db2_all "db2 restore db sample into sampnew without prompting" 

注:由於是分區數據庫,因此在完成了第一個分區的恢復操作,開始第二個分區的恢復操作時系統會出現SQL2529W的警告,表明數據庫已存在,是否要覆蓋數據恢復的提示,而在某些平台下,如Linux,這一提示會導致分區數據庫恢復操作的失敗,如:

$ db2_all "db2 restore db sample into sapmnew"

DB20000I The RESTORE DATABASE command completed successfully.
rhas3: db2 restore db sample into sapmnew completed ok

SQL2529W Warning! Restoring to an existing database that is different from the backup image database, and the alias name "SAPMNEW" of the existing database do es not match the alias name "SAMPLE" of the backup image, and the database name "SAPMNEW" of the existing database does not match the database name "SAMPLE" of the backup image. The target database will be overwritten by the backup version. The Roll-forward recovery logs associated with the target database will be deleted.
Do you want to continue ? (y/n) SQL2001N The utility was interrupted. The output data may be incomplete.
rhas3: db2 restore db sample into sapmnew completed rc=4

因此建議在上述硬盤數據恢復命令中加入了“WITHOUT PROMPTING”的選項,以避免該提示的出現。

DB2分區數據庫恢復--分區間並行方式

  1. db2_all "<<+0< db2 restore db sample into sampnew"  
  2. db2_all "||<<-0< db2 restore db sample into sampnew without prompting" 

  1. db2_all "<<-0<; db2 restore db sample into sampnew without prompting" 

因編目分區是第一個進行恢復的分區,所以無需加“WITHOUT PROMPTING”選項。

由於我們使用的備份映象文件是通過聯機備份產生的,因此在恢復操作結束後,數據庫將處於前滾暫掛狀態,必須通過前滾操作前滾歸檔日志,以取消前滾暫掛狀態,使數據庫最終可用。

三類DB2數據庫備份方案

DB2批量執行SQL腳本的實現

在線改變DB2頁大小的實現

windows下創建DB2表空間的過程

DB2字符串連接的實現過程

  1. 上一頁:
  2. 下一頁:
Copyright © 程式師世界 All Rights Reserved