導航:首頁 > 編程大全 > 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刪除資料庫命令相關的資料

熱點內容
p190文件用什麼打開 瀏覽:252
怎麼修改ps簽署文件 瀏覽:847
怎麼找到編程貓作品文件 瀏覽:647
鐵路局的網站是多少 瀏覽:194
微信雙號 瀏覽:926
招標文件中的凈值是什麼意思 瀏覽:675
有哪些app能借出5000 瀏覽:250
編程語言哪個發展好 瀏覽:974
刪除xp密碼 瀏覽:974
手機怎麼在word製作作業文件 瀏覽:489
工行銀行卡安全升級 瀏覽:807
桌面放的文件找不到 瀏覽:922
買學生票用什麼app 瀏覽:590
共建共享網路平台 瀏覽:39
js傳值到超鏈接裡面 瀏覽:608
編程中的w和h是什麼 瀏覽:313
資料庫切了什麼意思 瀏覽:213
如何登錄極路由器設置密碼 瀏覽:522
jsp用戶登陸密碼加密源代碼 瀏覽:629
everfilter使用教程 瀏覽:768

友情鏈接