I used threading
module to open multiple sqlloader
sessions and it worked fine.
Having troubles achieving same degree of parallelism using asyncio
module (coroutines).
This code always loads sequentially in Python 3.5:
import asyncio
async def load_data(filename):
loadConf=('sqlldr SKIP=%s %s userid=%s DATA=%s control=%s LOG=%s.log BAD=%s.bad DISCARD=/dev/null' % (...)).split(' ')
p = Popen(loadConf, stdin=PIPE, stdout=PIPE, stderr=STDOUT, shell=False, env=os.environ)
output, err = p.communicate(pwd.encode())
status=p.wait()
async def main():
await asyncio.wait([load_data(file1),load_data(file2)])
if __name__ == "__main__":
loop = asyncio.get_event_loop()
loop.run_until_complete(main())