db2ilist 查看全部實例
db2 get instance 查看當前鏈接的實例
db2 list db directory 查看當前實例下鏈接的數據庫
========================================
C:\Users\Administrator>db2 list database directory --查看當前實例下鏈接的數據庫
System Database Directory
Number of entries in the directory = 2
Database 1 entry:
Database alias = TEST123
Database name = TEST123
Local database directory = C:
Database release level = d.00
Comment =
Directory entry type = Indirect
Catalog database partition number = 0
Alternate server hostname =
Alternate server port number =
Database 2 entry:
Database alias = SAMPLE
Database name = SAMPLE
Local database directory = C:
Database release level = d.00
Comment =
Directory entry type = Indirect
Catalog database partition number = 0
Alternate server hostname =
Alternate server port number =
C:\Users\Administrator>db2 connect to test123 --鏈接到須要刪除的數據庫
Database Connection Information
Database server = DB2/NT64 9.7.11
SQL authorization ID = DB2ADMIN
Local database alias = TEST123
C:\Users\Administrator>db2 list applications --查看當前數據庫的鏈接狀況
Auth Id Application Appl. Application Id
DB # of
Name Handle
Name Agents
-------- -------------- ---------- --------------------------------------
----------------- -------- -----
DB2ADMIN javaw.exe 19233 *LOCAL.DB2.191023053134
SAMPLE 1
DB2ADMIN javaw.exe 19245 *LOCAL.DB2.191023053146
SAMPLE 1
DB2ADMIN db2bp.exe 19250 *LOCAL.DB2.191023053151
TEST123 1
C:\Users\Administrator>
C:\Users\Administrator>db2 connect reset --斷開全部鏈接
DB20000I The SQL command completed successfully.
C:\Users\Administrator>db2 drop database test123 --刪除數據庫
DB20000I The DROP DATABASE command completed successfully.
C:\Users\Administrator>