導航:首頁 > 編程大全 > linuxdb2刪除資料庫命令

linuxdb2刪除資料庫命令

發布時間:2025-01-21 03:58:50

㈠ 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

㈡ linux6.4安裝db2 10.1 版本圖形安裝過程「指定請CD或安裝映像 用於AMD64 和 Intel(R)EM64T」求大神指點

對於非Root用戶,文件安裝在$HOME/sqllib下,對於root用戶,文件安裝在/opt/ibm/db2/V10.1下。
驗證安裝:
以管理員許可權運行db2start,然後輸入db2sampl來創建示例資料庫,等資料庫創建完成,輸入以下命令查詢示例資料庫:
connect to sample
select * from staff where dept = 20
connect reset
結果返回
ID NAME DEPT JOB YEARS SALARY COMM
---- --------- ------ ----- ------ -------- --------
-10 Sanders 20 Mgr 7 98357.50 -
20 Pernal 20 Sales 8 78171.25 612.45
80 James 20 Clerk - 43504.60 128.20
190 Sneider 20 Clerk 8 34252.75 126.50
4 record(s) selected.
安裝完成,輸入db2 drop database sample命令刪除示例資料庫。

㈢ Linux或Unix下如何查看DB2所佔用的埠號

Linux或Unix下查看DB2埠號#查找TCP/IP Service name db2 get dbm cfg | grep -i service#通過上一句命令的輸出(如db2c_db2inst1)在/etc/services文件中找對應的埠號grep db2c_db2inst1 /etc/services#這是你將專會看到這么一行屬從上一句的輸出db2c_db2inst1 50000/tcp#其中50000就是db2資料庫所佔用的埠號

㈣ linux下怎麼清除db2資料庫的日誌

如要清除日誌,直接刪掉不就行了,找到log文件後直接刪除
log 的存放路徑版用下邊的命令查看:
db2 get db cfg for dbname
其中權有Path to log files 一行顯示了log 的存放路徑

閱讀全文

與linuxdb2刪除資料庫命令相關的資料

熱點內容
maya粒子表達式教程 瀏覽:84
抖音小視頻如何掛app 瀏覽:283
cad怎麼設置替補文件 瀏覽:790
win10啟動文件是空的 瀏覽:397
jk網站有哪些 瀏覽:134
學編程和3d哪個更好 瀏覽:932
win10移動硬碟文件無法打開 瀏覽:385
文件名是亂碼還刪不掉 瀏覽:643
蘋果鍵盤怎麼打開任務管理器 瀏覽:437
手機桌面文件名字大全 瀏覽:334
tplink默認無線密碼是多少 瀏覽:33
ipaddgm文件 瀏覽:99
lua語言編程用哪個平台 瀏覽:272
政采雲如何導出pdf投標文件 瀏覽:529
php獲取postjson數據 瀏覽:551
javatimetask 瀏覽:16
編程的話要什麼證件 瀏覽:94
錢脈通微信多開 瀏覽:878
中學生學編程哪個培訓機構好 瀏覽:852
榮耀路由TV設置文件共享錯誤 瀏覽:525

友情鏈接