Tomorrow will be a work day for me =(.
Colls, i need that sql script wait an end of sql*loader work in my -bash script. Is it right code below?:
#!/bin/bash
echo -------- uploader.sh v 0.1 --------
# @echo;
export NLS_LANG=russian_cis.ru8pc866
export NLS_NUMERIC_CHARACTERS='.'
ORACLE_HOME=/opt/app/oracle/product/10.2.0/db_1/bin
export ORACLE_HOME
PATH=$ORACLE_HOME
export PATH
sqlldr userid=myscheme/0611@TEST_DB control=control_file.ctl LOG=test_log.log errors=100
wait #here i want to wait sqlloader executing
sqlplus userid=myscheme/0611@TEST_DB 10.33.19.13/test/DATA_UPLOAD/mysql_script.sql
I’ve read about wait function here.
Shell scripts, by default, only execute commands after the previous command has completed. The only exception to this is when you execute something in a background thread using
&. So executingwill already do what you want.
However, if you want to use a separate thread so you can continue execution in the main thread, you can use
That will allow you to
do other stuffwhile thesqlldrcommand finishes. The program would then wait for thesqlldrcommand to complete before callingsqlplus.