Home > database >  Rebuild index classic question: "stickers sent immediately, can see come over!
Rebuild index classic question: "stickers sent immediately, can see come over!

Time:10-06

Oracle index:
Problem a: 1. My expectations (aims) : expect only the newly created index_user index effect, make a backup of the original index only convenient (reduction), doesn't work!
2. Problem description: name of existing index for index_user,,, if I will only the name changed to index_user_bak index (index unchanged content itself), another index index_user (and former index_user create statements are exactly the same), excuse me: 1. The corresponding table, the effective index of which is: index_user_bak and index_user? Or only index_user? Or other (e.g. an error)?

Question 2: if rebuild index (because there are large quantities of data deletion), performed the command below:
ALTER INDEX index_user REBUILD; (the ALTER INDEX index_user REBUILD COMPUTE STATISTICS; )
If you want to index into effect immediately, you need to do other operations? (such as: to update statistics: the execute dbms_stats. Gather_table_stats,,,)

Although not much, but the sincerity full, thank you for your kiss!

CodePudding user response:

The first question, run once you know the result,

If your second question, collect statistics;

CodePudding user response:

@ wmxcn2000: eldest brother:
Question 1: what is the specific situation? (what I need is only the newly created index_user effect index: oh, so you can? Or must first delete the original index files, and then create the same index file?)
Question 2: only by the above named rebuild index will take effect immediately? (if not manual update statistics, whether oracle has their own job after a certain period of time to perform, will also take effect?)

CodePudding user response:

 - problem a 

SQL>
SQL> Create table test (int id, name varchar2 (10));
The Table created
SQL> The create index ix_test on test (id);
The Index created
SQL> Alter index ix_test rename to ix_text_1;
The Index altered
SQL> The create index ix_test on test (id);
The create index ix_test on test (id)
ORA - 01408: indexed column list
SQL> Drop table test purge;
Table dropped

SQL>
  • Related