Re: Problem with shell script to duplicate a database from active database

From: Sayan Malakshinov <xt.and.r_at_gmail.com>
Date: Fri, 24 Jul 2020 01:23:56 +0300
Message-ID: <CAOVevU5yYayYooPgp8NrdWRSgAWLX6VttiGpMfSW5bo=MCQPGw_at_mail.gmail.com>



Hi Sandra,

Shouldn't "<EOF> >> $LOG_FILE" be "<EOF >> $LOG_FILE", ie without extra > after EOF?

пт, 24 июл. 2020 г., 1:17 Sandra Becker <sbecker6925_at_gmail.com>:

> I need to create standby databases for several of our existing databases.
> We did this last year for another database and I copied that lshell script,
> but it's throwing an error and I can't seem to figure out what is wrong
> with it. This is a RHEL6 OS with Oracle 12.1.0.2. It tells me there is an
> error on the line "rman target..." It doesn't like the ">>". These are
> large databases and my session would time out long before the script
> completed, so I need a shell script I can run with nohup. I would
> appreciate any help you can provide.
>
> Error:
> line 11: syntax error near unexpected token `>>'
> line 11:`rman target sys/pwd01_at_COMP2 auxiliary sys/pwd01_at_UCOMP_DB1 <EOF>
> >> $LOG_FILE'
>
> Script:
>
> #!/bin/bash
> #set -x
> . /home/orcl/db_stdby_db1.ksh
>
> ts=`date +'%Y%m%d%H%M'`
> LOG_FILE='/LOGS/COMP/dumps/build_standby_COMP_DB1.log_'${ts}
> HOSTNAME=`hostname`
> STARTTIME=`date -u '+%Y_%m_%d.%H%M%S'`
> echo $STARTTIME > $LOG_FILE
>
> rman target sys/pwd01_at_COMP2 auxiliary sys/pwd01_at_COMP_DB1 <EOF> >>
> $LOG_FILE
> run {
> allocate channel t1 type disk;
> allocate channel t2 type disk;
> allocate channel t3 type disk;
> allocate channel t4 type disk;
> allocate auxiliary channel a1 type disk;
> allocate auxiliary channel a2 type disk;
> allocate auxiliary channel a3 type disk;
> allocate auxiliary channel a4 type disk;
> duplicate target database for standby from active database
> nofilenamecheck
> dorecover;
>
> release channel t1;
> release channel t2;
> release channel t3;
> release channel t4;
> release channel a1;
> release channel a2;
> release channel a3;
> release channel a4;
> }
> EOF
> exit
>
> -
> Sandy B.
>
>

--
http://www.freelists.org/webpage/oracle-l
Received on Fri Jul 24 2020 - 00:23:56 CEST

Original text of this message