关于视图:V$OBJECT_USAGE
来源:互联网 发布:阿里云 怎么注销 编辑:程序博客网 时间:2024/05/16 07:40
地址:http://docs.oracle.com/cd/B19306_01/server.102/b14237/dynviews_2004.htm#REFRN30162
V$OBJECT_USAGE
You can use this view to monitor index usage. The view displaysstatistics about index usage gathered from the database. Allindexes that have been used at least once can be monitored anddisplayed in this view.
INDEX_NAME
VARCHAR2(30)
Index name insys.obj$.nameTABLE_NAME
VARCHAR2(30)
Table name insys.obj$.nameMONITORING
VARCHAR2(3)
YES
|NO
USED
VARCHAR2(3)
YES
|NO
START_MONITORING
VARCHAR2(19)
Start monitoring time insys.object_stats.start_monitoring
END_MONITORING
VARCHAR2(19)
End monitoring time insys.object_stats.end_monitoring
注意:
1、$object_usage只包括当前用户所拥有索引的使用记录,即索引的创建者或者是索引的拥有者(owner),已这个用户登录后,看到的是此用户下拥有的索引在整个数据库的使用情况。如果使用了该索引,视图V$OBJECT_USAGE的字段USED会标成YES。否则是NO。当然首先是这些索引被启用使用监视。SQL>alter index index_test_pk monitoring usage;
2、如果需要查出所有用户所拥有索引的使用记录,使用下面的sql,这个sql来自DBA日记:
SQL> select u.name owner, io.name index_name, t.nametable_name,
decode(bitand(i.flags, 65536), 0, 'NO', 'YES') monitoring,
decode(bitand(ou.flags, 1), 0, 'NO', 'YES')used,ou.start_monitoring
start_monitoring,ou.end_monitoring end_monitoring
from sys.user$ u, sys.obj$ io, sys.obj$ t, sys.ind$ i,sys.object_usage
ou where i.obj# = ou.obj# and io.obj# = ou.obj# and t.obj# =i.bo#
and u.user# = io.owner#;
SQL> select u.name owner, io.name index_name, t.nametable_name,
decode(bitand(i.flags, 65536), 0, 'NO', 'YES') monitoring,
decode(bitand(ou.flags, 1), 0, 'NO', 'YES')used,ou.start_monitoring
start_monitoring,ou.end_monitoring end_monitoring
from sys.user$ u, sys.obj$ io, sys.obj$ t, sys.ind$ i,sys.object_usage
ou where i.obj# = ou.obj# and io.obj# = ou.obj# and t.obj# =i.bo#
and u.user# = io.owner#;
- 关于视图:V$OBJECT_USAGE
- V$OBJECT_USAGE视图
- 使用v$object_usage监控索引
- 使用v$object_usage监控索引
- V$视图
- V$SESSION视图和V$PROCESS视图
- 求教V$视图
- v$session_event视图
- v$archived_log视图
- 新增v$session_wait_history视图
- v$librarycache视图
- 动态视图v$sysstat
- v视图的授权
- v$session_longops视图
- oracle v$database 视图
- V$LOCK 视图
- v$controlfile_record_section系统视图
- oracle v$database 视图
- TSPITR 基于表空间时间点恢复
- 关于Block Media Recovery
- oracle 重做日志组的三种状态:current,active,inactive
- 索引组织表中的MAPPING TABLE
- 索引组织表与簇---来自互联网
- 关于视图:V$OBJECT_USAGE
- 关于重构索引--index rebuild的OCP 题
- oracle 10g中ASM概念以及管理---转置互联网
- Managing Alias Names for ASM Filenames
- DB_CREATE_ONLINE_LOG_DEST_n
- Creating Tablespaces in ASM
- ASM关于添加与删除磁盘组(DISKGROUP)
- ALTER DISKGROUP中的rebalance,ADD TEMPLATE子句等
- Mounting and Dismounting Disk Groups