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

From: Michael Dinh <mdinh_at_XIFIN.Com>
Date: Mon, 27 Jun 2011 11:28:58 -0700
Message-ID: <D29F9902E534D5478F2E83FD6A44B3063B039D4F8C_at_mail02.mba.xifin.com>



Is the Oracle environment sourced?

Let's see $ORACLE_HOME, $ORACLE_SID, $PATH from the shell script.

Michael Dinh

NOTICE OF CONFIDENTIALITY - This material is intended for the use of the individual or entity to which it is addressed, and may contain information that is privileged, confidential and exempt from disclosure under applicable laws. BE FURTHER ADVISED THAT THIS EMAIL MAY CONTAIN PROTECTED HEALTH INFORMATION (PHI). BY ACCEPTING THIS MESSAGE, YOU ACKNOWLEDGE THE FOREGOING, AND AGREE AS FOLLOWS: YOU AGREE TO NOT DISCLOSE TO ANY THIRD PARTY ANY PHI CONTAINED HEREIN, EXCEPT AS EXPRESSLY PERMITTED AND ONLY TO THE EXTENT NECESSARY TO PERFORM YOUR OBLIGATIONS RELATING TO THE RECEIPT OF THIS MESSAGE. If the reader of this email (and attachments) is not the intended recipient, you are hereby notified that any dissemination, distribution or copying of this communication is strictly prohibited. Please notify the sender of the error and delete the e-mail you received. Thank you. From: oracle-l-bounce_at_freelists.org [mailto:oracle-l-bounce_at_freelists.org] On Behalf Of sundar mahadevan Sent: Monday, June 27, 2011 11:11 AM
To: Oracle-L_at_freelists.org
Subject: cannot spool the mounted standby database through cron job shell script. Any other suggestions?

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:28:58 CDT

Original text of this message