Quote:
Originally Posted by catkin
I do not understand why you are getting that particular error (is the code an exact copy-and-paste?) but suggest regularising the quoting and the export commands
Code:
#!/bin/sh
export ORACLE_BASE=/meds/appl/oracle
export ORACLE_HOME=$ORACLE_BASE/product/102
ORACLE_SID=TABS1
export PATH="/usr/ccs/bin:$PATH:$ORACLE_HOME/bin:$ORACLE_HOME/OPatch:/meds/oracrs/product/102/bin"
DATE_SUFFIX="$(date '+%m-%d-%Y_%r')"
tmpfile="/log/dbspace/MEDS_DBSPACE$DATE_SUFFIX.log"
Is there any particular reason why you are using #!/bin/sh rather than #!/bin/bash?
|
Thanks all, that error fixed by using DATE_SUFFIX="$(date '+%m-%d-%Y_%r')"
now, the current code is :
#!/bin/bash
ORACLE_BASE=/meds/appl/oracle export ORACLE_BASE
ORACLE_HOME=$ORACLE_BASE/product/102 export ORACLE_HOME
ORACLE_SID=meds1
PATH=/usr/ccs/bin:$PATH:$ORACLE_HOME/bin:$ORACLE_HOME/OPatch:/meds/oracrs/product/102/bin
export PATH
DATE_SUFFIX="$(date '+%m-%d-%Y_%r')"
tmpdir=/meds/work/log/dbspace
tmpfile="/meds/work/log/dbspace/meds_DBSPACE$DATE_SUFFIX.log"
sqlplus username/password@meds1 as sysdba <<EOF
set termout off
set timing on
spool $tmpfile
@/meds/scripts/dbspace.sql
spool off
exit
EOF
now, the spool file is not getting passed inside sqlplus and am getting the error :
SQL> SQL> SQL> SP2-0332: Cannot create spool file.
SQL> SQL> not spooling currently
Any idea ?
Kai