一辈子产系统,最近数据库操做频繁出现-1218错误:java
<!-- lang: java --> java.sql.SQLException: [BEA][DB2 JDBC Driver][DB2]Error occured with SQLCode -1218 with the following parameters: 4096 at weblogic.jdbc.base.BaseExceptions.createException(Unknown Source) at weblogic.jdbc.base.BaseExceptions.getException(Unknown Source) at weblogic.jdbc.db2.drda.DRDARequest.processSQLCA(Unknown Source) at weblogic.jdbc.db2.drda.DRDARequest.processCodePoint(Unknown Source) at weblogic.jdbc.db2.drda.DRDAStatementRequest.processCodePoint(Unknown Source) at weblogic.jdbc.db2.drda.DRDAExecuteStatementRequest.processCodePoint(Unknown Source) at weblogic.jdbc.db2.drda.DRDARequest.processReply(Unknown Source) at weblogic.jdbc.db2.DB2ImplStatement.getNextResultType(Unknown Source) at weblogic.jdbc.base.BaseStatement.commonTransitionToState(Unknown Source) at weblogic.jdbc.base.BaseStatement.postImplExecute(Unknown Source)
根据DB2错误码分析,第一感受觉得是数据库库缓冲池过小,不能知足业务须要,须要扩大缓冲池大小来解决这个问题。仔细考虑后以为有些不对劲,查询了许多资料,都是说怎么扩充缓冲池的,后来查询了数据库最近一段时间的日志,在数据库日志中找到了真正的缘由是由于平台上的可用物理内存不中,致使咱们新建的缓冲池没有激活,数据库系统自动将缓冲池切换到一个隐藏的容量很小的缓冲池上致使的。DB2的这个坑爹的设计!数据库日志信息大致以下:web
<!-- lang: java --> MESSAGE : ZRC=0x850F0005=-2062614523=SQLO_NOSEG "No Storage Available for allocation" DIA8305C Memory allocation failure occurred. DATA #1 : String, 286 bytes Failed to allocate the desired database shared memory set. Check to make sure the configured DATABASE_MEMORY + overflow does not exceed the maximum shared memory on the system. Attempting to start up with only the system buffer pools. Desired database shared memory set size is (bytes): DATA #2 : unsigned integer, 4 bytes 1651048448 MESSAGE : ADM6073W The table space "SYSCATSPACE" (ID "0") is configured to use buffer pool ID "1", but this buffer pool is not active at this time. In the interim the table space will use buffer pool ID "4096". The inactive buffer pool should become available at next database startup provided that the required memory is available.