I want to delete archivelog files that has been archived and applied from primary database
to standby database. This piece of script is working in Linux server. However, I copy it to
Unix server with tiny modification. It won't work and generate the error message. I have checked
code carefullt and cannot find where is the problem. I post script here to seek advice.
- Following is the part of script
#!/bin/sh
ORACLE_HOME=$ORACLE_HOME
export ORACLE_HOME
ORACLE_SID=$ORACLE_SID
export ORACLE_SID
PATH=$PATH:$ORACLE_HOME/bin
export PATH
RMAN=$ORACLE_HOME/bin/rman
export MAXLOGSEQ=`sqlplus -s << EOF
/as sysdba
@/oracle10/scripts/rman/check_maxseq.sql ---- this sql script to egt maximun archivelog sequence number.
EOF`
echo $MAXLOGSEQ
TARGET_CONNECT_STR="catalog rman/$RMAN_PW@catalog_db target /"
CMD_STR="
$RMAN $TARGET_CONNECT_STR << EOF
RUN {
ALLOCATE CHANNEL ch00 TYPE 'SBT_TAPE';
DELETE NOPROMPT ARCHIVELOG UNTIL SEQUENCE ${MAXLOGSEQ} ;
}
EOF
"
# Initiate the command string
if [ "$CUSER" = "root" ]
then
su - $ORACLE_USER -c "$CMD_STR" >> $RMAN_LOG_FILE
RSTAT=$?
else
/bin/sh -c "$CMD_STR" >> $RMAN_LOG_FILE
RSTAT=$?
fi
- This is error message. Please advise which part of syntax is wrong because the same script
has been run on Linux for a long time.
Recovery Manager: Release 10.2.0.4.0 - Production on Mon Aug 1 14:08:55 2011
Copyright (c) 1982, 2007, Oracle. All rights reserved.
connected to target database: EXPRD (DBID=4037707233, not open) connected to recovery catalog database
RMAN> 2> 3> 4>
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-00558: error encountered while parsing input commands
RMAN-01009: syntax error: found ";": expecting one of: "integer"RMAN-01007: at line 4 column 43 file: standard input
RMAN>
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-00558: error encountered while parsing input commands
RMAN-01009: syntax error: found "identifier": expecting one of: ";"RMAN-01008: the bad identifier was: ch00
RMAN-01007: at line 1 column 17 file: standard input
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-00558: error encountered while parsing input commands
RMAN-01009: syntax error: found ";": expecting one of: "allocate, alter, backup, beginline, blockrecover, catalog,
change, connect, copy, convert, create, crosscheck, configure, duplicate, debug, delete, drop, exit, endinline,
flashback, host, {, library, list, mount, open, print, quit, recover, register, release, replace, report, renormalize,
reset, restore, resync, rman, run, rpctest, set, setlimit, sql, switch, spool, startup, shutdown, send, show, test, transport, upgrade, unregister, validate"
RMAN-01007: at line 1 column 21 file: standard input
RMAN>
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-00558: error encountered while parsing input commands
RMAN-01009: syntax error: found "}": expecting one of: "allocate, alter, backup, beginline, blockrecover, catalog, change,
connect, copy, convert, create, crosscheck, configure, duplicate, debug, delete, drop, exit, endinline, flashback, host,
{, library, list, mount, open, print, quit, recover, register, release, replace, report, renormalize, reset, restore, resync,
rman, run, rpctest, set, setlimit, sql, switch, spool, startup, shutdown, send, show, test, transport, upgrade, unregister, validate"
RMAN-01007: at line 1 column 1 file: standard input
RMAN>
Recovery Manager complete.