導航:首頁 > 程序命令 > db2重建視圖命令

db2重建視圖命令

發布時間:2024-06-12 14:48:39

❶ db2常用命令

操作資料庫命令

1、 啟動資料庫實例

#db2start

2、 停止資料庫實例

#db2stop

如果你不能停止資料庫由於激活的連接,在運行db2stop前執行db2 force application all就可以了 /db2stop force

3、 創建資料庫

#db2 create db [dbname]

4、 連接到資料庫

#db2 connect to [dbname] user[username] using [password]

5、 斷開資料庫連接

#db2 connect reset

操作數據表命令

1、 列出所有用戶表

#db2 list tables

2、列出所有系統表

#db2 list tables for system

3、列出所有表

#db2 list tables for all

4、 列出系統表

#db2 list tables for system

5、列出用戶表

#db2 list tables for user

6、 列出特定用戶表

#db2 list tables for schema[user]

❷ DB2 閲嶅緩緔㈠紩鐨勫懡浠ゆg『鏍煎紡鏄浠涔

reorg鏄鐢ㄦ潵鏁寸悊紓佺洏紕庣墖鐨勫嵆閲嶆瀯琛ㄣ侱B2淇鏀硅〃緇撴瀯鍚庨渶瑕佸仛reorg
浠ヤ笅涓ょ嶆柟娉曢兘鍙浠ワ細
reorg table T_HK_TRANSDTL;
reorg table T_HK_TRANSDTL INDEX T_HK_TRANSDTL_IDX1 RESETDICTIONARY;榪欑嶆槸鎸夌収緔㈠紩T_HK_TRANSDTL_IDX1閲嶆瀯琛
錛屽啀鎵ц屼竴涓媟unstats on table T_HK_TRANSDTL with distribution and index all;鏀墮泦緇熻′俊鎮灝卞彲浠ヤ簡

❸ 如何在Windows CMD裡面用命令行操作DB2資料庫

1、打開電腦,進入電腦操作系統,點擊開始菜單,在電腦開始菜單中,找到命令行cmd,或者使用快捷鍵組合WIN+R鍵可以直接打開運行,輸入cmd命令行,即可直接打開迅敏命令行cmd。

❹ DB2資料庫在linux操作系統的指令有哪些

DB2資料庫命令簡介 1.啟動資料庫 DB2start 2.停止資料庫 DB2stop DB2資料庫在linux相關指令之3.連接資料庫 DB2 connect to o_yd user DB2 using pwd 4.讀資料庫管理程序配置 DB2 get dbm cfg 5.寫資料庫管理程序配置 DB2 update dbm cfg using 參數名 參數值 6.讀資料庫的配置 DB2 connect to o_yd user DB2 using pwd DB2 get db cfg for o_yd 7.寫資料庫的配置 DB2 connect to o_yd user DB2 using pwd DB2 update db cfg for o_yd using 參數名 參數值 8.關閉所有應用連接 DB2 force application all DB2 force application ID1,ID2,,,Idn MODE ASYNC (DB2 list application for db o_yd show detail) 9.備份資料庫 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.恢復資料庫 DB2 restore db o_yd from d: to d: DB2 restore db o_yd from \.tape0 to d: DB2資料庫在linux相關指令之11.綁定存儲過程 DB2 connect to o_yd user DB2 using pwd DB2 bind c:dfplus.bnd 拷貝存儲過程到伺服器上的C:sqllibfunction目錄中 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.導出表數據 DB2 export to c:dftz.txt of del select * from dftz DB2 export to c:dftz.ixf of ixf select * from dftz 14.導入表數據 import from c:123.txt of del insert into ylbx.czyxx DB2 import to c:dftz.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.執行一個批處理文件 DB2 -tf 批處理文件名 (文件中每一條命令用 ;結束) 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.自動生成建表(視圖)語句 在伺服器上:C:sqllibmisc目錄中 DB2 connect to o_yd user DB2 using pwd DB2look -d o_yd -u DB2 -e -p -c c:o_yd.txt DB2資料庫在linux相關指令之18.其他命令 grant dbadm on database to user bb 19select * from czyxx fetch first 1 rows only 20DB2look -d ylbx -u DB2admin -w -asd -a -e -o a.txt21. 顯示當前用戶所有表 list tables 22.列出所有的系統表 list tables for system 23.查看錶結構 DB2 describe select * from user.tables (實習編輯:HJ)

閱讀全文

與db2重建視圖命令相關的資料

熱點內容
資料庫查詢系統源碼 瀏覽:614
php5314 瀏覽:354
完美國際安裝到哪個文件夾 瀏覽:666
什麼app可以掃一掃做題 瀏覽:537
程序員編碼論壇 瀏覽:923
淘點是什麼app 瀏覽:658
中國高等植物pdf 瀏覽:453
51單片機時間 瀏覽:181
後台如何獲取伺服器ip 瀏覽:265
單片機流水燈程序c語言 瀏覽:232
程序員第二職業掙錢 瀏覽:237
運行里怎麼輸入伺服器路徑 瀏覽:838
pythonstepwise 瀏覽:508
劉一男詞彙速記指南pdf 瀏覽:61
php認證級別 瀏覽:366
方舟編譯啥時候推送 瀏覽:1009
php手機驗證碼生成 瀏覽:674
哲學思維pdf 瀏覽:14
凌達壓縮機有限公司招聘 瀏覽:533
weblogic命令部署 瀏覽:36