Armine
Armine

Reputation: 1695

Can I use the same index in 2 different tables but on the same columns in Oracle

I have a table and need to create its duplicate in Oracle (including indices and sequences) as a history of the first one. To create the table with its data I can do like this:

create table new_table as select * from original_table;

Of course, this will not create any index, sequence or trigger which the original table has. Creating all that I can do in few ways. My question is not how can I create all that but my question is the following:

Upvotes: 0

Views: 902

Answers (1)

BriteSponge
BriteSponge

Reputation: 1054

An index entry points to the location of a records data at a particular location in a block. The data in your history table cannot exist in the same location as the data in the original table so therefore the locations being pointed to will never match. If you research how an index actually works in Oracle you will see why this is not possible.

Upvotes: 1

Related Questions