日期:2014-05-16  浏览次数:20550 次

修改Oracle连接数

问题描述:客户端连接数据库报错

ORA-12516: TNS: 监听程序无法找到匹配协议栈的可用句柄

解决过程:
1。查看当前会话数、processes和sessions值,发现session数和2个参数的值已经非常逼近

SQL*Plus: Release 10.2.0.1.0 - Production on 星期一 10月 9 15:50:21 2006Copyright (c) 1982, 2005, Oracle.? All rights reserved.SQL> conn?/ as sysdba已连接。SQL> select count(*) from v$session;? COUNT(*)----------??????? 45SQL> show parameter processesNAME???????????????????????????????? TYPE??????? VALUE------------------------------------ ----------- ----------------------aq_tm_processes????????????????????? integer???? 0db_writer_processes????????????????? integer???? 1gcs_server_processes???????????????? integer???? 0job_queue_processes????????????????? integer???? 10log_archive_max_processes??????????? integer???? 2processes??????????????????????????? integer???? 50SQL> show parameter sessionsNAME???????????????????????????????? TYPE??????? VALUE------------------------------------ ----------- ----------------------java_max_sessionspace_size?????????? integer???? 0java_soft_sessionspace_limit???????? integer???? 0license_max_sessions???????????????? integer???? 0license_sessions_warning???????????? integer???? 0logmnr_max_persistent_sessions?????? integer???? 1sessions???????????????????????????? integer???? 60shared_server_sessions?????????????? integer

2。修改processes和sessions值

SQL> alter system set processes=300 scope=spfile;系统已更改。SQL> alter system set sessions=300 scope=spfile;系统已更改。

3。查看processes和sessions参数,但更改并未生效

SQL> show parameter processesNAME???????????????????????????????? TYPE??????? VALUE------------------------------------ ----------- ----------------------aq_tm_processes????????????????????? integer???? 0db_writer_processes????????????????? integer???? 1gcs_server_processes???????????????? integer???? 0job_queue_processes????????????????? integer???? 10log_archive_max_processes??????????? integer???? 2processes??????????????????????????? integer???? 50SQL> show parameter sessionsNAME???????????????????????????????? TYPE??????? VALUE------------------------------------ ----------- ----------------------java_max_sess