程序師世界是廣大編程愛好者互助、分享、學習的平台,程序師世界有你更精彩!
首頁
編程語言
C語言|JAVA編程
Python編程
網頁編程
ASP編程|PHP編程
JSP編程
數據庫知識
MYSQL數據庫|SqlServer數據庫
Oracle數據庫|DB2數據庫
 程式師世界 >> 數據庫知識 >> DB2數據庫 >> DB2教程 >> DB2數據庫備份測試的操作步驟

DB2數據庫備份測試的操作步驟

編輯:DB2教程

以下的文章主要描述的是DB2數據庫備份測試的操作步驟,以及在其實際操作中的值得大家注意的事項與其代碼的描述,以下就是文章的主要內容的詳細描述,望大家在浏覽之後會對其有更深的了解。

開始備份實例講解】

DB2, DB2備份

1、做一個在線全備操作:

  1. [db2inst1@db2 ~]$ db2 backup db sample online to /tmp/db2inst1/sample/off_back include logs  
  2. Backup successful. The timestamp for this backup image is : 20090917061921 

2、創建一個表,並插入數據:

  1. db2 => connect to sample  
  2. Database Connection Information  
  3. Database server 
  4. = DB2/LINUX 9.1.3  
  5. SQL authorization ID 
  6. = DB2INST1 
  7. Local database alias 
  8. = SAMPLE 
  9. db2 => insert into sales1 select * from sales  
  10. DB20000I  
  11. The SQL command completed successfully.  
  12. db2 => insert into sales1 select * from sales1  
  13. DB20000I  
  14. The SQL command completed successfully.  
  15. db2 => insert into sales1 select * from sales1  
  16. DB20000I  
  17. The SQL command completed successfully  
  18. db2 => select * from sales1  
  19. SALES_DATE SALES_PERSON  
  20. REGION  
  21. SALES  
  22. 12/31/2005 LUCCHESSI  
  23. Ontario-South  
  24. 1  
  25. 12/31/2005 LEE  
  26. Ontario-South  
  27. 3  
  28. 12/31/2005 LEE  
  29. Quebec  
  30. 1  
  31. 12/31/2005 LEE  
  32. Manitoba  
  33. 2  
  34. 12/31/2005 GOUNOT  
  35. Quebec  
  36. 1  
  37. 03/29/2006 LUCCHESSI  
  38. Ontario-South  
  39. 3  
  40. 03/29/2006 LUCCHESSI  
  41. Quebec  
  42. 。。。。。。。。。。。  

3、做增量DB2數據庫備份:

  1. [db2inst1@db2 ~]$ db2 backup db sample online incremental to /tmp/db2inst1/sample/off_back include logs  
  2. Backup successful. The timestamp for this backup image is : 20090917062532 

4、刪除表操作:

  1. [db2inst1@db2 off_back]$ db2stop force  
  2. 09/17/2009 06:26:47  
  3. 0  
  4. 0  
  5. SQL1064N  
  6. DB2STOP processing was successful.  
  7. SQL1064N  
  8. DB2STOP processing was successful.  
  9. [db2inst1@db2 off_back]$ db2start  
  10. 09/17/2009 06:26:57  
  11. 0  
  12. 0  
  13. SQL1063N  
  14. DB2START processing was successful.  
  15. SQL1063N  
  16. DB2START processing was successful.  
  17. db2 => connect to sample  
  18. Database Connection Information  
  19. Database server 
  20. = DB2/LINUX 9.1.3  
  21. SQL authorization ID 
  22. = DB2INST1 
  23. Local database alias 
  24. = SAMPLE 
  25. db2 => drop table sales1  
  26. DB20000I  
  27. The SQL command completed successfully.  
  28. db2 => select * from sales1  
  29. SQL0204N  
  30. "DB2INST1.SALES1" is an undefined name.  
  31. SQLSTATE=42704 

以上的相關內容就是對DB2數據庫備份測試的介紹,望你能有所收獲。

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