Oracle 视图 V$SESSION_OBJECT_CACHE 官方解释,作用,如何使用详细说明

本站中文解释

Oracle的视图V$SESSION_OBJECT_CACHE显示用户会话每个实例下缓存的对象和操作。它存储对某一对象的对象句柄,用于检索游标、函数和过程的信息。它包含被缓存的对象名称、它的所有者、类型和动作(如COMPILE)。

使用$V$SESSION_OBJECT_CACHE时,用户可以在不影响当前会话的情况下查看数据库中所有缓存对象的信息。通过查看这些信息,用户可以优化会话以改善性能,以及对对象进行优化以提高应用程序的性能。

例如,要查看与某一用户关联的缓存对象,可以使用以下查询:

SELECT * FROM V$SESSION_OBJECT_CACHE WHERE USERNAME=’username’;

这个查询将显示特定用户所有被缓存的对象。用户可以返回“动作”,该字段中指明系统正在执行哪些操作,并决定应如何处理。

官方英文解释

V$SESSION_OBJECT_CACHE displays object cache statistics for the current user session on the local server (instance).

Column Datatype Description

PINS

NUMBER

Number of object pins or look-ups in the cache

HITS

NUMBER

Number of object pins that found the object already in the cache

TRUE_HITS

NUMBER

Number of object pins that found the object already in the cache and in the desired state (thus, not requiring refresh from the database)

HIT_RATIO

NUMBER

Ratio of HITS / PINS

TRUE_HIT_RATIO

NUMBER

Ratio of TRUE_HITS/PINS

OBJECT_REFRESHES

NUMBER

Number of objects in the cache that were refreshed with a new value from the database

CACHE_REFRESHES

NUMBER

Number of times the whole cache (all objects) were refreshed

OBJECT_FLUSHES

NUMBER

Number of objects in the cache that were flushed to the database

CACHE_FLUSHES

NUMBER

Number of times the whole cache (all objects) were flushed to the database

CACHE_SHRINKS

NUMBER

Number of times the cache was shrunk to the optimal size

CACHED_OBJECTS

NUMBER

Number of objects currently cached

PINNED_OBJECTS

NUMBER

Number of objects currently pinned

CACHE_SIZE

NUMBER

Current size of the cache (in bytes)

OPTIMAL_SIZE

NUMBER

Optimal size of the cache (in bytes)

MAXIMUM_SIZE

NUMBER

Maximum size of the cache (in bytes)

CON_ID

NUMBER

The ID of the container to which the data pertains. Possible values include:

  • 0: This value is used for rows containing data that pertain to the entire CDB. This value is also used for rows in non-CDBs.

  • 1: This value is used for rows containing data that pertain to only the root

  • n: Where n is the applicable container ID for the rows containing data


数据运维技术 » Oracle 视图 V$SESSION_OBJECT_CACHE 官方解释,作用,如何使用详细说明