首页 > 数据库技术 > 详细

Db2 Terminate Vs Connect Reset , Disconnect

时间:2019-10-23 15:26:53      阅读:113      评论:0      收藏:0      [点我收藏+]
db2 Terminate and db2 connect Reset both break the connection to a database.
 
             Connect Reset breaks a connection to a database, but does not terminate the back-end process. The Terminate command does both ie. break the connection to a database and terminate the back-end process.
 
Suppose an application is connected to a database, or a process may be in the middle of a of work. We can use TERMINATE to make the database connection to be lost. When Terminate is issued, an internal commit is also performed.
 
When issue the command db2stop, it may not stop the database manager, if an application is connected to a database. In this situation, you have to issue db2 Terminate command or db2 connect reset, then issue the command db2stop.
 
Db2 Disconnect is used to clear the database connection of a particular database or all
 
Syntax : db2 disconnect dbname
 
eg. db2 disconnect sample
 
db2 disconnect all
 
db2 release all
 
Note : Even after disconnecting database, some times you may get the error message "Database already in use "  when you execute the commands like   "db2 Restore db databasename , etc ..". 
 
That means current data base is connected by some other applications. Applications connected to the database can be listed out by the following command
 
db2 list applications
 
Auth Id Application Name Appl. Handle Application Id DB Name # of Agents
------- -------------- ---------- ------------------------------ -------- -----
 
TEST javaw.exe 78 *LOCAL.DB2.110722172106 EMPLOYEE 1
 
TEST javaw.exe 77 *LOCAL.DB2.110722172103 EMPLOYEE 1
 
 
Now you can use db2 "force applications all" This command is used to kill  all the applications forcefully at instance level .
 
To force a particular application with application handle 78
db2  "force application(78)"

Db2 Terminate Vs Connect Reset , Disconnect

原文:https://www.cnblogs.com/rusking/p/11726202.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!