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

本文介绍如何使用Oracle数据库的内置功能来监控索引的使用情况。通过启动和停止监控,管理员可以决定哪些索引是活跃的并据此进行优化。文章还介绍了如何利用V$OBJECT_USAGE视图来查看索引的使用状态。
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 ****语句输入时,

视图信息是保留不变的。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值