title: extract millions of records from sql server and load into oracle database using python script
body: <p>I am extracting millions of data from sql server and inserting into oracle db using python. It is taking 1 record to insert in oracle table in 1 sec.. takes hours to insert. What is the fastest approach to load ?
  My code below:</p>
  <pre><code>def insert_data(conn,cursor,query,data,batch_size = 10000):
      recs = []
      count = 1
      for rec in data:
          recs.append(rec)
          if count % batch_size == 0:
  
              cursor.executemany(query, recs,batcherrors=True)
              conn.commit()`enter code here`
              recs = []
          count = count +1
          cursor.executemany(query, recs,batcherrors=True)
          conn.commit()
  </code></pre>