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

本站中文解释

V$INDEX_USAGE_INFO(索引使用信息视图)用来查看过去一个月之内索引的创建、保护、更改等操作的次数和操作的时间,可以根据查询得到的信息分析索引的使用状况,并确定索引的优化措施。

具体使用:

首先,进入SQLPlus命令行:

SQL> SELECT *
FROM v$index_usage_info;

以上代码将列出索引使用情况信息放回。

可以通过限制 WHERE子句 对索引使用信息分类进行查询,例子:

SQL> SELECT *
FROM v$index_usage_info
WHERE creation_count > 0;

以上代码将查询所有已创建索引的详细信息。

官方英文解释

V$INDEX_USAGE_INFO keeps track of index usage since the last flush. A flush occurs every 15 minutes. After each flush, ACTIVE_ELEM_COUNT is reset to 0 and LAST_FLUSH_TIME is updated to the current time.

Column Datatype Description

INDEX_STATS_ENABLED

NUMBER

Indicates whether the index usage statistics are enabled. Possible values:

  • 0: Index statistics are disabled

  • 1: Index statistics are enabled

INDEX_STATS_COLLECTION_TYPE

NUMBER

Indicates the type of collection used for the index usage statistics. Possible values:

  • 0: Indicates the ALL collection type. With this type of collection, the statistics are collected for each execution that has index access. Selecting this statistics collection type may have some impact on performance.

  • 1: Indicates the SAMPLED collection type. With this type of collection, the statistics are collected based on sampling (only a few of the executions are considered when collecting the statistics). This is the default statistics collection type.

    Index statistics collected with the SAMPLED collection type are less accurate than index statistics collected with the ALL collection type.

ACTIVE_ELEM_COUNT

NUMBER

The number of active indexes since the last flush

ALLOC_ELEM_COUNT

NUMBER

The number of index entries allocated

MAX_ELEM_COUNT

NUMBER

The maximum number of active indexes that can be tracked

FLUSH_COUNT

NUMBER

Number of successful flushes since the database started

TOTAL_FLUSH_DURATION

NUMBER

Cumulative elapsed time taken to complete the index usage statistics flush since the database start

LAST_FLUSH_TIME

TIMESTAMP(3)

The time of the last flush

STATUS_MSG

VARCHAR2(256)

Status messages, if any. Flush errors are reported here.

CON_ID

NUMBER

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

  • 0: This row 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

See Also:

“DBA_INDEX_USAGE”


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