From:Steve Adams
Date:16-May-2001 20:29
Subject:   Performance of bulk update procedure

Assuming that the main table is not subject to any other updates during this time, I would suggest that you build a new copy of the main table using parallel CREATE TABLE AS SELECT to join the main table and the temporary, then build any indexes, constraints and so on that you require, and then rename the new table as the main table. If it's compatible with your recovery strategy, most of this can be done with the NOLOGGING option too.

I have a main table which consists of 7 million records. Daily I get a flat file of 1 million records. I have to compare the records in the flat file field by field with records in the main table and if they do not match, then I have to update the record in the main table with the data in the flat file.

I load the data in the flat file into a temporary table and I use a stored procedure to compare the records in the temp table and main table and subsequently update the main table. Is this the optimal way of doing things? Is there any other method of doing it optimally? The stored procedure is taking a lot of time (around 10 hours).