4.oracle中process、session、transactions的关系

1.本文简介

本文主要对oracle 中的 process、session、transactions 参数的学习记录

此文是基于11R2版本。

2.process

2.1 定义

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.

PROCESSES  指定操作系统用户进程能够链接到ORACLE 的最大进程数。进程包括但不限于 后台进程与服务器进程、锁队列进程、job队列进程、并行的执行进程等。

2.2 和SESSIONS and TRANSACTION 的关系

The default values of the SESSIONS and TRANSACTIONS parameters are derived from this parameter. Therefore, if you change the value of PROCESSES, you should evaluate whether to adjust the values of those derived parameters.

PROCESSES 值会驱动(导致)SESSIONS and TRANSACTIONS 跟随变化。所以调整process 值时应计算是否调整 SESSIONS and TRANSACTIONS 的值

由于一个后台进程可能同时对应多个会话,所以,通常SESSIONS的值是大于PROCESSES的值。SESSIONS的值是根据PROCESSES的值计算得到的,所以,一般情况下只需要设置PROCESSES的值即可,但是还是实际情况实际分析。

三者值的计算公式:

<计算出session值>

在 dedicate server 模式

sessions= (1.5 * PROCESSES) + 22        range(1到65536)        

在shared  server 模式

In a shared server environment, the value of PROCESSES canbe quite small. Therefore, Oracle recommends that you adjust the value of SESSIONS to approximately 1.1 * total number of connections.

<计算出TRANSACTIONS值>

TRANSACTIONS=(1.1 * SESSIONS)

3.SESSIONS 

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 yourestimate of the maximum number of concurrent users, plus the number of background processes, plus approximately 10% for recursive sessions.

SESSIONS指定可以在数据库中创建的最大会话数。因为每次登录都需要一个会话,所以该参数有效地确定了系统中并发用户的最大数量。应该将此参数显式设置为一个值,该值等于估计的最大并发用户数加上后台进程数,再加上递归会话的大约10%。

The default values of the ENQUEUE_RESOURCES and TRANSACTIONS parameters are derived from SESSIONS. Therefore, if you increase the value of SESSIONS, you should consider whether to adjust the values of ENQUEUE_RESOURCES and TRANSACTIONS as well. (Note that ENQUEUE_RESOURCES is obsolete as of Oracle Database 10g release2 (10.2).)

ENQUEUE_RESOURCES和TRANSACTIONS参数的默认值源自SESSIONS。因此,如果增加SESSIONS的值,则应考虑是否同时调整ENQUEUE_RESOURCES和TRANSACTIONS的值。(请注意,从Oracle Database 10g版本2(10.2)起,ENQUEUE_RESOURCES已过时。)

从v$session 视图可以看出 sessions 的连接范围跟process中涉及的进程一致。

4.transactions

TRANSACTIONS specifies how many rollback segments to online when UNDO_MANAGEMENT = MANUAL. The maximum number of concurrent transactions is now restricted by undo tablespace size (UNDO_MANAGEMENT = AUTO) or the number of online rollback segments(UNDO_MANAGEMENT = MANUAL).

TRANSACTIONS指定UNDO_MANAGEMENT=MANUAL时 要online 的回滚段数。并发事务的最大数量现在受到undo 表空间大小(undo_MANAGEMENT=AUTO)或在线回滚段数量(undo_ANAGEMENT=MANUAL)的限制

5.超限制时报错

1)当数据库连接的并发用户已经达到SESSIONS的值时,又有新会话连接进来,就会报错“ORA-00018,"maximum number of sessions exceeded"”的错误。

2)当Oracle需要启动新的PROCESS,而当前的进程数又已经达到PROCESSES参数时,就会报错:“ORA-00020: maximum number of processes (2048) exceeded”。

3)如果数据库上连接被占用完,当新的连接过来时,那么就会在客户端产生“ORA-12519, TNS:no appropriate service handler found”的报错信息。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值