Skip to main content
Inspiring
November 30, 2018
Question

Bulk insert to Oracle

  • November 30, 2018
  • 2 replies
  • 1383 views

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 has been closed for replies.

    2 replies

    WolfShade
    Braniac
    November 30, 2018

    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,

    ^ _ ^

    Charlie Arehart
    Braniac
    November 30, 2018

    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 

    /Charlie (troubleshooter, carehart. org)
    jfb00Author
    Inspiring
    November 30, 2018

    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?

    WolfShade
    Braniac
    November 30, 2018

    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,

    ^ _ ^