您的位置:首页 > 数据库 > Oracle

Oracle sessions,processes 和 transactions 参数 关系 说明

2016-07-13 07:44 555 查看

1.Oracle官方文档11gR2说明

1.1 processes

PROCESSES

Property

Description

Parameter type

Integer

Default value

100

Modifiable

No

Range of values

6 to operating system dependent

Basic

Yes

Oracle RAC

Multiple instances can have different values.

 

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.

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和transactions参数)

 

reference    http://docs.oracle.com/cd/E11882_01/server.112/e40402/initparams202.htm#REFRN10175

 

1.2 sessions

SESSIONS

Property

Description

Parameter type

Integer

Default value

Derived: (1.5 * PROCESSES) + 22

Modifiable

No

Range of values

1 to 216 (which is 1 to 65536)

Basic

Yes

    这里要注意的是到了11gR2里,sessions 的默认值计算方式变了。 该值的计算是针对dedicate 模式的。

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.

Oracle uses the default value of this parameter as its minimum. Values between 1 and the default do not trigger errors, but Oracle ignores them and uses the default instead.

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 release 2 (10.2).)

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

 

reference    http://docs.oracle.com/cd/E11882_01/server.112/e40402/initparams234.htm#REFRN10197

 

1.3 transactions

TRANSACTIONS

Property

Description

Parameter type

Integer

Default value

Derived: (1.1 * SESSIONS)

Modifiable

No

Range of values

4 to 232

Oracle RAC

Multiple instances can have different values.

 

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).

 

reference    http://docs.oracle.com/cd/E11882_01/server.112/e40402/initparams262.htm#REFRN10222

 

2.修改参数实验

2.1 当前数据库版本

sys@ORCL>select * from v$version;

BANNER

--------------------------------------------------------------------------------

Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production

PL/SQL Release 11.2.0.4.0 - Production

CORE    11.2.0.4.0      Production

TNS for Linux: Version 11.2.0.4.0 - Production

NLSRTL Version 11.2.0.4.0 - Production

 

2.2 当前环境默认参数

sys@ORCL>show parameter processes

NAME                                 TYPE        VALUE

------------------------------------ ----------- ------------------------------

processes                            integer     150

 

sys@ORCL>show parameter sessions

NAME                                 TYPE        VALUE

------------------------------------ ----------- ------------------------------

sessions                             integer     248

----按照11gR2中的计算方法:SESSIONS=(1.5*PROCESSES) +22 =(1.5*150) +22=247

 

sys@ORCL>show parameter transactions

NAME                                 TYPE        VALUE

------------------------------------ ----------- ------------------------------

transactions                         integer     272

----按照11gR2中的计算方法:TRANSACTIONS =(1.1*SESSIONS) =(1.1*248) =272.8

 

2.3 只增加processes到1000,观察sessions和transactions参数

sys@ORCL>create pfile='/home/oracle/pfile.bak' from spfile;

File created.

 

sys@ORCL>alter system set processes=1000 scope=spfile;

System altered.

 

sys@ORCL>startup force

ORACLE instance started.

Total System Global Area  768294912 bytes

Fixed Size                  2257192 bytes

Variable Size             633343704 bytes

Database Buffers          125829120 bytes

Redo Buffers                6864896 bytes

Database mounted.

Database opened.

 

sys@ORCL>show parameter processes

NAME                                 TYPE        VALUE

------------------------------------ ----------- ------------------------------

processes                            integer     1000

 

sys@ORCL>show parameter sessions

NAME                                 TYPE        VALUE

------------------------------------ ----------- ------------------------------

sessions                             integer     1522

 

sys@ORCL>show parameter transaction

NAME                                 TYPE        VALUE

------------------------------------ ----------- ------------------------------

transactions                         integer     1674

 

    当我们修改processes 之后,如果sessions 和transactions 小于由公式计算出来的值,就会自动进行修改。为了验证这个观点,我们在做一个测试,修改processes 值,同时修改sessions和transactions的值,使其大于公式计算出来的值。

 

2.4 同时修改processes,sessions,transaction值

    修改processes=300

根据公式:sessions=1.5*processes +22=1.5*300+22=472

          transactions=1.1*sessions=1.1*472=519.2

 

    此时,我们设置sessions=800,transactions=1000

sys@ORCL>alter system set processes=300 scope=spfile;

System altered.

sys@ORCL>alter system set sessions=800 scope=spfile;

System altered.

sys@ORCL>alter system set transactions=1000 scope=spfile;

System altered.

 

sys@ORCL>startup force

ORACLE instance started.

Total System Global Area  768294912 bytes

Fixed Size                  2257192 bytes

Variable Size             427822808 bytes

Database Buffers          331350016 bytes

Redo Buffers                6864896 bytes

Database mounted.

Database opened.

 

sys@ORCL>show parameter processes

NAME                                 TYPE        VALUE

------------------------------------ ----------- ------------------------------

processes                            integer     300

sys@ORCL>show parameter sessions

NAME                                 TYPE        VALUE

------------------------------------ ----------- ------------------------------

sessions                             integer     800

sys@ORCL>show parameter transactions

NAME                                 TYPE        VALUE

------------------------------------ ----------- ------------------------------

transactions                         integer     1000

 

 

----还原:

sys@ORCL>shut abort

sys@ORCL>create spfile from pfile='/home/oracle/pfile.bak';

sys@ORCL>startup

sys@ORCL>show parameter processes

NAME                                 TYPE        VALUE

------------------------------------ ----------- ------------------------------

processes                            integer     150

sys@ORCL>show parameter sessions

NAME                                 TYPE        VALUE

------------------------------------ ----------- ------------------------------

sessions                             integer     248

sys@ORCL>show parameter transactions

NAME                                 TYPE        VALUE

------------------------------------ ----------- ------------------------------

transactions                         integer     272

 

 

 

 

reference                   http://www.2cto.com/database/201110/108586.html

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/30130773/viewspace-2121931/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/30130773/viewspace-2121931/

内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: