當前位置:首頁 » 數據倉庫 » db2停止資料庫
擴展閱讀
webinf下怎麼引入js 2023-08-31 21:54:13
堡壘機怎麼打開web 2023-08-31 21:54:11

db2停止資料庫

發布時間: 2022-06-01 21:16:04

1. db2資料庫怎麼查看實例

1、 打開命令行窗口
#db2cmd
2、 打開控制中心
#db2cmd db2cc
3、 打開命令編輯器
#db2cmd db2ce
=====操作資料庫命令=====

4、 啟動資料庫實例
#db2start

5、 停止資料庫實例
#db2stop

如果你不能停止資料庫由於激活的連接,在運行db2stop前執行db2 force application all就可以了 /db2stop force
6、 創建資料庫
#db2 create db [dbname]
7、 連接到資料庫
#db2 connect to [dbname] user [username] using [password]
8、 斷開資料庫連接
#db2 connect reset
9、 列出所有資料庫
#db2 list db directory

10、 列出所有激活的資料庫
#db2 list active databases
11、 列出所有資料庫配置
#db2 get db cfg
12、 刪除資料庫
#db2 drop database [dbname]
(執行此操作要小心)
如果不能刪除,斷開所有資料庫連接或者重啟db2

2. 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)

3. 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]

4. 修改了伺服器的時間後,db2資料庫用不了了,怎麼辦,是把電腦時間提前了8天時間

嘗試調整回去,先把日誌清理了,然後停止資料庫、實例,再調整時間

5. DB2資料庫中db2stop的問題

在命令行中輸入
db2
connect
reset,截斷連接,就可以輸入db2stop關閉資料庫了

6. 如何停止單個db2資料庫

使用
quiense
database停止單個資料庫:
如果連上來的用戶不是sysadm中的一員,可用instance用戶連接上資料庫,然後用
db2
quiesce
db
IMMEDIATE
FORCE
CONNECTIONS
再用
db2
reset
或者db2
terminate
最後
deactivate
db
辦完事後,記得用db2
unquiesce
db來恢復其對外連接。
具體流程如下:
db2
connect
to
sample
db2
quiesce
db
immediate
force
connections
db2
terminate
db2
deactivate
db
sample
db2
connect
to
sample
db2
unquiesce
db
注意:
QUIESCE
DATABASE
後,僅有
sysadm,
sysmaint,
dbadm,

sysctrl
用戶可以訪問資料庫。