Solved

find out index the table is using

Posted on 2014-03-03
15
320 Views
Last Modified: 2014-06-09
Dear all,

Any way to find out all indexes of the Oracle tables so as to find out any index which is no use any more and therefore the candidates index to drop ?
0
Comment
Question by:marrowyung
  • 7
  • 3
  • 2
  • +2
15 Comments
 
LVL 142

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 39900698
if you drop a table, all it's related indexes will be dropped also.
apart from that, you can check the USER_INDEXES, ALL_INDEXES or DBA_INDEXES to see the indexes on which table they are.
0
 
LVL 29

Expert Comment

by:MikeOM_DBA
ID: 39900728
You need to set monitoring:
ALTER INDEX {index name}  MONITORING USAGE;

Open in new window

And then query v$object_usage
:p
0
 
LVL 1

Author Comment

by:marrowyung
ID: 39900734
you mean

ALTER INDEX {index name}  MONITORING USAGE; 

Open in new window


is to monitor if the index still using ?

"And then query v$object_usage"

select * from v$object_usage where what ?
0
 
LVL 29

Accepted Solution

by:
MikeOM_DBA earned 500 total points
ID: 39900746
1) Connect as user schema owner of the index and execute the 'ALTER,,MONITORING' command.
2) And yes, monitoring on index(es) will start monitoring if index is being used.
3) To check if index has been used, select * from v$object_usage where . . . . . .
SQL> desc  v$object_usage
 Name                    Null?    Type
 ----------------------- -------- ----------------
 INDEX_NAME              NOT NULL VARCHAR2(30)
 TABLE_NAME              NOT NULL VARCHAR2(30)
 MONITORING                       VARCHAR2(3)
 USED                             VARCHAR2(3)
 START_MONITORING                 VARCHAR2(19)
 END_MONITORING                   VARCHAR2(19)

Open in new window

idx-not-used.sql
0
 
LVL 37

Expert Comment

by:Geert Gruwez
ID: 39901315
be careful with dropping indexes like that
certain queries are only used in year-end calculations
0
 
LVL 1

Author Comment

by:marrowyung
ID: 39902321
"certain queries are only used in year-end calculations "

but not the index. should be all right? or what are you concerning about ?

from your result (screenshot) what it tells ?
0
 
LVL 29

Expert Comment

by:MikeOM_DBA
ID: 39903272
What Geert means is to be careful which indexes you drop because they could be used only once a year in year-end calculations.

That is one of the reasons I include in my scripts the "age" of the index, in order to verify that "recently" created indexes are being used.

Good Luck!
0
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 
LVL 1

Author Comment

by:marrowyung
ID: 39908438
" they could be used only once a year in year-end calculations."

so if I drop that the year-end calculation will be very slow  ?

I will consult the developer what it use before dropping it.
0
 
LVL 142

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 39908760
>so if I drop that the year-end calculation will be very slow  ?
exactly.
0
 
LVL 1

Author Comment

by:marrowyung
ID: 39909324
but just only at that time, I can say server is busying! ahaha
0
 
LVL 1

Author Comment

by:marrowyung
ID: 40116373
ok, I may re active it if I need
0
 
LVL 1

Author Comment

by:marrowyung
ID: 40116384
ok,yeah, might come back and re active it if I need.
0
 
LVL 1

Author Comment

by:marrowyung
ID: 40116393
one thing, how can I find out the pass question, it seems the old EE  is better on this!
0
 
LVL 22

Expert Comment

by:Steve Wales
ID: 40121521
This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
return result by latest date - oracle query 21 69
Oracle DATE Column Space 11 59
data lookup in Oracle - need suggestions 55 102
Oracle 12c database link between pdb not working 20 42
Subquery in Oracle: Sub queries are one of advance queries in oracle. Types of advance queries: •      Sub Queries •      Hierarchical Queries •      Set Operators Sub queries are know as the query called from another query or another subquery. It can …
Checking the Alert Log in AWS RDS Oracle can be a pain through their user interface.  I made a script to download the Alert Log, look for errors, and email me the trace files.  In this article I'll describe what I did and share my script.
This video shows how to copy a database user from one database to another user DBMS_METADATA.  It also shows how to copy a user's permissions and discusses password hash differences between Oracle 10g and 11g.
This video explains at a high level about the four available data types in Oracle and how dates can be manipulated by the user to get data into and out of the database.

919 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now