Saturday, July 23, 2011

How will we know that all the records have been inserted into our Oracle database table?

Question: We will be inserting 10 million records into a table in our Oracle database. How will we know that all the records have been inserted into our table? 


Unless we're missing something, the easiest way to do this is to count the number of records in your destination table before the insert and then count them again after the insert. This is done by issing the SQL command SELECT COUNT(*) FROM my_table;

You don't say what you're using to do the insert but if you're using tools like SQL*Loader, or Import/Impdp these also generate log files which can be examined after the insert for any errors.

If you're writing a bespoke program to do this then ensure that you write any errors to a log file.

0 comments:

Post a Comment

Twitter Delicious Facebook Digg Stumbleupon Favorites More

 
Design by Deep's | Bloggerized by Deep - Deep's Templates | ElearSQL-Server