[原创]v$resource_limit 与 v$license学习

第一次认识这两个视图:v$resource_limit 与 v$license

先看一下,ORACLE官方是怎么说的吧.

V$RESOURCE_LIMIT 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-5.

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.

ColumnDatatypeDescription
RESOURCE_NAMEVARCHAR2(30)Name of the resource (see Table 7-5)
CURRENT_UTILIZATIONNUMBERNumber of (resources, locks, or processes) currently being used
MAX_UTILIZATIONNUMBERMaximum consumption of this resource since the last instance start-up
INITIAL_ALLOCATIONVARCHAR2(10)Initial allocation. This will be equal to the value specified for the resource in the initialization parameter file (UNLIMITED for infinite allocation).
LIMIT_VALUEVARCHAR2(10)Unlimited for resources and locks. This can be greater than the initial allocation value (UNLIMITED for infinite limit).

Table 7-5 Values for the RESOURCE_NAME Column

Resource NameCorresponds 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"

 

V$LICENSE displays information about license limits.

ColumnDatatypeDescription
SESSIONS_MAXNUMBERMaximum number of concurrent user sessions allowed for the instance
SESSIONS_WARNINGNUMBERWarning limit for concurrent user sessions for the instance
SESSIONS_CURRENTNUMBERCurrent number of concurrent user sessions
SESSIONS_HIGHWATERNUMBERHighest number of concurrent user sessions since the instance started
USERS_MAXNUMBERMaximum number of named users allowed for the database
CPU_COUNT_CURRENTNUMBERCurrent number of logical CPUs or processors on the system
CPU_CORE_COUNT_CURRENTNUMBERCurrent number of CPU cores on the system (includes subcores of multicore CPUs, as well as single-core CPUs)
CPU_SOCKET_COUNT_CURRENTNUMBERCurrent number of CPU sockets on the system (represents an absolute count of CPU chips on the system, regardless of multithreading or multicore architectures)
CPU_COUNT_HIGHWATERNUMBERHighest number of logical CPUs or processors on the system since the instance started
CPU_CORE_COUNT_HIGHWATERNUMBERHighest number of CPU cores on the system since the instance started (includes subcores of multicore CPUs, as well as single-core CPUs)
CPU_SOCKET_COUNT_HIGHWATERNUMBERHighest number of CPU sockets on the system since the instance started (represents an absolute count of CPU chips on the system, regardless of multithreading or multicore architectures)

Note:

The availability of the CPU core count and CPU socket count statistics is subject to the operating system platform. on which the Oracle Database is running. If a statistic is unavailable, the view will return NULL for the statistic value.
 
做一个具体的例子可以简单说明一下用法.
SQL> select count(*) from v$session;
  COUNT(*)
----------
        25
得到当前的session总数(但它应该是个变化的数值)
SQL> select * from v$resource_limit where resource_name = 'sessions';
RESOURCE_NAME                  CURRENT_UTILIZATION MAX_UTILIZATION
------------------------------ ------------------- ---------------
INITIAL_ALLOCATION   LIMIT_VALUE
-------------------- --------------------
sessions                                        26              40
       555                  555
CURRENT_UTILIZATION得到当前被用的session总数。MAX_UTILIZATION是各项资源没有达到的最大值
SQL> select * from v$license;
SESSIONS_MAX SESSIONS_WARNING SESSIONS_CURRENT SESSIONS_HIGHWATER  USERS_MAX
------------ ---------------- ---------------- ------------------ ----------
           0                0               19                 31          0
可以得道自从实例启动以来,连接数据库的用户session的曾经达到的最大值(SESSIONS_HIGHWATER)和当前值(SESSIONS_CURRENT,该值并不等于 v$session 中查询出来的数量,似乎并不包括 Oracle 本身连接的 SESSION,但似乎还是有点出入,具体是怎样的对应关系,我还没有搞明白)

还有一点就是.V$LICENSE中我并没有见到描述CPU信息的列.这也在困惑当中.

总结:这两个视图不属于重要视图,权当了觖即可.


 

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/12045182/viewspace-448714/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/12045182/viewspace-448714/

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值