How to check the maximum number of allowed connections to an Oracle database?(如何检查允许连接到 Oracle 数据库的最大数量?)
问题描述
使用 SQL 检查 Oracle 数据库允许的最大连接数的最佳方法是什么?最后,我想显示当前的会话数和允许的总数,例如目前,使用了 80 个连接中的 23 个".
What's the best way, using SQL, to check the maximum number of connections that is allowed for an Oracle database? In the end, I would like to show the current number of sessions and the total number allowed, e.g. "Currently, 23 out of 80 connections are used".
推荐答案
在确定 Oracle 数据库支持的连接数时,可能会出现一些不同的限制.最简单的方法是使用 SESSIONS 参数和 V$SESSION,即
There are a few different limits that might come in to play in determining the number of connections an Oracle database supports. The simplest approach would be to use the SESSIONS parameter and V$SESSION, i.e.
数据库配置允许的会话数
The number of sessions the database was configured to allow
SELECT name, value
FROM v$parameter
WHERE name = 'sessions'
当前活动的会话数
SELECT COUNT(*)
FROM v$session
不过,正如我所说,在数据库级别和操作系统级别以及是否已配置共享服务器都存在其他潜在限制.如果忽略共享服务器,您很可能会在达到 SESSIONS 参数的限制之前达到 PROCESSES 参数的限制.您可能会达到操作系统限制,因为每个会话都需要一定数量的 RAM.
As I said, though, there are other potential limits both at the database level and at the operating system level and depending on whether shared server has been configured. If shared server is ignored, you may well hit the limit of the PROCESSES parameter before you hit the limit of the SESSIONS parameter. And you may hit operating system limits because each session requires a certain amount of RAM.
这篇关于如何检查允许连接到 Oracle 数据库的最大数量?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:如何检查允许连接到 Oracle 数据库的最大数量?


- 使用 Oracle PL/SQL developer 生成测试数据 2021-01-01
- 远程 mySQL 连接抛出“无法使用旧的不安全身份验证连接到 MySQL 4.1+"来自 XAMPP 的错误 2022-01-01
- 如何将 Byte[] 插入 SQL Server VARBINARY 列 2021-01-01
- 在SQL中,如何为每个组选择前2行 2021-01-01
- 如何将 SonarQube 6.7 从 MySQL 迁移到 postgresql 2022-01-01
- 更改自动增量起始编号? 2021-01-01
- 如何使用 pip 安装 Python MySQLdb 模块? 2021-01-01
- 导入具有可变标题的 Excel 文件 2021-01-01
- 以一个值为轴心,但将一行上的数据按另一行分组? 2022-01-01
- SQL 临时表问题 2022-01-01