Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Is index used for constraint enforcement?

Re: Is index used for constraint enforcement?

From: Jonathan Lewis <jonathan_at_jlcomp.demon.co.uk>
Date: Tue, 2 Sep 2003 17:39:18 +0100
Message-ID: <bj2h3g$mp2$1$8302bc10@news.demon.co.uk>

I think that's a feature that appeared in v9, possibly 9.2

For 8.1, you need to look at the sys tables cdef$, con$ and ind$.

con$ hold the name and con# for the constraint, cdef$ has the con# and a column called enabled. If the constraint is enforced by an index, then the enabled column matches the obj# column of the relevant index in the ind$ table.

I think Tom Kyte has a script that does this check on the asktom site.

--
Regards

Jonathan Lewis
http://www.jlcomp.demon.co.uk

  The educated person is not the person
  who can answer the questions, but the
  person who can question the answers -- T. Schick Jr


One-day tutorials:
http://www.jlcomp.demon.co.uk/tutorial.html

____Finland__September 22nd - 24th
____Norway___September 25th - 26th
____UK_______December (UKOUG conference)

Three-day seminar:
see http://www.jlcomp.demon.co.uk/seminar.html
____USA__October
____UK___November


The Co-operative Oracle Users' FAQ
http://www.jlcomp.demon.co.uk/faq/ind_faq.html


"Brian Peasland" <dba_at_remove_spam.peasland.com> wrote in message
news:3F54BDE0.E9168F28_at_remove_spam.peasland.com...

> Go back and look at USER_CONSTRAINTS again. If the constraint
requires
> an index, then the INDEX_OWNER, INDEX_NAME columns of
USER_CONSTRAINTS
> will tell you which index that specific constraint uses.
>
> HTH,
> Brian
>
> Marko Kimpel wrote:
> >
> > I'm using Oracle 8.1.7.
> >
> > How can I determine if a given table index is required for
enforcement
> > of a constraint (e.g. unique or pk constraint)? Didn't find
usefull
> > information in USER_INDEXES or USER_CONSTRAINTS.
> >
> > (Assuming the same name of index and constraint does not work
since
> > Oracle may use an existing index when creating an constraint and
thus
> > use different names.)
> >
> > Marko
>
> --
> ===================================================================
>
> Brian Peasland
> dba_at_remove_spam.peasland.com
>
> Remove the "remove_spam." from the email address to email me.
>
>
> "I can give it to you cheap, quick, and good. Now pick two out of
> the three"
Received on Tue Sep 02 2003 - 11:39:18 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US