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)"
 
 
=============================
如果是退出编辑器 quit ;如果是断开数据库连接释放资源 connect reset ;如果是修改了参数下次使用数据服务想要生效 terminate。

1:
connect reset 应该是终止数据库连接,包含一个commit的动作
terminate应该是能终止这个client发起的进程,释放资源
2:
terminate是命令,除了断开连接以外,它还终止clp(命令行处理器)的后台进程,也就是常见的db2bp:back-end process。   
connect   reset是sql语句。
3:
connect   reset只是断开连接,不终止clp后台,在duow(可以同时连接多个数据库的事务)中可以将数据库当前连接休眠。
4:
quit :退出clp,但数据库连接不断开
connect reset:断开数据库连接但不退出clp
terminate:断开数据库连接,同时退出clp
5:
CLP backend process会在从CLP提交命令和SQL语句时启动,其作用就是将Directory file的内容读到内存中,这样不用每次connect都去读一次I/O,以提高效率。
就如上面所说,区别就在于是否终止那个CLP backend process。所以,当你修改了一些参数以后,用terminate的话,下次的CLP命令(比如一个新的connect语句)此参数就会生效;而用connect reset则还不会生效。

Db2 Terminate Vs Connect Reset , Disconnect的更多相关文章

  1. [IBM DB2] db2 terminate 和 db2 connect reset 有什么区别?

    [IBM DB2] db2 terminate 和 db2 connect reset 有什么区别?  总结:如果是退出编辑器 quit :如果是断开数据库连接释放资源 connect reset : ...

  2. 很多人以为 connect 和 disconnect 应该像 new 和 delete 一样成对出现 这是错误的(只要 sender 或 receiver 其中之一不存在了,connect 会自动失效。QObject::connect 函数是线程安全的)

    其实我写文章也是边查资料边编辑的 有时候是怕自己的阐述不严谨,有时候是怕自己重复造轮子 就像有些人不停的教大家QLabel QDialog QWidget 个人是不屑的 命令模式 用 Qt's Und ...

  3. IO流 connect reset

    目录 出现场景 解决思路 出现场景 通过外部OBS下载10文件,然后通过工具将这10个文件打包成一个文件A.zip上传,最后将这个A.zip下载并解压,解压A.zip后发现文件数量不是10个. 解决思 ...

  4. 记客户端出现Connect reset问题排查。

    客户访问我们地址出现Connect reset. 网上查询说是服务端关闭,客户端还在读,就会出现Connect reset. 我们就排查为什么服务端会关闭. 网络的同事说收到了客户端的信息,但是被服务 ...

  5. db2 连接数据库与断开数据库

    连接数据库: connect to db_name user db_user using db_pass 断开连接: connect  resetdisconnect current quit是退出交 ...

  6. DB2常用命令

    DB2安装启动服务中启动不了,可用command启动并查看windows系统的日志.1.启动数据库  db2start2.停止数据库  db2stop3.连接数据库运行 db2命令之前要先运行db2c ...

  7. db2日常维护

    一. DB2日常维护操作 1.数据库的启动.停止.激活 db2 list active databases db2 active db 数据库名 db2start --启动 db2stop [forc ...

  8. <转载>DB2常用命令

    1.数据库的启动.停止    db2start --启动   db2stop [force] --停止 2.与数据库的连接.断开   db2 CONNECT TO DBName [user UserI ...

  9. DB2导入导出 学习笔记

    db2pd -osinfodb2mtrk -i -d (for aix)db2 get dbm cfg show detaildb2 get db cfg show detaildb2 get sna ...

随机推荐

  1. Android中自定义环形图2

    如图: 自定义属性,在values文件夹下创建 attrs.xml <?xml version="1.0" encoding="utf-8"?> & ...

  2. 没有用到React,为什么我需要import引入React?

    没有用到React,为什么我需要import引入React? 本质上来说JSX是React.createElement(component, props, ...children)方法的语法糖. 所以 ...

  3. sap unix timestamp转换

    之前和java做接口的时候就遇到过这个问题,对方的时间戳和SAP的时间戳是不同的. SAP的时间戳格式NNNNYYDD ZONE HHMMSS这样的一个数值. JAVA的时间戳是unix时间戳,是以1 ...

  4. Java集合学习(3):HashSet

    一.概述 HashSet实现Set接口,由哈希表(实际上是一个HashMap实例)支持.它不保证set 的迭代顺序:特别是它不保证该顺序恒久不变.此类允许使用null元素. HashSet是基于Has ...

  5. python绘图 转

    Python有很多可视化工具,本篇只介绍Matplotlib. Matplotlib是一种2D的绘图库,它可以支持硬拷贝和跨系统的交互,它可以在Python脚本.IPython的交互环境下.Web应用 ...

  6. 连接mysql报"ERROR 1130: Host xxx.xxx.xxx.xxx is not allowed to connect to this MySQL server"

    最近在服务器上部署好的应用突然间连接不上mysql数据库,报错“ERROR 1130: Host xxx.xxx.xxx.xxx is not allowed to connect to this M ...

  7. Linux Swap故障之 swapoff failed: Cannot allocate memory

    目录swap分区关闭方法1:释放内存缓存方法2:允许内存overcommit swap分区关闭准备调整Linux下的swap分区的使用率.在Linux下执行 swapoff -a -v报如下错误:sw ...

  8. HTML通用模板

    <!DOCTYPE html><html lang="en"><head> <meta charset="UTF-8" ...

  9. iOS系统的两个循环

    1.事件循环: 2.显示循环:displaylink:系统定时从gpu缓存获取图片信息显示在屏幕.

  10. Optional类的基本使用(没怎么看)

    参考:https://www.runoob.com/java/java8-optional-class.html java8中引入了一个新类:Optional,用于日常编码中对空指针异常进行限制和处理 ...