ORA-12516:TNS:listener could not find available handler with matching protocol stack
登陆时报:
ORA-12516:TNS:listener could not find available handler with matching protocol stack
解决方法:
1.切换到oracle用户下:
su - oracle
2.停止数据库监听器:
lsnrctl stop
3.等连接数下来后,登陆数据库:
sqlplus / as sysdba
4.修改processes和sessions参数:
1)查看processes和sessions参数
SQL> show parameter processes;
SQL>show parameter sessions ;
2)修改processes和sessions参数
SQL> alter system set processes=300 scope=spfile;
SQL>alter system set sessions=335 scope=spfile ;
SQL>commit ;
3)重启数据库
重启Oracle服务器才能生效
4)相关说明
ORACLE的连接数(sessions)与其参数文件中的进程数(process)有关,它们的关系:sessions=(1.1*process+5)
5)相关查询
a.查询数据库当前进程的连接数:select count(*) from v$process;
b.查看数据库当前会话的连接数:elect count(*) from v$session;
c.查看数据库的并发连接数:select count(*) from v$session where status='ACTIVE';
d.查看当前数据库建立的会话情况:select sid,serial#,username,program,machine,status from v$session;
e.查询数据库允许的最大连接数:select value from v$parameter where name = 'processes'; 或者:show parameter processes;
f.修改数据库允许的最大连接数:alter system set processes = 300 scope = spfile;
g.查看当前有哪些用户正在使用数据:
select osuser,a.username,cpu_time/executions/1000000||'s',sql_fulltext,machine
from v$session a,v$sqlarea b
where a.sql_address = b.address
order by cpu_time/executions desc;