Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> RE: creating standby database manual ftp script

RE: creating standby database manual ftp script

From: James Bullard <jbullard_at_onvia.com>
Date: Fri, 8 Sep 2000 07:59:58 -0700
Message-Id: <10613.116513@fatcity.com>


#!/bin/ksh

Hi there, this is what I use at our site. There are other scripts that I use which move the archives into and out of position since the standby moves in and out of recovery mode. We also take a copy of the standby in read only mode every night, copy it to another node, activate and rename it.

HTH,
James

#*****************************************************************
# Module Name: ftp_production_archived_logs
# Function : Copies all archived redo logs to the standby database
# Run As : The standby database
# Description: This job copies all archived redo logs from the
# production database to the standby database via
# ftp for application into the standby database.
#*****************************************************************
#Get the highest archived log + 1 applied to the standby database.
#The +1 is to ensure that the log doesn't switch during compression of the
#next archive log.

GetMaxAppliedLog()
{
sqlplus -s $ONVIA_ACCOUNT/$ONVIA_PASSWORD@$ORACLE_SID<<SQLEOF set heading off
set feedback off
set pagesize 0
select max(sequence#)
from v\$archived_log;
SQLEOF
}
#Get environment variables needed for job
ARCHIVE_DIR=/u08/oradata/seaprod8i/arch
TRANSFER_DIR=/u06/oradata/seaprod8i/transferlogs ONVIA_HOME=/u01/home/oracle8i/prod
ORACLE_ACCOUNT=oracle8i
ORACLE_PASSWORD=$(grep PASSWORD $ONVIA_HOME/onvia_scripts.dat|grep -i $ORACLE_SID|grep -i $ORACLE_ACCOUNT|awk -F: '{print $4}') ONVIA_ACCOUNT=cron_runner
ONVIA_PASSWORD=$(grep PASSWORD $ONVIA_HOME/onvia_scripts.dat |grep -i $ORACLE_SID | grep -i $ONVIA_ACCOUNT |awk -F: '{print $4}' )

if [[ ! -a "$ARCHIVE_DIR/ftp_to_standby1_in_progress" ]]; then
#Check for file existance

if [[ -s "$ARCHIVE_DIR/last_sent_to_standby1" ]]; then   cd $ARCHIVE_DIR
  touch ftp_to_standby1_in_progress
  GetMaxAppliedLog | while read LOGNUMBER   do
echo $LOGNUMBER
  for file in *.arc
  do
  if [[ "$file" -ot "seaprd8i_arch$LOGNUMBER.arc" ]]; then   compress $file
  fi
  done
  done
  while read lastlog; do
    for file in *.arc.Z
    do
    if [[ "$lastlog" -ot "$file" ]];then       echo $file > $ARCHIVE_DIR/last_sent_to_standby1.new /usr/bin/ftp -i -n <<FTPEOF
open tiger
user $ORACLE_ACCOUNT $ORACLE_PASSWORD
bin
put $ARCHIVE_DIR/last_sent_to_standby1.new $TRANSFER_DIR/last_sent_to_standby1
put $file $TRANSFER_DIR/$file
bye
FTPEOF
    fi
    done
  done < $ARCHIVE_DIR/last_sent_to_standby1   if [[ -s "$ARCHIVE_DIR/last_sent_to_standby1.new" ]]; then   mv $ARCHIVE_DIR/last_sent_to_standby1.new $ARCHIVE_DIR/last_sent_to_standby1
  fi
rm $ARCHIVE_DIR/ftp_to_standby1_in_progress fi
fi

-----Original Message-----
From: Kenneth Berland [mailto:ken_at_hero.com] Sent: Thursday, September 07, 2000 3:26 PM To: Multiple recipients of list ORACLE-L Subject: RE: creating standby database

Post those scripts! Also: How long does Oracle keep rows in v$archived_log?

On Thu, 7 Sep 2000, Reddy, Gautam wrote:

> Got this reply from one of my  friend who works at  ORACLE Field Support.
> This is the reason why we are not using this feature.
> 
> Sounds like we may want to hold off on using this feature
> (log_archive_dest_2 = "service=name_of_other_host REOPEN=30" ) based on
> this.
> 
> "Be very careful when using these new Oracle8i features.  Actually would
> recommend NOT using them.  This is a very new feature and is not as robust
> as I would like it.  I recommend still manually FTPing the logs to the
> standby (without using the new Oracle8i feature) 
> 
> Go to WebIV and do a bug search on "standby ora-00600"  you will see a
list
> of 30 significant bugs. 
> 
> The big ones are ... If the you fill up the secondary sites archive
> destination it will crash your primary with an ORA-00600 then you must
> recover up to a point in time just before the ORA-00600 occurred. 
> 
> Network failures on mandatory (and sometimes optional) archive
destinations
> can also cause the primary to go down. 
> 
> I see your on NT.  The scripts I have to automatically ftp  and apply
files
> are written in TCL and Expect (both share ware). If they write exect for NT
> and you decide to manually ftp and apply the files, let me know and I will
> e-mail them to you " 
>   
>   
> 
> Thx
> Gautam 
>  
> 
> 
> -----Original Message-----
> Sent: Wednesday, September 06, 2000 3:55 PM
> To: Multiple recipients of list ORACLE-L
> 
> 
> I have:
> log_archive_dest_2 = "service=name_of_other_host REOPEN=30" 
> 
> in my pfile.
> 
> On Wed, 6 Sep 2000, Ashish Shah wrote:
> 
> > Hi All,
> > 
> > I am trying to create standby database on different
> > hosts.
> > 
> > - The database names are same on both hosts
> > - listener/tnsnames files are configured and
> > working
> > - I was able to create standby database
> > but having problem when i try to enable 
> > archive_Dest_2 on primary database.
> > 
> > SVRMGR> alter system set
> > log_archive_dest_2='service=reptest mandatory
> > reopen=60
> > ';
> > Statement processed.
> > 
> > SVRMGR> alter system set log_archive_dest_2 = enable;
> > ORA-02097: parameter cannot be modified because
> > specified value is invalid
> > ORA-16024: parameter LOG_ARCHIVE_DEST_2 cannot be
> > parsed
> > 
> > Any ideas??
> > 
> > When i do tnsping reptest on primary i do get Ok.
> > 
> > TIA.
> > 
> > 
> > 
> > =====
> > Ashish
> > Toronto, Canada
> > 
> > __________________________________________________
> > Do You Yahoo!?
> > Yahoo! Mail - Free email you can access from anywhere!
> > http://mail.yahoo.com/
> > -- 
> > Author: Ashish Shah
> >   INET: ar_shah_at_yahoo.com
> > 
> > Fat City Network Services    -- (858) 538-5051  FAX: (858) 538-5051
> > San Diego, California        -- Public Internet access / Mailing Lists
> > --------------------------------------------------------------------
> > To REMOVE yourself from this mailing list, send an E-Mail message
> > to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in
> > the message BODY, include a line containing: UNSUB ORACLE-L
> > (or the name of mailing list you want to be removed from).  You may
> > also send the HELP command for other information (like subscribing).
> > 
> 
> -- 
> Author: Kenneth Berland
>   INET: ken_at_hero.com
> 
> Fat City Network Services    -- (858) 538-5051  FAX: (858) 538-5051
> San Diego, California        -- Public Internet access / Mailing Lists
> --------------------------------------------------------------------
> To REMOVE yourself from this mailing list, send an E-Mail message
> to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in
> the message BODY, include a line containing: UNSUB ORACLE-L
> (or the name of mailing list you want to be removed from).  You may
> also send the HELP command for other information (like subscribing).
> -- 
> Author: Reddy, Gautam
>   INET: Gautam_Reddy_at_Dell.com
> 
> Fat City Network Services    -- (858) 538-5051  FAX: (858) 538-5051
> San Diego, California        -- Public Internet access / Mailing Lists
> --------------------------------------------------------------------
> To REMOVE yourself from this mailing list, send an E-Mail message
> to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in
> the message BODY, include a line containing: UNSUB ORACLE-L
> (or the name of mailing list you want to be removed from).  You may
> also send the HELP command for other information (like subscribing).
> 

-- 
Author: Kenneth Berland
  INET: ken_at_hero.com

Fat City Network Services    -- (858) 538-5051  FAX: (858) 538-5051
San Diego, California        -- Public Internet access / Mailing Lists
--------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in
Received on Fri Sep 08 2000 - 09:59:58 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US