Skip to main content
Inspiring
Nov 30, 2018 1:22 PM UTC
Question

Bulk insert to Oracle

Hi All,

Trying to insert 200K records to Oracle 12c.

We did this concept couple years ago, it is taking 6min doing the inserts:

Re: pass query to oracle

Is there a better technique do to a faster bulk insert to Oracle with the new version of ColdFusion?

We are using CF11 but we can upgrade if it is necessary.

Thanks,

Johnny

    This topic is closed to new replies. Start a new post to keep the conversation going.

    7 replies

    WolfShade
    Legend
    Nov 30, 2018 2:15 PM UTC

    In what format are the 200k records?  Query object?  Excel object?  JSON object?  CFDIRECTORY object (which is really just another query object)?

    In Oracle, I believe the best way to insert multiple records, whether 100 records, 200k records, or one million records, is to do something like:

    INSERT ALL

    <!--- begin iterative looping --->

    into TableA (col1, col2, col3, col4) VALUES (val1, val2, val3, val4)

    <!--- end iterative looping --->

    SELECT * FROM DUAL; <!--- THIS IS VERY IMPORTANT --->

    HTH,

    ^ _ ^

    Translate
    Charlie Arehart
    Community Expert
    Community Expert
    Nov 30, 2018 2:00 PM UTC

    Johnny, you really need to know first where the hangup is, whether in cf or the db. Could be either or both  and the "fix" would depend on the actual problem.

    So first, do you have anything monitoring cf and/or oracle? You really need one or both to get your best solution  Anything else would just be people guessing 

    Translate
    /Charlie (troubleshooter, carehart. org)
    jfb00Author
    Inspiring
    Nov 30, 2018 2:06 PM UTC

    Hi Charlie,

    Thanks for your reply and help.

    We are using timing code for every step. The 6mins is where the insert code (cfquery db connection) is taking in place.

    How can I figured if it is the cf or db?

    Translate
    WolfShade
    Legend
    Nov 30, 2018 2:19 PM UTC

    Just checked the link you provided.    But this method is still being slow/bottlenecked?

    If that's the case, then Charlie is correct in that you need to get monitoring going on both CF and Oracle to find out what is slowing things down.

    V/r,

    ^ _ ^

    Translate