We have an Oracle 11g database table with around 35 million rows. We are in a situation where we have to update all values of one column. This column is indexed.
I have a script that can generate the updated values and can populate it in a text file.
I’m looking for a good strategy to do a bulk update to this table. We can afford a downtime of around 10 hours.
Will it be a good idea to
- Dump the entire table to a flat file
- Update the values using any scripting language
- Reload the entire table
- Rebuild indexes
What are the pitfalls that one can encounter?
I’m not competent in PL/SQL. Is there a way to solve this in PL/SQL or any way “within” the database itself?
Thanks,
Prabhu
The fastest way will probably be to create an external table based on your flat file of update values and then:
(Make sure that join returns all the rows from old_table. The join may need to be an outer join.)