Avatar of d27m11y d27m11y
d27m11y d27m11y
Flag for United States of America asked on

drop the existing index and recreate on different columns

I have a history table that contains 3 months of data. Can I drop the existing index built on (a, b, c)  and recreate an index on different columns like on (a, b, d, e). Does this affect data. Are there any steps that I have to follow in sequence.

What are the required steps that I have to follow.

Please advise asap!
Oracle Database

Avatar of undefined
Last Comment
Steve Wales

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
slightwv (䄆 Netminder)

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
d27m11y d27m11y

ASKER
How do we revalidate?
SOLUTION
Sean Stuber

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
slightwv (䄆 Netminder)

Check out:  DBMS_UTILITY.COMPILE_SCHEMA

http://docs.oracle.com/cd/E11882_01/appdev.112/e40758/d_util.htm#ARPLS73226

or you can connect as a privileged account and run utlrp whick tries to compile ALL objects in dependency order.
slightwv (䄆 Netminder)

>>No invalidation of objects should occur due to an index build.

They are dropping not rebuilding.

https://docs.oracle.com/cd/B28359_01/server.111/b28286/statements_8016.htm
When you drop an index, Oracle Database invalidates all objects that depend on the underlying table, including views, packages, package bodies, functions, and procedures.
Experts Exchange is like having an extremely knowledgeable team sitting and waiting for your call. Couldn't do my job half as well as I do without it!
James Murphy
SOLUTION
Sean Stuber

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
slightwv (䄆 Netminder)

I guess I stand corrected.  It used to be that way.  I lived it!

I cannot say if 11.1 is a doc bug or not.

Anyway, guess object invalidation is not longer a thing on dropped indexes.
Sean Stuber

11.2 adds a lot of invalidation protection.

If you change part of a package, objects dependent on the other parts should not invalidate.
You can still get "existing state discarded" errors if you happen to already have the package in memory, but that makes sense.
d27m11y d27m11y

ASKER
or  can I alter index which was built on (a, b, c)  to an index on different columns like on (a, b, d, e).
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
SOLUTION
Sean Stuber

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
d27m11y d27m11y

ASKER
Was able to drop and recreate the index.
Steve Wales

No comment has been added to this question in more than 21 days, so it is now classified as abandoned.

I have recommended this question be closed as follows:

Split:
-- slightwv (https:#a41525439)
-- sdstuber (https:#a41525452)
-- sdstuber (https:#a41525462)
-- sdstuber (https:#a41525582)


If you feel this question should be closed differently, post an objection and the moderators will review all objections and close it as they feel fit. If no one objects, this question will be closed automatically the way described above.

sjwales
Experts-Exchange Cleanup Volunteer