成人免费xxxxx在线视频软件_久久精品久久久_亚洲国产精品久久久_天天色天天色_亚洲人成一区_欧美一级欧美三级在线观看

IBM DB2數(shù)據(jù)的復(fù)制與遷移的實(shí)現(xiàn)步驟

數(shù)據(jù)庫
我們今天是要和大家一起討論的是IBM DB2數(shù)據(jù)復(fù)制與遷移的實(shí)際操作方法,以及對(duì)其的實(shí)際操作背景的詳細(xì)解說,以下就是正文的描述。

文章主要描述的是IBM DB2數(shù)據(jù)復(fù)制與遷移的實(shí)際操作方法,你如果對(duì)IBM DB2數(shù)據(jù)復(fù)制與遷移的實(shí)際操作方法有興趣的話你就可以點(diǎn)擊以下的文章進(jìn)行觀看了,以下就是文章的主要內(nèi)容的詳細(xì)描述。

IBM, 數(shù)據(jù), 遷移, 講解IBM, 數(shù)據(jù), 遷移, 講解

 

關(guān)鍵詞: 遷移 , 復(fù)制 , 方法 , IBM , DB2 , 數(shù)據(jù)

 

 

以下方法經(jīng)測(cè)試,在環(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ù)庫中所有表的IBM DB2數(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.連接源IBM DB2數(shù)據(jù)數(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. public void createExportFile(Connection conn,String creator,String filePath) throws Exception {     
  5. DBBase dbBase = new DBBase(conn);     
  6. String selectTableSql = "select name from sysibm.systables where creator = '" + creator + "' and type='T'";     
  7. try {     
  8. dbBase.executeQuery(selectTableSql);     
  9. } catch (Exception ex) {     
  10. throw ex;     
  11. } finally {     
  12. dbBase.close();     
  13. }     
  14. DBResult result = dbBase.getSelectDBResult();     
  15. List list = new ArrayList();     
  16. while (result.next()) {     
  17. String table = result.getString(1);     
  18. list.add(table);     
  19. }     
  20. StringBuffer sb = new StringBuffer();     
  21. String enterFlag = "\r\n";     
  22. for (int i = 0; i < list.size();i++) {     
  23. String tableName = (String)list.get(i);     
  24. sb.append("db2 \"export to aa" + String.valueOf(i+1)+ ".ixf of ixf select  from " + tableName + "\"");     
  25. sb.append(enterFlag);     
  26. }     
  27. String str = sb.toString();     
  28. FileUtility.saveStringToFile(filePath, str, false);     
  29. }      

附錄2:生成import腳本代碼示例:

創(chuàng)建裝載腳本

 

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

附錄3:export腳本示例

  1. db2 connect to testdb user test password test     
  2. db2 "export to aa1.ixf of ixf select  from table1"     
  3. db2 "export to aa2.ixf of ixf select  from table2"     
  4. db2 connect reset    

附錄4:import腳本示例

  1. db2 connect to testdb user test password test     
  2. db2 "load from aa1.ixf of ixf replace into table1 COPY NO without prompting "     
  3. db2 "load from aa2.ixf of ixf replace into table2 COPY NO without prompting "     
  4. db2 connect reset  

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

【編輯推薦】

  1. DB2數(shù)據(jù)庫和PostgreSQL在開發(fā)的異同點(diǎn)有哪些?
  2. DB2 Cube View元數(shù)據(jù)橋的正確構(gòu)建方案
  3. DB2 9打開打開通往 XML 之門的鑰匙
  4. 如何看待IBM DB2 9數(shù)據(jù)服務(wù)器的發(fā)展?
  5. 對(duì)DB2日志設(shè)置參數(shù)正確用法的描述
責(zé)任編輯:佚名 來源: 環(huán)球企業(yè)家
相關(guān)推薦

2010-08-17 10:06:25

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

2010-08-10 14:02:26

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

2010-08-04 12:39:55

2011-03-16 13:02:47

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

2010-08-19 17:41:46

IBM DB2跨平臺(tái)數(shù)

2010-08-20 13:39:23

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

2010-08-19 10:32:07

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

2010-08-13 09:43:13

IBM DB2

2010-08-06 10:05:18

IBM DB2包重綁定

2010-08-13 16:29:03

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

2010-08-17 16:24:32

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

2010-08-03 13:56:11

DB2表復(fù)制

2010-08-13 10:13:15

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

2010-08-17 09:18:29

DB2 備份

2010-08-12 10:54:21

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

2010-08-06 11:21:45

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

2009-03-25 17:43:09

備份DB2IBM

2009-07-06 17:34:26

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

2012-11-12 10:30:25

IBMdw

2010-08-13 18:06:03

IBM DB2
點(diǎn)贊
收藏

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

主站蜘蛛池模板: 在线婷婷| 国产精品久久久久久久久久免费看 | 精品国产一区二区三区久久影院 | 一区视频 | 欧美一区二区三区在线看 | 国产成人精品a视频一区www | 日韩免费一级 | 91九色婷婷 | 日韩欧美二区 | 精国产品一区二区三区四季综 | 国产精品日产欧美久久久久 | 欧美偷偷操| www.狠狠干 | 久久精品网 | 日韩国产精品一区二区三区 | 国产欧美日韩在线播放 | 日产精品久久久一区二区福利 | 天天综合国产 | 中文字幕亚洲无线 | 日韩精品人成在线播放 | 亚洲精品一区二区三区在线 | 久久久亚洲综合 | 精品综合网 | 一区二区三区国产在线观看 | 欧美精品一区二区三区在线播放 | 婷婷五月色综合 | 日韩av在线一区 | 91av在线电影| 国产区在线观看 | 在线国产一区二区 | 亚洲免费视频在线观看 | 日韩三级视频 | 精品日韩| 人人爽人人爽人人片av | 毛片一区二区三区 | 全免费a级毛片免费看视频免费下 | 国产精品福利网站 | 精品一区二区三区四区五区 | 91www在线观看| 精品人伦一区二区三区蜜桃网站 | 草樱av|