Monitoring Index Usage


SQL> create table anar1 (id number);
Table created.
SQL> insert into anar1 values (1);
1 row created.
SQL> insert into anar1 values (2);
1 row created.
SQL> insert into anar1 values (3);
1 row created.
SQL> commit;
Commit complete.
SQL> create index idx_anar1_id on anar1(id);
Index created.
SQL> select table_name, index_name, monitoring, used from v$object_usage;
no rows selected
SQL> alter index idx_anar1_id monitoring usage;
Index altered.
SQL> select table_name, index_name, monitoring, used from v$object_usage;
TABLE_NAME INDEX_NAME MON USE
------------------------------ ------------------------------ --- ---
anar1 IDX_anar1_ID YES NO
SQL> select count(*) from anar1 where id=1;
COUNT(*)
———-
1
SQL> select table_name, index_name, monitoring, used from v$object_usage;
TABLE_NAME INDEX_NAME MON USE
------------------------------ ------------------------------ --- ---
anar1 IDX_anar1_ID YES YES
SQL> alter index idx_anar1_id nomonitoring usage;
Index altered.
SQL> select table_name, index_name, monitoring, used from v$object_usage;
TABLE_NAME INDEX_NAME MON USE
------------------------------ ------------------------------ --- ---
anar1 IDX_anar1_ID NO YES

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: