• <ins id="pjuwb"></ins>
    <blockquote id="pjuwb"><pre id="pjuwb"></pre></blockquote>
    <noscript id="pjuwb"></noscript>
          <sup id="pjuwb"><pre id="pjuwb"></pre></sup>
            <dd id="pjuwb"></dd>
            <abbr id="pjuwb"></abbr>

            Prayer

            在一般中尋求卓越
            posts - 1256, comments - 190, trackbacks - 0, articles - 0
              C++博客 :: 首頁(yè) :: 新隨筆 :: 聯(lián)系 :: 聚合  :: 管理

            DB2常用命令

            Posted on 2008-09-09 17:41 Prayer 閱讀(179) 評(píng)論(0)  編輯 收藏 引用 所屬分類: DB2

            1. 啟動(dòng)實(shí)例(db2inst1):

            db2start

             

             

             

             

            2. 停止實(shí)例(db2inst1):

            db2stop

             

             

             

             

            3. 列出所有實(shí)例(db2inst1)

            db2ilist

             

             

             

             

            5.列出當(dāng)前實(shí)例:

            db2 get instance

             

             

             

             

            4. 察看示例配置文件:

            db2 get dbm cfg|more

             

             

             

             

            5. 更新數(shù)據(jù)庫(kù)管理器參數(shù)信息:

            db2 update dbm cfg using para_name para_value

             

             

             

             

            6. 創(chuàng)建數(shù)據(jù)庫(kù):

            db2 create db test

             

             

             

             

            7. 察看數(shù)據(jù)庫(kù)配置參數(shù)信息

            db2 get db cfg for test|more

             

             

             

             

            8. 更新數(shù)據(jù)庫(kù)參數(shù)配置信息

            db2 update db cfg for test using para_name para_value

             

             

             

             

            10.刪除數(shù)據(jù)庫(kù):

            db2 drop db test

             

             

             

             

            11.連接數(shù)據(jù)庫(kù)

            db2 connect to test

             

             

             

             

            12.列出所有表空間的詳細(xì)信息。

            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é)點(diǎn)編目

            db2 catalog tcpip node node_name remote server_ip server server_port

             

             

             

             

            19.察看端口號(hào)

            db2 get dbm cfg|grep SVCENAME

             

             

             

             

            20.測(cè)試節(jié)點(diǎn)的附接

            db2 attach to node_name

             

             

             

             

            21.察看本地節(jié)點(diǎn)

            db2 list node directory

             

             

             

             

            22.節(jié)點(diǎn)反編目

            db2 uncatalog node node_name

             

             

             

             

            23.數(shù)據(jù)庫(kù)編目

            db2 catalog db db_name as db_alias at node node_name

             

             

             

             

            24.察看數(shù)據(jù)庫(kù)的編目

            db2 list db directory

             

             

             

             

            25.連接數(shù)據(jù)庫(kù)

            db2 connect to db_alias user user_name using user_password

             

             

             

             

            26.數(shù)據(jù)庫(kù)反編目

            db2 uncatalog db db_alias

             

             

             

             

            27.導(dǎo)出數(shù)據(jù)

            db2 export to myfile of ixf messages msg select * from tb1

             

             

             

             

            28.導(dǎo)入數(shù)據(jù)

            db2 import from myfile of ixf messages msg replace into tb1

             

             

             

             

            29.導(dǎo)出數(shù)據(jù)庫(kù)的所有表數(shù)據(jù)

            db2move test export

             

             

             

             

            30.生成數(shù)據(jù)庫(kù)的定義

            db2look -d db_alias -a -e -m -l -x -f -o db2look.sql

             

             

             

             

            31.創(chuàng)建數(shù)據(jù)庫(kù)

            db2 create db test1

             

             

             

             

            32.生成定義

            db2 -tvf db2look.sql

             

             

             

             

            33.導(dǎo)入數(shù)據(jù)庫(kù)所有的數(shù)據(jù)

            db2move db_alias import

             

             

             

             

            34.重組檢查

            db2 reorgchk

             

             

             

             

            35.重組表tb1

            db2 reorg table tb1

             

             

             

             

            36.更新統(tǒng)計(jì)信息

            db2 runstats on table tb1

             

             

             

             

            37.備份數(shù)據(jù)庫(kù)test

            db2 backup db test

             

             

             

             

            38.恢復(fù)數(shù)據(jù)庫(kù)test

            db2 restore db test

             

             

             

             

            399\.列出容器的信息

            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’);

             

            九九热久久免费视频| 99久久夜色精品国产网站| 久久伊人五月丁香狠狠色| 久久久亚洲裙底偷窥综合| 中文国产成人精品久久不卡| 99久久国语露脸精品国产| 亚洲国产一成久久精品国产成人综合 | 亚洲欧洲日产国码无码久久99| 国产亚洲欧美精品久久久| 亚洲国产成人精品久久久国产成人一区二区三区综 | 久久精品无码免费不卡| 婷婷久久久亚洲欧洲日产国码AV| 国产精品18久久久久久vr | 亚洲精品无码久久久| 久久精品国产久精国产| 亚洲精品无码成人片久久| 日本久久中文字幕| 亚洲国产精品久久久久网站| 久久久av波多野一区二区| 久久亚洲国产最新网站| 欧美大战日韩91综合一区婷婷久久青草| www.久久热.com| 久久久久成人精品无码中文字幕 | 精品国产一区二区三区久久久狼 | 国产精品福利一区二区久久| 久久久久久亚洲精品成人| 亚洲狠狠婷婷综合久久蜜芽 | 91久久精品国产免费直播| 国产精品99精品久久免费| 色婷婷综合久久久久中文| 偷窥少妇久久久久久久久| 国产精品美女久久福利网站| 色婷婷狠狠久久综合五月| 日韩va亚洲va欧美va久久| 久久久久九九精品影院| 亚洲色欲久久久久综合网| 精品人妻伦九区久久AAA片69| 国产精品久久婷婷六月丁香| 精品国产乱码久久久久久呢| 亚洲国产精品18久久久久久| 久久精品www人人爽人人|