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

From: sundar mahadevan <sundarmahadevan82_at_gmail.com>
Date: Mon, 27 Jun 2011 14:10:57 -0400
Message-ID: <BANLkTinY4Ah7fApY-qa_cqkuL+auSi41Tw_at_mail.gmail.com>



Hi All,
Greetings. I have a standby in mount state. I would like to query the latest archive log applied on standby (in mount state) to apply the archive logs from primary with a cron job shell script. When i query "select max(sequence#) from v\$log_history;" from a shell script it works. But if i set it up as cron job as below, it does not work. I cannot assign the output to a shell variable since the database is not open and it would crap out. Any other suggestions? And the reason for this behaviour? Thanks a lot in advance.

test.sh
#!/bin/bash
sqlplus -s /nolog << EOF
set head off
connect / as sysdba
spool last_applied_on_standby.log
select max(sequence#) from v\$log_history; spool off
quit
EOF

--
http://www.freelists.org/webpage/oracle-l
Received on Mon Jun 27 2011 - 13:10:57 CDT

Original text of this message