導航:首頁 > 程序命令 > 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重建視圖命令相關的資料

熱點內容
股票漲跌源碼怎麼看 瀏覽:575
加密軟體做法 瀏覽:54
美國程序員有多少中國人 瀏覽:739
人民日報app里怎麼看新聞早班車 瀏覽:584
忘了app怎麼辦 瀏覽:528
如何用雲伺服器做雲平台 瀏覽:298
非箍筋加密區剪力 瀏覽:116
利聯科技伺服器卡怎麼辦 瀏覽:383
js和python哪個好 瀏覽:460
c盤的哪些文件夾沒用 瀏覽:80
文件為什麼會超出在線解壓限制 瀏覽:588
python類實例化對象 瀏覽:794
硬碟dos外部命令 瀏覽:792
做演算法還是開發 瀏覽:874
按鍵精靈自定義圖層命令 瀏覽:353
魅藍3手機音視頻文件夾 瀏覽:945
安卓手機製表怎麼換行 瀏覽:215
牆柱搭接箍筋怎麼加密 瀏覽:456
怎麼加密不讓人打開 瀏覽:336
2g3g演算法 瀏覽:206