Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??

I cordially advise that you are going about this the wrong way ... that “parallel tasks/threads” will not make things go faster, but substantially slower.   You should be using the bulk-loading tool that Oracle provides for this purpose, since it is optimized to do exactly this.

If you find that for whatever reason you do need to load large amounts of data into an SQL database (of any sort) by conventional means, there are several things that I suggest you consider:

  1. Parallelism is probably not your friend, probably will not help, because it just makes more work for the SQL engine at the other end of the wire.
  2. You must do the work within a transaction, and you should carefully choose that transaction’s “isolation level.”   (This sort of work needs to push other concurrent work aside as much as possible, through an aggressive choice of isolation level, which is why it is often done in the wee hours...)   Post a few thousand records, say, then commit, then open up another one.   (This will allow the database to do “lazy writing.”)   prepare the statement-handle, with placeholders, and use it repeatedly.
  3. Consider how the process can be made restartable.   Once you have successfully committed, record where you are in the input-file so that you could potentially restart at that checkpoint if the program should unexpec...   ;-)

But, once again, there are “bulk loader” programs that are specifically designed to do this.


In reply to Re: Fork a new process for inserting a record in DB (Oracle) by sundialsvc4
in thread Fork a new process for inserting a record in DB (Oracle) by juvenile_monk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others romping around the Monastery: (8)
As of 2024-04-19 11:07 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found