自拍偷在线精品自拍偷,亚洲欧美中文日韩v在线观看不卡

IBM DB2 數(shù)據(jù)復(fù)、遷移的實(shí)際操作方法解析

數(shù)據(jù)庫
我們今天主要向大家描述的是IBM DB2 數(shù)據(jù)復(fù)制以及遷移的實(shí)際操作方法,假如你對(duì)IBM DB2 數(shù)據(jù)復(fù)制以及遷移的實(shí)際操作方法很感興趣的話,你就可以瀏覽以下的文章了。

此文章主要講述的是IBM DB2 數(shù)據(jù)復(fù)制以及遷移的實(shí)際操作方法,本文的方法以經(jīng)測(cè)試,我們?cè)诃h(huán)境IBM x346,3.2G×2,4G,RAID 1,DB2 V8.2.4,Win2000 Adv Server,DMS表空間中,數(shù)據(jù)的load速度在60-100萬條/min左右。

 

背景:需要更改數(shù)據(jù)庫表空間,或者需要將數(shù)據(jù)庫中所有表的數(shù)據(jù)遷移到一個(gè)新的數(shù)據(jù)庫中。

步驟:

1. 通過db2控制臺(tái)(db2cc)選中源數(shù)據(jù)庫中的所有表,將其導(dǎo)出成DDL腳本;

2. 根據(jù)需要對(duì)腳本進(jìn)行必要的修改,譬如更改表空間為GATHER;

3. 新建數(shù)據(jù)庫,新建DMS表空間:GATHER;

4. 將DDL腳本在此數(shù)據(jù)庫中執(zhí)行;

5. 編寫代碼查詢?cè)磾?shù)據(jù)庫中的所有表,自動(dòng)生成export腳本;

6. 編寫代碼查詢?cè)磾?shù)據(jù)庫中的所有表,自動(dòng)生成import腳本;

7. 連接源數(shù)據(jù)庫執(zhí)行export腳本;

8. 連接目標(biāo)數(shù)據(jù)庫執(zhí)行import腳本;

附錄1:生成export腳本代碼示例:/**

創(chuàng)建導(dǎo)出腳本

 

 

  1. * @param conn  
  2. * @param creator 表創(chuàng)建者  
  3. * @param filePath  
  4. */  
  5. public void createExportFile(Connection conn,String creator,String filePath) throws Exception {  
  6. DBBase dbBase = new DBBase(conn);  
  7. String selectTableSql = "select name from sysibm.systables where creator = '" + creator + "' and type='T'";  
  8. try {  
  9. dbBase.executeQuery(selectTableSql);  
  10. } catch (Exception ex) {  
  11. throw ex;  
  12. } finally {  
  13. dbBase.close();  
  14. }  
  15. DBResult result = dbBase.getSelectDBResult();  
  16. List list = new ArrayList();  
  17. while (result.next()) {  
  18. String table = result.getString(1);  
  19. list.add(table);  
  20. }  
  21. StringBuffer sb = new StringBuffer();  
  22. String enterFlag = "\r\n";  
  23. for (int i = 0; i < list.size();i++) {  
  24. String tableName = (String)list.get(i);  
  25. sb.append("db2 \"export to aa" + String.valueOf(i+1)+ ".ixf of ixf select * from " + tableName + "\"");  
  26. sb.append(enterFlag);  
  27. }  
  28. String str = sb.toString();  
  29. FileUtility.saveStringToFile(filePath, str, false);  
  30. }  

 

以上的相關(guān)內(nèi)容就是對(duì)IBM DB2 數(shù)據(jù)復(fù)制、遷移方法的介紹,望你能有所收獲。

【編輯推薦】

  1. 使用重定向恢復(fù)DB2數(shù)據(jù)庫的操作技巧是什么?
  2. 使用DB2臨時(shí)表時(shí)哪些事項(xiàng)是值得關(guān)注?
  3. DB2提高IMPORT命令性能的2種操作方案
  4. 提高DB2數(shù)據(jù)庫的 IMPORT命令性能的方式有哪些?
  5. DB2動(dòng)態(tài)SQL與存儲(chǔ)過程SQL查看的實(shí)際操作流程
責(zé)任編輯:佚名 來源: accptech.com
相關(guān)推薦

2010-08-13 10:13:15

DB2數(shù)據(jù)復(fù)制

2010-08-09 13:43:37

DB2數(shù)據(jù)遷移

2010-08-10 14:02:26

IBM DB2數(shù)據(jù)復(fù)制

2010-07-27 13:16:50

DB2使用所有內(nèi)存

2010-09-07 13:04:20

DB2數(shù)據(jù)庫

2010-08-03 09:32:19

DB2在線備份

2010-07-30 14:21:10

DB2數(shù)據(jù)集

2010-08-03 13:56:11

DB2表復(fù)制

2010-08-03 14:55:54

IBM DB2數(shù)據(jù)庫

2010-02-03 10:23:47

C++操作符重載

2009-12-30 15:53:28

Silverlight

2010-08-17 13:25:39

DB2恢復(fù)刪除表

2010-07-27 11:20:02

DB2打補(bǔ)丁

2010-07-30 13:45:17

執(zhí)行DB2

2010-08-03 09:44:42

DB2在線增量備份

2010-08-04 11:12:09

DB2命令執(zhí)行

2010-08-12 09:25:22

DB2數(shù)據(jù)庫復(fù)原

2010-08-12 09:06:30

DB2數(shù)據(jù)庫自動(dòng)備份

2010-08-03 09:49:58

DB2恢復(fù)數(shù)據(jù)庫

2010-08-17 10:06:25

IBM DB2的數(shù)據(jù)復(fù)
點(diǎn)贊
收藏

51CTO技術(shù)棧公眾號(hào)