0

I have 3 procedures to execute in a Oracle DB accessed via a python script. However, instead of running them sequentially, I would like to run them in parallel. How can I achieve this?

def main():
    try:
        myconnection_to_a_db.cursor().execute('BEGIN MYPACKAGE1.startProcess; END;')
    except Exception as e:
        logging.exception(e)
        
    try:
        myconnection_to_a_db.cursor().execute('BEGIN MYPACKAGE2.startProcess; END;')
    except Exception as e:
        logging.exception(e)
        
    try:
        myconnection_to_a_db.cursor().execute('BEGIN MYPACKAGE3.startProcess; END;')
    except Exception as e:
        logging.exception(e)
Javi Torre
  • 724
  • 8
  • 23
  • 3
    Oracle doesn't have code parallelism. You need to create different connections and explicitly parallelize execution at the application side – astentx Sep 01 '22 at 16:04
  • 1
    You can use Oracle Scheduler to run procedures in parallel, assuming the same procedures will be run every time. See here: https://stackoverflow.com/questions/62362298/run-procedures-in-parallel-oracle-pl-sql/62368447#62368447 Then you would only kick off the one job from Python and let scheduler handle the rest. – pmdba Sep 01 '22 at 16:57

0 Answers0