前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >详述一则DB2 Error Code 1639和SQL State 08001案例诊断和解决方案

详述一则DB2 Error Code 1639和SQL State 08001案例诊断和解决方案

作者头像
数据和云
发布2019-10-24 20:50:46
1.9K0
发布2019-10-24 20:50:46
举报
文章被收录于专栏:数据和云

导读:在 db2inst1/sqllib/security 目录下,检查 db2ckpw 和 db2chpw 文件的权限。

有朋友在墨天轮提出一个 DB2 的问题,当完成初始化安装部署之后,本地连接没有问题,但是远程无法连接数据库:

错误提示是:Error Code -1639 , SQL State: 08001 :

这个错误有多种可能性,例如防火墙没有开放 50000 端口,但是这个案例,客户已经关闭了防火墙,端口可达。

还有一个相关性问题,就是权限,在 db2inst1/sqllib/security 目录下,检查 db2ckpw 和 db2chpw 文件的权限:

将这两个文件的属主修改为 root ,权限修改为 4511 ,重启数据库,数据库就可以接受远程访问了:

chown root db2chpw chown root db2ckpw chmod 4511 db2chpw chmod 4511 db2ckpw

最后总结一下:db2ckpw 的作用是用于检查 DB2 服务器上的用户标识和密码。由于 DB2 依赖于操作系统级别的认证,因此,当某个用户或应用程序连接到服务器上的数据库时,使用该进程验证用户标识和密码。当将 AUTHENTICATION 设置为 SERVER 时,或者当连接是从非安全的操作系统建立的时候,就会进行认证。验证权限需要检查 passwd 文件,ckpw 顾名思义就是 Check Password file 的含义,正因为如此,这个工具必须以 root 运行,需要远程连接时必须保证该权限。

以下一段描述表述清晰:

db2ckpwd is the password checking daemon that deals with user authentication. This process is used to confirm that the id exists and has a right to be on the box. If the process if not a root process, only local connections will be allowed to the database because the id is already on the box. To make the OS API calls necessary to determine if the user has the right to be on the box, DB2’s db2ckpwd must run as root. If it is not started as root, it will not have permissions to make the API calls, and it will return an SQL 30082 rc=24 error. Also since the db2ckpwd must su to root, in order to run as root, the db2ckpw file will need to have the su bit set, and the file system must be mounted so that su’ing is allowed.

DB2 建立连接的示意图如下:

记录供参考。

本文参与 腾讯云自媒体同步曝光计划,分享自微信公众号。
原始发表:2019-10-23,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 数据和云 微信公众号,前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体同步曝光计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
相关产品与服务
数据库
云数据库为企业提供了完善的关系型数据库、非关系型数据库、分析型数据库和数据库生态工具。您可以通过产品选择和组合搭建,轻松实现高可靠、高可用性、高性能等数据库需求。云数据库服务也可大幅减少您的运维工作量,更专注于业务发展,让企业一站式享受数据上云及分布式架构的技术红利!
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档