Monitoring Index Usage【每日一译】--20121216

来源:互联网 发布:熊猫tv竹子淘宝能买吗 编辑:程序博客网 时间:2024/05/17 08:01
Oracle Database provides a means of monitoring indexes to determine whether they
are being used. If an index is not being used, then it can be dropped, eliminating

unnecessary statement overhead.

O提供一个监控索引的方法去确定它们是否被正在使用。如果一个索引没有被使用,那么它可以被

DROP,消除不需要的语句消耗。

To start monitoring the usage of an index, issue this statement:
ALTER INDEX index MONITORING USAGE;
Later, issue the following statement to stop the monitoring:

ALTER INDEX index NOMONITORING USAGE;

开始监控索引使用语句,输入这个语句:

ALTER ****

稍后,输入如下的语句去停止监控:

ALTER ****

The view V$OBJECT_USAGE can be queried for the index being monitored to see if the
index has been used. The view contains a USED column whose value is YES or NO,
depending upon if the index has been used within the time period being monitored.
The view also contains the start and stop times of the monitoring period, and a
MONITORING column (YES/NO) to indicate if usage monitoring is currently active.
Each time that you specify MONITORING USAGE, the V$OBJECT_USAGE view is reset
for the specified index. The previous usage information is cleared or reset, and a new
start time is recorded. When you specify NOMONITORING USAGE, no further
monitoring is performed, and the end time is recorded for the monitoring period. Until
the next ALTER INDEX...MONITORING USAGE statement is issued, the view

information is left unchanged.

视图V$OBJECT_USAGE可以用来查询和看到被监控的索引如果索引已经被使用。视图包含

一个USED字段它的值是YES或者NO,这个值取决于如果索引在监控的时间期内被使用。

视图也包含了开始和停止监控的时间期,并且一个监控列(YES/NO)表明如果使用监控当前

正在活动。每次你指定监控使用时,视图V$OBJECT_USAGE视图对于指定索引进行重设。之前

使用信息被清除或者重设,并且一个新的开始时间被记录。当你指定NOMONITORING USAGE,

没有进一步的监控执行,并且结束时间被记录在监控阶段。直到下一次的ALTER ****语句输入时,

视图信息是保留不变的。

原创粉丝点击