暂无图片
暂无图片
暂无图片
暂无图片
暂无图片

Oracle查看历史会话总数

原创 张鹏 2022-09-23
2718
  1. Oracle查看历史会话总数

  2. 通过v$resoure_limit查看

V$RESOURCE_LIMIT
This view displays information about global resource use for some of the system resources. Use this view to monitor the consumption of resources so that you can take corrective action, if necessary. Many of the resources correspond to initialization parameters listed in Table 7-3.
Some resources, those used by DLM for example, have an initial allocation (soft limit), and the hard limit, which is theoretically infinite (although in practice it is limited by SGA size). During SGA reservation/initialization, a place is reserved in SGA for the INITIAL_ALLOCATION of resources, but if this allocation is exceeded, additional resources are allocated up to the value indicated by LIMIT_VALUE. The CURRENT_UTILIZATION column indicates whether the initial allocation has been exceeded. When the initial allocation value is exceeded, the additional required resources are allocated from the shared pool, where they must compete for space with other resources.
A good choice for the value of INITIAL_ALLOCATION will avoid the contention for space. For most resources, the value for INITIAL_ALLOCATION is the same as the LIMIT_VALUE. Exceeding LIMIT_VALUE results in an error.
Column Datatype Description
RESOURCE_NAME VARCHAR2(30) Name of the resource (see Table 7-3)

CURRENT_UTILIZATION NUMBER Number of (resources, locks, or processes) currently being used
MAX_UTILIZATION NUMBER Maximum consumption of this resource since the last instance start-up
INITIAL_ALLOCATION VARCHAR2(10) Initial allocation. This will be equal to the value specified for the resource in the initialization parameter file (UNLIMITED for infinite allocation).
LIMIT_VALUE VARCHAR2(10) Unlimited for resources and locks. This can be greater than the initial allocation value (UNLIMITED for infinite limit).

Table 7-3 Values for the RESOURCE_NAME Column
Resource Name Corresponds to
DML_LOCKS See “DML_LOCKS”

ENQUEUE_LOCKS This value is computed by the Oracle Database. See V$ENQUEUE_LOCK to obtain more information about the enqueue locks.
GES_LOCKS Global Enqueue Service locks
GES_PROCS Global Enqueue Service processes
GES_RESS Global Enqueue Service resources
MAX_SHARED_SERVERS See “MAX_SHARED_SERVERS”

PARALLEL_MAX_SERVERS See “PARALLEL_MAX_SERVERS”

PROCESSES See “PROCESSES”

SESSIONS See “SESSIONS”

SORT_SEGMENT_LOCKS This value is computed by the Oracle Database
TEMPORARY_LOCKS This value is computed by the Oracle Database
TRANSACTIONS See “TRANSACTIONS”

select resource_name,MAX_UTILIZATION,LIMIT_VALUE from v$resource_limit where resource_name in (‘processes’,‘sessions’);

  1. 如果想根据时间段统计活动会话,那么使用v$active_session_history

select to_char(sample_time,‘yyyy/mm/dd hh24:mi:ss’),count()
from v$active_session_history
groupby to_char(sample_time,‘yyyy/mm/dd hh24:mi:ss’)
orderbycount(
) desc;

「喜欢这篇文章,您的关注和赞赏是给作者最好的鼓励」
关注作者
【版权声明】本文为墨天轮用户原创内容,转载时必须标注文章的来源(墨天轮),文章链接,文章作者等基本信息,否则作者和墨天轮有权追究责任。如果您发现墨天轮中有涉嫌抄袭或者侵权的内容,欢迎发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。

评论