删除DB2实例下的数据库
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 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 =
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
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
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.
DB20000I The SQL command completed successfully.
C:\Users\Administrator>db2 drop database test123 --删除数据库
DB20000I The DROP DATABASE command completed successfully.
DB20000I The DROP DATABASE command completed successfully.
C:\Users\Administrator>
*******VICTORY LOVES PREPARATION*******