📄 db2在连接几下就连接不上了.txt
字号:
我的db2在连接几下就连接不上了
我的环境是RS6000, aix5.1, 2G内存,两颗CPU,
装有websphere 5(base版) db2v8.1打了补丁3
目前我使用jdbc连接,应用是J2ee的应用,部署在websphere上,经常出现连接不上的情况,这个事情是很恐怖的,
我的db2的一些参数如下:
bufferpool大小是400M
sortheap 以前是80M,现在已经改成20M了
dbm的sheapsthresh是400M
我的diag.log文件有这样的内容
no enough memory for sort heap
大虾帮我看看该怎么办呀??
【发表回复】【查看CU论坛原帖】【关闭】
--------------------------------------------------------------------------------
manpo 回复于:2003-11-16 00:04:28
看来你需要增大sortheap,但是sortheap太小的话也不会导致客户端连接不上。客户端 不能连接应该是其他原因导致。
当发现客户端不能连接时,执行以下命令:
db2 get db cfg for dbname |grep MAXAPPLS
db2 list applications for database dbname|wc -l
看看是MAXAPPLS参数值大还是wc -l返回的值大。如果是wc -l返回的值等于MAXAPPLS,那么说明该数据库已达最大连接数,可以通过增大MAXAPPLS或者采用连接池的方式解决;如果是MAXAPPLS大于wc -l返回的值,则说明数据库没有达到最大连接,这时应该看看websphere的相关配置了,是不是连接池太小等等。
--------------------------------------------------------------------------------
mymm 回复于:2003-11-16 10:01:36
Good!
不过把
db2 list applications for database dbname|wc -l
改成
db2 list applications for database dbname|grep ^DBNAME|wc -l
可能稍好点!
--------------------------------------------------------------------------------
3000sunqin 回复于:2003-11-16 21:07:27
在Websphere+DB2v7的情况下,你说的情况会出现,在V8中不知道还会不会出现这个情况,你可以试试以下的方法
Content
Before doing the steps below, verify with your DBA that steps 1 through 5 below are not the cause of the problem:
1. The database manager has not been started on the database server
2. The database manager was stopped
3. The database agent was forced off by the system admin
4. The database manager has already allocated the maximum number of agents
5. The database agent was termninated due to an abnormal termination of a key database manager process
If steps 1 through 5 have been taken care of, it is most likely that this will be the problem:
The application is using multiple contexts with local protocol. In this case the number of connections is limited by the number of shared memory segments to which a single process can be attached. For example, on AIX, the limit is ten shared memory segments per process.
Do the following to resolve the problem:
On the machine with the database that you want to connect to:
Configure the database manager to use TCP/IP on AIX:
On the server machine, log in as the DB2 instance owner.
Set DB2COMM to TPC/IP, for example: db2set DB2COMM=tcpip
Edit /etc/services file to include DB2 connection and interrupt service ports if they do not already exist, such as,
db2cDB2 50000/tcp # DB2 connection service port
db2iDB2 50001/tcp # DB2 interrupt connection
# service port
Update the database manager configuration, such as, db2 update dbm cfg using svcename db2cDB2
the argument after svcename must match the name of the DB2 connection port service that you placed in /etc/services.
Start and stop db2
% db2stop
% db2start
--------------------------------------------------------------------------------
richardluopeng 回复于:2003-11-17 08:26:03
谢谢。
我每次都要
db2admin stop
db2admin start
db2restart
这样才能恢复正常,这真是可怕的事情!
websphere的日志里有sql1032N的sqlcode错误
--------------------------------------------------------------------------------
richardluopeng 回复于:2003-11-17 09:00:04
IBM 的工程师建议我先把sortheap 先改小
Copyright ? ChinaUnix.net
* 请尊重我们的劳动,转载请注明出自ChinaUnix.net及作者名 *
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -