Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Index Questions
Comments embedded.
melliott42_at_yahoo.com (Michael) wrote in message news:<91721cf.0407131451.737d98b_at_posting.google.com>...
> Hello,
>
> In Oracle 8i on Solaris how can I:
>
> 1. Determine the SQL used to create an existing index?
You might find such code in DBA_SOURCE, or USER_SOURCE. Alternatively you can export the schema then run imp with the indexfile parameter:
imp user/pass file=mydat.dmp full=y indexfile=mydat.sql
then peruse the file created. It will be chock full of CREATE INDEX statements.
> 2. Rebuild an Index that may be corrupt or have
> invalid data?
Alter index <indexname> rebuild;
Although why you'd need to rebuild an index is a mystery to me, since indexes don't really benefit from a rebuild, nor does performance improve. Unless you have other issues causing an index to become corrupted, making a rebuild necessary. And, even then, you've only treated a symptom, and not the underlying cause.
> 3. Look for any errors that may have occured as a
> result of an Index Primary\Foreign Key failing?
>
How does a primary key 'fail'? I suspect you are tilting at windmills in your quest to solve a problem. A bit more information would be appreciated, such as error numbers and text, SQL statements that are experiencing errors, etc.
> Thanks,
>
> Michael
David Fitzjarrell Received on Tue Jul 13 2004 - 23:37:44 CDT