Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: Need an SQL*Plus script to show indexes on a given table
Tom wrote:
>
> Could someone please post an SQL*Plus script that will list the
> indexes and the fields in those indexes for a given table? Thanks!
connect scott/tiger;
select index_name from user_indexes where table_name='EMP';
will give you:
INDEX_NAME
select column_position,column_name
from user_ind_columns
where index_name = 'PK_EMP';
will give you:
COLUMN_POS COLUMN_NAME
---------- ------------------------------ 1 EMPNO
You can use DESCRIBE USER_INDEXES and
DESCRIBE USER_IND_COLUMNS
to get all the fields in these views.
Just include the two select statements in a script.
Hope that helps
Michael
Received on Wed Feb 04 1998 - 00:00:00 CST
![]() |
![]() |