change the requirement, what you need to do is either:
o set the indexes unusable - leaving them in place.
o delete and reload the data (lots of work here - delete is expensive)
o rebuild the indexes
that way you'll NEVER lose any (you do not use unique indexes in this case, you use only non-unique indexes - but that is OK, you don't need unique indexes for primary keys or uniqueness)
something like this:
ops$tkyte%ORA9IR2> create table t as select * from all_users;
Table created.
ops$tkyte%ORA9IR2> create index t_pk on t(user_id);
Index created.
ops$tkyte%ORA9IR2> create bitmap index t_idx on t(username);
Index created.
ops$tkyte%ORA9IR2> alter table t add constraint t_pk primary key(user_id);
Table altered.
ops$tkyte%ORA9IR2>
ops$tkyte%ORA9IR2> alter index t_pk unusable;
Index altered.
ops$tkyte%ORA9IR2> alter index t_idx unusable;
Index altered.
ops$tkyte%ORA9IR2> alter session set skip_unusable_indexes=true;
Session altered.
ops$tkyte%ORA9IR2>
ops$tkyte%ORA9IR2> alter table t modify constraint t_pk DISABLE keep index;
Table altered.
ops$tkyte%ORA9IR2> delete from t;
32 rows deleted.
ops$tkyte%ORA9IR2> insert into t select * from all_users;
32 rows created.
ops$tkyte%ORA9IR2> alter index t_idx rebuild;
Index altered.
ops$tkyte%ORA9IR2> alter index t_pk rebuild;
Index altered.
ops$tkyte%ORA9IR2> alter table t modify constraint t_pk enable;
Table altered.
ORa) use partitioning and load a partition at a time.
advantage here is that you can direct path load (skip undo/redo on the table if you want), direct path loads maintain indexes very efficiently (you don't have to full scan the table over and over and over for each index rebuild!), and you can use truncate to remove the old data (NO DELETE!!)
ops$tkyte%ORA9IR2> create table t
2 (
3 part_id, OWNER, OBJECT_NAME, SUBOBJECT_NAME, OBJECT_ID
4 )
5 PARTITION BY list (part_id)
6 (
7 PARTITION part1 VALUES (1),
8 PARTITION part2 VALUES (2)
9 )
10 as
11 select 1 part_id, OWNER, OBJECT_NAME, SUBOBJECT_NAME, OBJECT_ID
12 from all_objects where rownum <= 10000;
Table created.
ops$tkyte%ORA9IR2> create index t_idx on t(owner,object_name) local;
Index created.
<b>now part1 has your data, part2 is EMPTY...</b>
ops$tkyte%ORA9IR2> insert /*+ APPEND */ into t
2 select 2 part_id, OWNER, OBJECT_NAME, SUBOBJECT_NAME, OBJECT_ID
3 from all_objects where rownum <= 10000;
10000 rows created.
<b>now part2 has your new data - but no one can see it right now - the indexes are already 'rebuilt' and everything, all we need to do is commit to 'release' the new data - but we have the old data in part1 to worry about - no worries though:</b>
ops$tkyte%ORA9IR2> alter table t truncate partition part1;
Table truncated.
The data is now released in part2 and part1 is empty waiting for the next load...
OR
a) create new table
b) load new table
c) index new table
d) drop old, rename new
I know this does not technically answer your question - but only because I don't think you want to do what you were planning on doing.