Oracle 视图 V$CACHE 官方解释,作用,如何使用详细说明
本站中文解释
Oracle视图V$CACHE是Oracle数据字典视图。它显示来自内存中分配给每个结构的缓存位和字缓存使用状况。
用途:可以使用V$CACHE视图检查Oracle数据库的缓冲池活动。它可以显示内存中的每个缓存池的访问和命中率。这对调整缓存池的大小以及决定哪些比率最合理而有用。
如何使用:
1.检查缓冲池的访问次数:
SELECT pool,gets,getmisses,
round(pkgets/executions*100,2)||’%’ hitpct,
round((1-(pkgets/executions))*100,2)||’%’ misspct
FROM V$CACHE;
2.检查每个文件的特定缓存池使用:
SELECT name,gets,getmisses,
round(pins/executions*100,2) || ‘%’ hitpct,
round((1-(pins/executions))*100,2) || ‘%’ misspct
FROM V$CACHE
WHERE name = ‘&file’;
3.将缓冲池信息映射到文件:
SELECT a.POOL, a.name,
a.gets,a.getmisses, a.executions,
round(a.pins/a.executions*100,2) ||’%’ hitpct,
round((1-(a.pins/a.executions))*100,2) ||’%’ misspct
FROM V$CACHE a;
官方英文解释
V$CACHE
displays information from the block header of each block in the SGA of the current instance as related to particular database objects. This is an Oracle Real Application Clusters view.
Column | Datatype | Description |
---|---|---|
|
|
Data file identifier number (to find the file name, query |
|
|
Block number |
|
|
Class number |
|
|
Status of the block:
|
|
|
Number of PCM x to null lock conversions due to contention with another instance. This column is obsolete and maintained for backward compatibility. |
|
|
Number of times the block had to be reread from the cache because another instance has forced it out of this instance’s cache by requesting the lock on the block in exclusive mode |
|
|
Number of times GCS had to write this block to cache because this instance had used the block and another instance had requested the lock on the block in a conflicting mode |
|
|
Name of the database object containing the block |
|
|
Name of the partition (null for nonpartitioned objects) |
|
|
Type of the database object:
|
|
|
Owner number |
|
|
Address of the lock element that contains the PCM lock that is covering the buffer. If more than one buffer has the same address, then these buffers are covered by the same PCM lock. |
|
|
Name of the lock element that contains the PCM lock that is covering the buffer. If more than one buffer has the same address, then these buffers are covered by the same PCM lock. |
|
|
The ID of the container to which the data pertains. Possible values include:
|