Skip to Main Content

Database Software

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Need a command to reorder columns in a table

Torsten KleiberDec 12 2014 — edited Jan 11 2016

This isuseful from performance point of view if the columns changes for null to not null or in the other direction.

Not null columns, escpecially primary and foreign key columns are filled ever and should be at the start of a database block to keep it as small as possible.

The way to reach this goal is very complex and error prone at the moment:

- renaming the original table

- creating a new table with original name and the changed order

- inserting the values in the new table from the old table

- reassign foreign keys from old table to new table

- drop renamed old table

Comments
Post Details
Added on Dec 12 2014
3 comments
696 views