Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

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

Posted on 2000-06-20
3
Medium Priority
?
406 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Get your Disaster Recovery as a Service basics

Disaster Recovery as a Service is one go-to solution that revolutionizes DR planning. Implementing DRaaS could be an efficient process, easily accessible to non-DR experts. Learn about monitoring, testing, executing failovers and failbacks to ensure a "healthy" DR environment.

Question has a verified solution.

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

Cursors in Oracle: A cursor is used to process individual rows returned by database system for a query. In oracle every SQL statement executed by the oracle server has a private area. This area contains information about the SQL statement and theā€¦
When it comes to protecting Oracle Database servers and systems, there are a ton of myths out there. Here are the most common.
Via a live example show how to connect to RMAN, make basic configuration settings changes and then take a backup of a demo database
This video shows how to copy an entire tablespace from one database to another database using Transportable Tablespace functionality.

721 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