怎样查看oracle当前的连接数呢?只需要用下面的SQL语句查询一下就可以了。
select * from v$session where username is not null
select username,count(username) from v$session where username is not null group by username #查看不同用户的连接数
select count(*) from v$session #连接数
Select count(*) from v$session where status=’ACTIVE’ #并发连接数
show parameter processes #最大连接
alter system set processes = value scope = spfile;重启数据库 #修改连接
1。查看当前会话数、processes和sessions值,发现session数和2个参数的值已经非常逼近
SQL> conn / as sysdba已连接。
SQL> select count(*) from v$session;
SQL> show parameter processes;
SQL> show parameter sessions;
2。修改processes和sessions值
SQL> alter system set processes=300 scope=spfile;
系统已更改。
SQL> alter system set sessions=300 scope=spfile;
系统已更改。
3。查看processes和sessions参数,但更改并未生效
4。重启数据库,使更改生效
SQL> shutdown immediate
SQL> startup
SQL> show parameter processes
SQL> show parameter sessions
Select v.MACHINE,
v.USERNAME,
v.PADDR,
v.OSUSER,
v.PROGRAM,
v.LOGON_TIME,
v.STATUS
from v$session v
where v.USERNAME is not null
order by v.LOGON_TIME desc;
select count(*)
from v$session v
where v.USERNAME is not null
order by v.LOGON_TIME desc;
发表评论