DB2删除数据库

来源:互联网 发布:网络教育能读本科嘛 编辑:程序博客网 时间:2024/06/06 06:32
删除数据库
[db2inst1@localhost home]$ db2 drop database test;
SQL1035N  The database is currently in use.  SQLSTATE=57019
[db2inst1@localhost home]$ db2 list applications  --查看链接


Auth Id  Application    Appl.      Application Id                                                 DB       # of
         Name           Handle                                                                    Name    Agents
-------- -------------- ---------- -------------------------------------------------------------- -------- -----
DB2INST1 db2bp          2231       *LOCAL.db2inst1.170324033829                                   TEST     1    

[db2inst1@localhost home]$ db2 force applications all  --关闭链接
DB20000I  The FORCE APPLICATION command completed successfully.
DB21024I  This command is asynchronous and may not be effective immediately.
[db2inst1@localhost home]$ db2 list applications      --查看链接
SQL1611W  No data was returned by Database System Monitor.
[db2inst1@localhost home]$ 
[db2inst1@localhost home]$ db2 deactivate database test  --接触激活
SQL1493N  The application is already connected to an active database.
[db2inst1@localhost home]$ db2 terminate                 --退出db2
DB20000I  The TERMINATE command completed successfully. 
[db2inst1@localhost home]$ db2 drop db test              --删除数据库
DB20000I  The DROP DATABASE command completed successfully.
0 0
原创粉丝点击