Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: help: How do you find a index which belongs to a primary key
If you're on 8.1.x then this one will do the job (and a bit more):
http://www.marcblum.de/ora_scripts/strip_table.sql
On Thu, 28 Mar 2002 03:18:28 GMT, "Joe Sath" <dbadba62_at_hotmail.com> wrote:
>I am writing a script, in which I need to drop all the indexes on that
>table.
>
>I use
>select index_name from dba_indexes where owner='$owner' and
>table_name='$table_name'
>and index_type='NORMAL'
>
>The problem is, sometimes the index is associated with a primary key, and
>the index can not be dropped, so the application will fail.
>
>Could someone tell me how should I improve the above sql so that any indexes
>which is related to a constraint(primary key) will not be selected?
>
>Thanks for your help.
>
>
regards
Marc Blum
mailto:marc_at_marcblum.de
http://www.marcblum.de
Received on Thu Mar 28 2002 - 07:57:41 CST