1、修改最大连接数
先查看当前的最大连接数:select SF_GET_PARA_VALUE(2, 'MAX_SESSIONS');
修改最大连接数:ALTER SYSTEM SET 'MAX_SESSIONS' =1000 spfile;
重启数据库:./DmServiceDmServiceDMERVER stop;./DmServiceDmServiceDMERVER start
(需要首先切换到dmdba用户,进入bin目录再执行重启命令)
2、查看数据当前连接数:
SELECT A.SESS_ID AS 会话id,
A.SQL_TEXT AS SQL语句,
A.STATE AS 会话状态,
A.N_USED_STMT AS 当前会话使用句柄数量,
A.CURR_SCH AS 当前模式,
A.USER_NAME AS 用户名,
A.TRX_ID AS 事务ID,
A.CREATE_TIME AS 会话创建时间,
A.CLNT_TYPE AS 客户端类型,
A.TIME_ZONE AS 时区,
A.OSNAME AS 操作系统名称,
A.CONN_TYPE AS 连接类型,
B.PROTOCOL_TYPE AS 协议类型,
B.IP_ADDR AS 访问ip地址
FROM V$SESSIONS A, V$CONNECT B
where A.Sess_id= B.SADDR
ORDER BY SF_GET_EP_SEQNO(A.rowid),A.Sess_id;
-- 关闭IDLE连接
sp_close_session(1346445624); -- 参数为会话ID