Good afternoon:
I need your help please, Im new at Unix nd specially Unix applicationas like oracle and Ive got this problem:
I was asked to execute the next script using nohup in order to not hang up the session because it was supposed to connect to the database and then insert about 2 millions of rows to a table
and this process akes about 2 hours
I run this script with oracle user because of privilige issues previusly exporting some oracle vars
export ORACLE_SID=XYZ
export TWO_TASK=XYZ
SCEL:/oracle/oracle/PACKAGES/CXYZ/Install oracle@prosclbt00c # id
uid=1000(oracle) gid=26(dba)
nohup ./install_bd.ksh &
But after 12 hours or more this process continue writing both logs consuming so much space
-rw------- 1 oracle dba 1.8G Dec 8 12:23 nohup.out
-rw-r----- 1 oracle dba 1.8G Dec 8 12:23 install_1_0_SCEL.log
Sadly, we validate with our DBA if there was any session but he said there was neither session with OSUSER oracle nor any other sessions affecting the specified tables.
So it was likely the process was redirecting the output to both logs but it never connected to the DATABASE, dont know for sure:
This is the scriptinstall_bd.ksh
This is the scriptinstall_bd.ksh
more install_bd.ksh
#!/bin/ksh
# Descripcion: ASB
# Cambio de:
#
time sqlplus /<<EOF
set echo on verify on feedback 1 timing on time on pages 10000 lines 132 trimspool on tab off flush off
/
WHENEVER SQLERROR CONTINUE
set echo on verify on feedback 1 timing on time on pages 10000 lines 132 trimspool on tab off flush off
spool install_1_0$1_$ORACLE_SID.log
@install_1_0.sql
spool off
disconnect
EOF
resultado=$(egrep "ORA-|PLS-|SP2-" sclsql_$1_$ORACLE_SID.log |grep -v "ORA-00001" | grep -v "ORA-01430" |grep -v "ORA-01921" | grep -v "ORA-01920" |sort -u > final.log)
hay_error=`wc -l final.log | awk '{ print $1 }'`
ls -ltr *.log
cat final.log
rm final.log
echo "ERRORES ENCONTRADOS "$hay_error
exit
The questions are:
- I would like to know it was something wrong executing the scrpit install_bd.ksh & using nohup?
2 if so how to control the proceses can not hang up? wouldnt it better to modify inside the script install_bd.ksh this line:
nohup time sqlplus /<<EOF ?
I'd appreciate your help in advanced