Problem with Parallel inserts via shell script
783517Jul 7 2010 — edited Jul 8 2010Hello All,
I am trying to insert records into a table parallely using a shell script.
/*******************************************************************/
My driving shell script looks like the following:
driving.sh:
------------------
#!/bin/sh
./insert.sh 12345 3200 &
./insert.sh 87878 29898 &
./insert.sh 27874 22222 &
./insert.sh 39987 13989 &
./insert.sh 10008 13333 &
./insert.sh 10005 19898 &
./insert.sh 10003 49888 &
and so on...
insert.sh looks like the following:
-----------
#!/bin/sh
sqlplus uname/password@SCHEMA<<EOF
ALTER SESSION ENABLE PARALLEL DML;
insert into TEST_TABLE (A, B) values ($1,$2);
commit;
exit;
EOF
/*******************************************************************/
There is a AFTER INSERT FOR EACH ROW trigger associated with the TEST_TABLE. Inside this trigger, I am calling a PACKAGE.FUNCTION to perform some manipulations and to insert records into my target table ( TARGET_TABLE ). Also, the PACKAGE.FUNCTION will update few more tables.
After executing driving.sh, all the records were successfully inserted into TEST_TABLE and the updates are also successful. But inserts into my TARGET_TABLE are not successful.
For example: I have only 9 records instead of having 50 rows.
But If I remove all ' *&* ' from my DRIVING.SH, the results are always successful. Therefore, there should not be a problem with my PACKAGE.FUNCTION.
But.. as per the requirement, I should keep the ' *&* ' in the shell script as the user wants to run the shell script as a background process..
Am I missing something in the shell script? Please throw some light on this..