DB2常見命令

          1. 啟動實例(db2inst1):db2start
          2. 停止實例(db2inst1):db2stop
          3. 列出所有實例(db2inst1):db2ilist
          4. 列出當前實例:db2 get instance?
          5. 更新數(shù)據(jù)庫管理器參數(shù)信息:db2 update dbm cfg using para_name para_value
          6. 創(chuàng)建數(shù)據(jù)庫:db2 create db test
          7. 察看數(shù)據(jù)庫配置參數(shù)信息db2 get db cfg for test|more
          8. 更新數(shù)據(jù)庫參數(shù)配置信息db2 update db cfg for test using para_name para_value
          9. 察看示例配置文件:db2 get dbm cfg|more
          10.刪除數(shù)據(jù)庫:db2 drop db test
          11.連接數(shù)據(jù)庫db2 connect to test
          12.列出所有表空間的詳細信息。db2 list tablespaces show detail
          13.查詢數(shù)據(jù):db2 select * from tb1
          14.數(shù)據(jù):db2 delete from tb1 where id=1
          15.創(chuàng)建索引:db2 create index idx1 on tb1(id);
          16.創(chuàng)建視圖:db2 create view view1 as select id from tb1
          17.查詢視圖:db2 select * from view1
          18.節(jié)點編目db2 catalog tcpip node node_name remote server_ip server server_port
          19.察看端口號db2 get dbm cfg|grep SVCENAME
          20.測試節(jié)點的附接db2 attach to node_name
          21.察看本地節(jié)點db2 list node directory
          22.節(jié)點反編目db2 uncatalog node node_name
          23.數(shù)據(jù)庫編目db2 catalog db db_name as db_alias at node node_name
          24.察看數(shù)據(jù)庫的編目db2 list db directory
          25.連接數(shù)據(jù)庫db2 connect to db_alias user user_name using user_password
          26.數(shù)據(jù)庫反編目db2 uncatalog db db_alias
          27.導出數(shù)據(jù)db2 export to myfile of ixf messages msg select * from tb1
          28.導入數(shù)據(jù)(ixf)??import from myfile of ixf messages msg replace into tb1
          28.導入數(shù)據(jù)(del) import from myfile?of del insert into tb1
          29.導出數(shù)據(jù)庫的所有表數(shù)據(jù)db2move test export
          30.生成數(shù)據(jù)庫的定義db2look -d db_alias -a -e -m -l -x -f -o db2look.sql
          31.創(chuàng)建數(shù)據(jù)庫db2 create db test1
          32.生成定義db2 -tvf db2look.sql
          33.導入數(shù)據(jù)庫所有的數(shù)據(jù)db2move db_alias import
          34.重組檢查db2 reorgchk
          35.重組表tb1db2 reorg table tb1
          36.更新統(tǒng)計信息db2 runstats on table tb1
          37.備份數(shù)據(jù)庫testdb2 backup db test
          38.恢復數(shù)據(jù)庫testdb2 restore db test
          39.列出容器的信息db2 list tablespace containers for tbs_id show detail
          40.創(chuàng)建表:db2 ceate table tb1(id integer not null,name char(10))
          41.列出所有表db2 list tables
          42.插入數(shù)據(jù):db2 insert into tb1 values(1,’sam’);db2 insert into tb2 values(2,’smitty’);

          posted on 2008-09-19 15:07 心硯 閱讀(481) 評論(0)  編輯  收藏 所屬分類: 數(shù)據(jù)庫


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


          網(wǎng)站導航:
           
          <2008年9月>
          31123456
          78910111213
          14151617181920
          21222324252627
          2829301234
          567891011

          導航

          統(tǒng)計

          常用鏈接

          留言簿(2)

          隨筆分類

          文章分類

          文章檔案

          Forum

          搜索

          最新評論

          閱讀排行榜

          評論排行榜

          主站蜘蛛池模板: 固原市| 潢川县| 中方县| 阳东县| 鄂托克旗| 兴化市| 兰西县| 怀安县| 金堂县| 稷山县| 炉霍县| 商城县| 洛隆县| 红桥区| 徐州市| 泽库县| 新疆| 大厂| 岫岩| 沙湾县| 西宁市| 景泰县| 鸡东县| 济源市| 绍兴县| 库伦旗| 锡林郭勒盟| 沂水县| 平陆县| 永昌县| 潢川县| 鄂托克前旗| 开鲁县| 海丰县| 平陆县| 临安市| 马尔康县| 宁晋县| 抚远县| 新乡县| 思茅市|