<rt id="bn8ez"></rt>
<label id="bn8ez"></label>

  • <span id="bn8ez"></span>

    <label id="bn8ez"><meter id="bn8ez"></meter></label>

    Thinking

    快樂編程,開心生活
    posts - 21, comments - 27, trackbacks - 0, articles - -5
      BlogJava :: 首頁 :: 新隨筆 :: 聯(lián)系 :: 聚合  :: 管理

    DB2常用命令

    Posted on 2007-04-27 08:54 lixw 閱讀(263) 評論(0)  編輯  收藏 所屬分類: Database
      1. 啟動數(shù)據(jù)庫   
      db2start   
      2. 停止數(shù)據(jù)庫   
      db2stop   
      3. 連接數(shù)據(jù)庫   
      db2   connect   to   o_yd   user   db2   using   pwd   
      4. 讀數(shù)據(jù)庫管理程序配置   
      db2   get   dbm   cfg   
      5. 寫數(shù)據(jù)庫管理程序配置   
      db2   update   dbm   cfg   using   參數(shù)名   參數(shù)值   
      6. 讀數(shù)據(jù)庫的配置   
      db2   connect   to   o_yd   user   db2   using   pwd   
      db2   get   db   cfg   for   o_yd   
      7. 寫數(shù)據(jù)庫的配置   
      db2   connect   to   o_yd   user   db2   using   pwd   
      db2   update   db   cfg   for   o_yd   using   參數(shù)名   參數(shù)值   
      8. 關(guān)閉所有應(yīng)用連接   
      db2   force   application   all   
      db2   force   application   ID1,ID2,,,Idn   MODE   ASYNC   
      (db2   list   application   for   db   o_yd   show   detail)   
      9. 備份數(shù)據(jù)庫   
      db2   force   application   all   
      db2   backup   db   o_yd   to   d:   
      (db2   initialize   tape   on   \\.\tape0)   
      (db2   rewind   tape   on   \\.\tape0)   
      db2   backup   db   o_yd   to   \\.\tape0   
      10. 恢復(fù)數(shù)據(jù)庫   
      db2   restore   db   o_yd   from   d:   to   d:     
      db2   restore   db   o_yd   from   \\.\tape0   to   d:   
      11. 綁定存儲過程   
      db2   connect   to   o_yd   user   db2   using   pwd   
      db2   bind   c:\dfplus.bnd   
      拷貝存儲過程到服務(wù)器上的C:\sqllib\function目錄中   
      12. 整理表   
      db2   connect   to   o_yd   user   db2   using   pwd   
      db2   reorg   table   ydd   
      db2   runstats   on   table   ydd   with   distribution   and   indexes   all     
      13. 導(dǎo)出表數(shù)據(jù)  
      db2   export   to   c:\sw.txt   of   del   select   *   from   dftz  
      db2   export   to   c:\sw.ixf   of   ixf   select   *   from   dftz  
      14. 導(dǎo)入表數(shù)據(jù)  
      db2   import   from   c:\sw.txt   of   del   insert   into   ylbx.czyxx  
      db2   import   to   c:\sw.txt   of   del   commitcount   5000   messages       c:\dftz.msg   insert   into   dftz  
      db2   import   to   c:\dftz.ixf   of   ixf   commitcount   5000   messages   c:\dftz.msg   insert   into   dftz  
      db2   import   to   c:\dftz.ixf   of   ixf   commitcount   5000   insert   into   dftz  
      db2   import   to   c:\dftz.ixf   of   ixf   commitcount   5000   insert_update   into   dftz  
      db2   import   to   c:\dftz.ixf   of   ixf   commitcount   5000   replace   into   dftz  
      db2   import   to   c:\dftz.ixf   of   ixf   commitcount   5000   create   into   dftz       (僅IXF)  
      db2   import   to   c:\dftz.ixf   of   ixf   commitcount   5000   replace_create   into   dftz     (僅IXF)  
      15. 執(zhí)行一個批處理文件  
      db2   –tf   批處理文件名  
      (文件中每一條命令用   ;結(jié)束)  
      16. 自動生成批處理文件  
      建文本文件:temp.sql  
      select   'runstats   on   table   DB2.'   ||   tabname   ||   '   with   distribution   and   detailed   indexes   all;'   from   syscat.tables   where   tabschema='DB2'   and   type='T';
      db2   –tf   temp.sql>runstats.sql  
      17. 自動生成建表(視圖)語句  
      在服務(wù)器上:C:\sqllib\misc目錄中  
      db2   connect   to   o_yd   user   db2   using   pwd  
      db2look   –d   o_yd   –u   db2   –e   –p   –c   c:\o_yd.txt     
      db2look   -d   lys   -e   -a   -x   -i   db2admin   -o   c:\aa.txt  
      18. 其他命令  
      grant   dbadm   on   database   to   user   bb   
      19.    select   *   from   czyxx   fetch   first   1   rows   only  
      20.    db2look   –d   lys   –u   db2admin   –w   –asd   –a   –e   –o   c:\mytable.txt   


    只有注冊用戶登錄后才能發(fā)表評論。


    網(wǎng)站導(dǎo)航:
     
    主站蜘蛛池模板: 女人被免费视频网站| 最近中文字幕电影大全免费版| 成人免费777777| 亚洲区精品久久一区二区三区| 8x8×在线永久免费视频| 亚洲男人都懂得羞羞网站| 一区二区三区在线免费看 | 小小影视日本动漫观看免费| 亚洲人成无码网站在线观看| 四虎影院免费在线播放| 最新亚洲人成无码网www电影| 又大又黄又粗又爽的免费视频| 欧洲乱码伦视频免费国产| 在线观看午夜亚洲一区| 特级精品毛片免费观看| 亚洲性色成人av天堂| 岛国片在线免费观看| 一级毛片a免费播放王色电影 | 亚洲AV噜噜一区二区三区| 免费v片在线观看| 中国一级特黄的片子免费| 久久久久久亚洲AV无码专区| 色婷婷亚洲十月十月色天| 免费观看无遮挡www的小视频| 亚洲AV成人噜噜无码网站| 99久久99久久免费精品小说| 亚洲国产av美女网站| 免费国内精品久久久久影院| 中文永久免费观看网站| 精品亚洲A∨无码一区二区三区| 久久WWW免费人成人片| 日韩精品一区二区亚洲AV观看 | 99re6免费视频| 久久精品亚洲日本波多野结衣| 久久久久久久亚洲精品| 四虎精品免费永久免费视频| 久久久久久久尹人综合网亚洲| 91免费国产在线观看| 一级一看免费完整版毛片| 久久久无码精品亚洲日韩蜜臀浪潮| 在线精品免费视频|