What is more efficient INSERT command or SQL Loader for bulk upload - ORACLE 11g R2

oracle, oracle11gr2, sql, sql-loader

Solution

`SQL*Loader` is the more efficient method. It gives you more control. You have an option do `DIRECT` load and `NOLOGGING`, which will reduce redo log generation, and when indexes have been disabled (as part of direct loading), the loading goes faster. Downside, is if load is interupted, indexes are left `unusable`.

But, considering the advantages, `SQL*Loader` is the best approach. And you will feel the difference, when you have millions of records, and having so many loading jobs running in parallel. I heard DBA complaining about the log size, when we do `CONVENTIONAL INSERT` statement loading, with 200+ such jobs, running in parallel. The larger the data volume, the larger the difference you'll see in performance.

Problem

As part of a new process requirement, we will be creating table and which will contain approximately 3000 - 4000 records. We have a copy of these records in plain text on a txt file. Loading these records in the table leaves me with two choices Use a shell script to generate SQL file containing INSERT Statements for these records - with the use of awk, shell variables, and loops to create a sql and script execution of this sql, we can be performed with ease Use of SQL Loader. - Realignment of the record list and ctl file generation the only dependency. Which of the above two options would be most efficient, in terms of taking up DB resources, utilisation on the client server on which this is to be performed. I do realise the number of records are rather small, but we may have to repeat this activity with higher number of records (close to 60,000) in which case I would like to have the best possible option configured from the start.

Original source