存在一套11.2.0.4 RAC 2节点,数据库存在5000个会话数量,其中active正在执行的会话500个,其余均为非活跃会话。
大量inactive会话过多给Oracle数据库带来什么样的影响?
[活跃说明数据库存在大量并发,正常情况下说明是业务负载这块只能拆库,常规无法优化套路】
1) 内存消耗,每个会话对应数据库来说都是一个pga process 需要单独分配一块内存区域,并且其中会话保留的游标越多,越消耗内存;
2) cpu资源消耗,每个会话对应操作系统来说都是一个Oracle用户进程,虽然大量属于inactive 但是对于操作系统来说还是一个进程运行;
1.2相关参数
SESSIONS
Default value Derived: (1.5 * PROCESSES) + 22
Range of values
1 to 216 (which is 1 to 65536)
SESSIONS specifies the maximum number of sessions that can be created in the system. Because every login requires a session, this parameter effectively determines
the maximum number of concurrent users in the system. You should always set this parameter explicitly to a value equivalent to your estimate of the maximum number of concurrent users,
plus the number of background processes, plus approximately 10% for recursive sessions.
PROCESSES
Default value
100
Range of values
6 to operating system dependent
PROCESSES specifies the maximum number of operating system user processes that can simultaneously connect to Oracle. Its value should allow for all background processes such as locks,
job queue processes, and parallel execution processes.
# vi /etc/security/limits.conf
oracle soft nproc 32
oracle hard nproc 64
#ulimit -a