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

IBM DB2數(shù)據(jù)復(fù)制以及遷移,以實例講述

數(shù)據(jù)庫
以下的文章主要是闡述應(yīng)用實例對IBM DB2數(shù)據(jù)復(fù)制以及遷移的實際操作方法的介紹,假如你對其實際操作方案有興趣了解的話,你就可以瀏覽以下的文章了。

以下的文章主要向大家描述的是應(yīng)用實例對IBM DB2數(shù)據(jù)復(fù)制以及遷移的實際操作方法的介紹,以下方法經(jīng)測試,在環(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ù)遷移到一個新的數(shù)據(jù)庫中。

步驟

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

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

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

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

5.編寫代碼查詢源數(shù)據(jù)庫中的所有表,自動生成export腳本;

6.編寫代碼查詢源數(shù)據(jù)庫中的所有表,自動生成import腳本;

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

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

生成export腳本代碼示例如下:

/**

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

* @param conn

* @param creator表創(chuàng)建者

 

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

 

 

以上的相關(guān)內(nèi)容就是對應(yīng)用實例對IBM DB2數(shù)據(jù)復(fù)制以及遷移的實際操作方法的介紹,望你能有所收獲。

【編輯推薦】

  1. 對DB2 9數(shù)據(jù)庫優(yōu)點(diǎn)的詳細(xì)描述
  2. IBM DB2數(shù)據(jù)庫無限活動的日志策略的破解
  3. 對DB2服務(wù)器主機(jī)名的修改的正確操作流程
  4. 使用DB2數(shù)據(jù)庫時哪些知識點(diǎn)是必須記住的?
  5. DB2 batch update在實際操作中的注意事項

 

 

責(zé)任編輯:佚名 來源: ej38.com
相關(guān)推薦

2011-03-16 13:02:47

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

2010-08-17 10:06:25

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

2010-08-12 10:34:40

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

2010-08-10 14:02:26

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

2010-08-19 10:32:07

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

2010-08-20 13:39:23

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

2010-08-13 16:29:03

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

2012-02-26 16:58:48

DB2數(shù)據(jù)庫遷移之星

2011-09-23 09:41:58

2010-08-06 11:21:45

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

2009-07-06 17:34:26

遠(yuǎn)程復(fù)制DB2

2010-08-26 10:37:40

DB2Q復(fù)制

2010-06-10 14:49:20

db2 9.7sybaseroi

2010-09-01 13:38:41

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

2012-11-12 10:30:25

IBMdw

2011-03-28 12:42:35

ibmdwDB2

2010-08-17 16:24:32

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

2011-03-07 15:36:53

SAPIMBDB2

2010-08-13 18:06:03

IBM DB2

2009-03-20 11:33:45

DB2數(shù)據(jù)轉(zhuǎn)移數(shù)據(jù)庫
點(diǎn)贊
收藏

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