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. SAP技术 - How to create a CDS redirect view for a given database table

    Scenario Suppose we have a database table A, and then we create a CDS redirect view B for it, then e ...

  2. mysql 使用 MD5函数 校验账号密码

    项目中账号密码需要加密操作,数据库用户表账号是明文,密码是密文,但是前端传递过来的都是密文,所以需要到数据库中加密账号和前端传递过来的密文做校验. 这时候就可以使用md5函数. 使用案例: SELEC ...

  3. MySQL Table--独立表空间

    数据库表空间 独立表空间 在MySQL 5.6 中引入独立表空间的概念,启用独立表空间后,每个表将生成独立的文件来进行存储. 创建表时可以指定表存放的文件路径 ##首选需要确保innodb_file_ ...

  4. mac php thinkphp5 验证码报错 Call to undefined function think\captcha\imagettftext()

    百度一下,是GD库里缺少了freetype支持,然后各种拓展的方法都试了半天,php-v里都生效了,phpinfo里还是不生效,原来是各种文章里都缺少了最关键的一步,修改Apache的配置(我使用的是 ...

  5. 【Git版本控制】为什么要先commit,然后pull,最后再push?而不是commit然后直接push?

    情况是这样的,现在远程有一个仓库,分支就一个,是master.然后我本地的仓库是从远程的master上clone下来的.大家都是clone下来,再在自己本地改好,再commit然后pull然后push ...

  6. Docker搭建Gogs

    Gogs需要使用到数据库,需要先安装数据库(如mysql),并创建名为gogs的数据库,启动后需要配置数据库连接. 镜像获取:docker pull gogs/gogs 安装运行: docker ru ...

  7. warning警告问题解决1

    warning警告问题, 这时可以不去管它, 但如果想解决, 可以这样做: c:\python\lib\site-packages\locust\core.py:17: MonkeyPatchWarn ...

  8. H3C 802.11 WEP加密特点与注意事项

  9. Odoo中的domain

    转载请注明原文地址:https://www.cnblogs.com/ygj0930/p/10826127.html 一:domain表达式 domain表达式:通常用来筛选数据记录.它们使用特殊的语法 ...

  10. Fiddler抓websocket协议的包,用jmeter做并发测试

    1.Fiddler: 左边为ws请求url.右边为请求数据,响应数据 jmeter: