Hi all,
I have a folder with sql files that need to be inserted in a DB with SQL*Plus. The thing is that it takes too long to insert them all one by one, so I want to insert them five at a time.
Currently what I use is this:
for $FILENAME in *.sql
do
sqlplus -s $DBUSER@$SID << EOF
set heading off feedback off serveroutput on trimout on pagesize 0
spool $LOG append
whenever oserror exit 10
whenever sqlerror exit 5
@$FILENAME.sql
spool off
exit
EOF
done
If I run two or more instances of the above, every instance will take only one sql file and then exit despite the fact that sql files still exist. Only the last instance will keep finding files.
Any help will be greatly appreciated!