Hi David,
You need to put your rman commands between <<EOF and EOF. The OS doesn’t know
commands like “SPOOL” and “RUN{“, because they are rman commands.
rman target sys/<password>@orcl catalog rman/<password>@rcat auxiliary
sys/<password>@PRDREP1<<EOF
spool log to '/home/oracle/scripts/restore/orcl_dup_to_prdrep.log';
run {
allocate auxiliary channel c1 type 'SBT_TAPE' parms
'SBT_LIBRARY=/u01/app/oracle/product/12.1.0/dbhome_1/lib/libopc.so,ENV=(OPC_PFILE=/u01/app/oracle/product/12.1.0/dbhome_1/dbs/opcorc
l.ora)';}
run{
release auxiliary channel c1;
}
EOF
Obs.: Try startup nomount your auxiliary before issue the shell script.
All the best,
Rodrigo Mufalani - Diretor Técnico |
rodrigo@xxxxxxxxxxxxxxx<mailto:rodrigo@xxxxxxxxxxxxxxx> | +55 21 988 994 817
Mufalani - +55 21 3193 0326 | Rua Alm Grenfall, 405, Bl 3, Sl 310, Centro
Empresarial
Washington Luiz, Duque de Caxias, RJ | CEP 25085-009 |
www.mufalani.com.br<mailto:rodrigo@xxxxxxxxxxxxxxx>
[id:image001.png@01D2CE51.4968E650]<http://www.mufalani.com.br/>[id:image002.png@01D2CE51.4968E650]
De: <oracle-l-bounce@xxxxxxxxxxxxx> em nome de David Barbour
<david.barbour1@xxxxxxxxx>
Responder para: "david.barbour1@xxxxxxxxx" <david.barbour1@xxxxxxxxx>
Data: sexta-feira, 26 de maio de 2017 12:38
Para: oracle-l mailing list <oracle-l@xxxxxxxxxxxxx>
Assunto: RMAN Shell Script Failing
Oracle EE 12.1.0.2 - 2 Node RAC
RHEL 6.8
We are backing up our on-premise stuff to the Oracle Cloud. That works. But
when we try a duplicate database we're getting an error. Just trying at this
point to get a simple RMAN comand to work. Here's the script:
orcl1@node1:/home/oracle/scripts/restore $ cat rman_dup.sh
#! /bin/sh
set echo on
export ORACLE_SID=PRDREP1
export ORACLE_HOME=/u01/app/oracle/product/12.1.0/dbhome_2
export ORACLE_BASE=/u01/app/oracle
rman target sys/<password>@orcl catalog rman/<password>@rcat auxiliary
sys/<password>@PRDREP1
spool log to '/home/oracle/scripts/restore/orcl_dup_to_prdrep.log';
run {
allocate auxiliary channel c1 type 'SBT_TAPE' parms
'SBT_LIBRARY=/u01/app/oracle/product/12.1.0/dbhome_1/lib/libopc.so,ENV=(OPC_PFILE=/u01/app/oracle/product/12.1.0/dbhome_1/dbs/opcorc
l.ora)';}
run{
release auxiliary channel c1;
}
exit;
And the nohup output:
Recovery Manager: Release 12.1.0.2.0 - Production on Fri May 26 10:32:34 2017
Copyright (c) 1982, 2014, Oracle and/or its affiliates. All rights reserved.
connected to target database: ORCL (DBID=1408841846)
connected to recovery catalog database
connected to auxiliary database: PRDREP (not mounted)
RMAN>
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-00558: error encountered while parsing input commands
RMAN-01006: error signaled during parse
RMAN-00565: unable to read input file
LFI-00005: Free some memory failed in lfibrdl().
LFI-01005: Unable to fill buffer.
LFI-00004: Call to lfibgl() failed.
Recovery Manager complete.
./rman_dup.sh: line 12: spool: command not found
./rman_dup.sh: line 15: run: command not found
./rman_dup.sh: line 16: syntax error near unexpected token `}'
./rman_dup.sh: line 16: `allocate auxiliary channel c1 type 'SBT_TAPE' parms
'SBT_LIBRARY=/u01/app/oracle/product/12.1.0/dbhome_1/lib/libopc.so,ENV=(OPC_PFILE=/u01/app/oracle/product/12.1.0/dbhome_1/dbs/opcorc
l.ora)';}'
We are not using acfs or any clustered file systems. There is plenty of memory.