Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

How to find out if an index is not being used in Oracle

Posted on 2000-06-20
3
Medium Priority
?
414 Views
Last Modified: 2010-05-19
Is there a way to find out if an index is not being used in oracle.??
0
Comment
Question by:tiger20
  • 2
3 Comments
 
LVL 5

Accepted Solution

by:
sbenyo earned 200 total points
ID: 3011313
Yes.
You should run an explain plan on the query you want to check.
Explain plan shows you how oracle executes your query and what indexes are in use in the query.

To do this:

1) connect using SqlPlus.

2) run the script:

$ORACLE_HOME/rdbms/admin/utlxplan.sql

This creates the explain plan table used by oracle to create the explain plan.

2) in sqlplus:
   sqlplus>set autotrace on
   
3) Now run the query. In the explain plain oracle shows you can see if indexes are used or not.

Sample explain:

Execution Plan
----------------------------------------------------------
   0   SELECT STATEMENT Optimizer=FIRST_ROWS (Cost=1 Card=82 Bytes=
    164)

   1 0   TABLE ACCESS (FULL) OF 'DUAL' (Cost=1 Card=82 Bytes=164)

This show a table accessed without indexes (FULL).

You can also use sql trace to do that. If you want to know about it tell me.
0
 

Author Comment

by:tiger20
ID: 3011419
Answer accepted
0
 

Author Comment

by:tiger20
ID: 3011420
Cheers sbenyo that worked a treat.... Here the points .... enjoy :-)
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

How to Unravel a Tricky Query Introduction If you browse through the Oracle zones or any of the other database-related zones you'll come across some complicated solutions and sometimes you'll just have to wonder how anyone came up with them.  …
When it comes to protecting Oracle Database servers and systems, there are a ton of myths out there. Here are the most common.
This video shows syntax for various backup options while discussing how the different basic backup types work.  It explains how to take full backups, incremental level 0 backups, incremental level 1 backups in both differential and cumulative mode a…
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function
Suggested Courses

782 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