If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

db2 execute commands in parallel

The ${file} has just an export statement. There is no issue with locking, comit or wait because when I run it in two different shell manually it is working perfectly fine. But within a single shell it is not working.

Try creating a sub-script which does these things: (a) dots in the correct db2profile (b) connects to the database (aborting on failure), (c) perform the export to fully qualified pathname. Your sub-script can take command-line parameters (e.g. database-name, schema and table to export and the sql-query to run etc).

Then in your parent script, use the backgrounding on this sub-script, supplying any parameters as needed.