Re: cannot spool the mounted standby database through cron job shell script. Any other suggestions?

From: Radoulov, Dimitre <cichomitiko_at_gmail.com>
Date: Mon, 27 Jun 2011 22:07:47 +0200
Message-ID: <4E08E313.3080805_at_gmail.com>


Change the following line:

from

sqlplus -s /nolog << EOF

to

"$ORACLE_HOME"/bin/sqlplus -s /nolog << EOF

Regards
Dimitre

On 27/06/2011 21:46, sundar mahadevan wrote:
> Hi All,
> Thanks for the response. Here is the complete script. I did set the
> oracle_sid and oracle_home. There are no error messages. The spool
> file does not get created. If i run it from command prompt, i am able
> to get the spool file created. I tested this on 11gse1(linux) as well
> as 10gr2 EE(AIX). Also i tested this on a open database and even it
> does not create the file. So this has nothing to do with the status of
> the database. Can someone try it out for me and let me know if you are
> facing the same issue. I have all permissions to write/create files on
> the directory.
>
> This is how my cronjob looks: 40 15 * * * /app/oracle/sm/test.sh invest1
>
> #!/bin/bash
> #sqplus will return last archive log applied result to the screen if
> manually run
>
> SCRIPT_DIR=/u01/app/oracle/admin/escenic/standby
> FULL_LOG_NAME=${SCRIPT_DIR}/test.log
>
> export TARGET_SID="$1"
> export TARGET_SID=`echo ${TARGET_SID} | sed -e 's/ //g'`
> export TARGET_SID=`cat /etc/oratab | grep -i "${TARGET_SID}:" | grep
> -v "^#" | cut -d : -f 1`
> export ORACLE_SID=${TARGET_SID}
> export ORACLE_HOME=`cat /etc/oratab | grep ${TARGET_SID}: | grep -v
> "^#" | cut -d : -f 2`
>
> echo "OS->${ORACLE_SID} OH->${ORACLE_HOME}" >> ${FULL_LOG_NAME}
> cd ${SCRIPT_DIR}
> echo "PWD"`pwd` >> ${FULL_LOG_NAME}
> echo "" >> ${FULL_LOG_NAME}
> sqlplus -s /nolog << EOF
> set head off
> connect / as sysdba
> spool abcd.log
> select max(sequence#) max_seq from v\$log_history;
> spool off
> quit
> EOF
>
>
> cat test.log
> OS->escenic OH->/u01/app/oracle/11gse1
> PWD/u01/app/oracle/admin/escenic/standby
>
>
>

--
http://www.freelists.org/webpage/oracle-l
Received on Mon Jun 27 2011 - 15:07:47 CDT

Original text of this message