oracle 如何知道数据库连接数

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/26733242/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-09 00:39:21  来源:igfitidea点击:

How to know the number of database connections

oracleoracle11g

提问by Iwan Satria

Please note that even though it looks very similar, it's not a duplicate question with this link: How to list active / open connections in Oracle?

请注意,即使它看起来非常相似,它也不是与此链接重复的问题: 如何在 Oracle 中列出活动/打开的连接?

I'm not asking about the number of sessions, but connections. I'm aware that I can query the v$session view, but I don't know how many connections are being used there. If there is a way to derive from it, please enlighten me.

我问的不是会话数,而是连接数。我知道我可以查询 v$session 视图,但我不知道那里使用了多少连接。如果有一种方法可以从中得出,请赐教。

EDIT: I'm asking about the physicaldatabase connection to the database.

编辑:我在询问与数据库的物理数据库连接。

采纳答案by Rahul

Bit confused with your statement I'm not asking about the number of sessions, but connections.

对你的说法有点困惑I'm not asking about the number of sessions, but connections

Conceptually both are same. Every active session will correspond to a underlying active connection to the database.

从概念上讲,两者是相同的。每个活动会话将对应于到数据库的底层活动连接。

Now, if you meant to know the max allowed connection limit then Documentationsays

现在,如果您想知道最大允许连接限制,则文档

Maximum number of connections (system and application) across all databases in an instance = 2048

一个实例中所有数据库的最大连接数(系统和应用程序)= 2048

To know the allowed session configured to your database, you can query v$parameterview like

要了解为您的数据库配置的允许会话,您可以查询v$parameter视图,例如

SELECT name, value 
  FROM v$parameter
 WHERE name = 'sessions'

If you want to know the Activesession at any instance Out of total configured to allow then you can query v$sessionview using the Statuscolumn like

如果您想知道Active任何实例的会话 Out of total 配置为允许,那么您可以v$session使用Status如下列查询视图

SELECT COUNT(*)
  FROM v$session
WHERE STATUS = 'ACTIVE'

You may want to refer this post How to check the maximum number of allowed connections to an Oracle database?

您可能想参考这篇文章如何检查与 Oracle 数据库的最大允许连接数?