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 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).)
Default Value |
(1.5 * Processes) + 22 |
Range of value | 1 to 216 |
以上是官方文档中关于session参数的表述:sessions 参数是当前系统的最大可支持的session值。 session是通讯双方从开始通讯到结束期间的一个上下文关系。这里会记录本次连接的客户机器,应用程序和用户等信息。
因此,在oracle中,如果需要登录,是需要有create session权限的,oracle允许同一个用户在同一个IP上建立多个连接。
Processes
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.
以上是官方文档中关于process参数的表述:process(进程)是在指操作系统用户的进程连接到数据库的进程。包括数据库的所有进程:后台进程,锁,job进程和并行进程。
总结:一个Process可以对应一个或者多个session,一个进程可以允许多个会话连接。官方中建议的设定值是 sessions=1.5*processes +22 (后台进程) --Oracle 11g
查询方法:
select count(*) from v$session; --查询当前的会话数
select count(*) from v$process; --查询当前的进程数
select value from v$parameter where name = 'processes'; --查询设置的最大进程连接数
select value from v$parameter where name ='sessions'; --查询设置的最大会话数
修改方法:(需要重启实例)
SQL>show parameter processes;
SQL>show parameter sessions ;
SQL>alter system set processes=1500 scope=spfile;
SQL>alter system set sessions=2277 scope=spfile ;
SQL>shutdown immediate;
SQL>startup;