RE: Rman - created file already exists

  • From: "Pal, Raj" <Raj.Pal@xxxxxxxxxxxx>
  • To: <peter.schauss@xxxxxxx>, <oracle-l@xxxxxxxxxxxxx>
  • Date: Tue, 8 May 2007 10:01:26 -0600

Try using %t in your format to get a unique identifier
(eg. "/ora10/oradata/orabkup/peregrine/hot_copies/peregrine_%t.rbk").

%p only gives you the piece number. %t is an RMAN time stamp.

--------------------------------------------------- 
Raj Pal

-----Original Message-----
From: oracle-l-bounce@xxxxxxxxxxxxx
[mailto:oracle-l-bounce@xxxxxxxxxxxxx] On Behalf Of Schauss, Peter
Sent: Tuesday, May 08, 2007 9:45 AM
To: oracle-l@xxxxxxxxxxxxx
Subject: Rman - created file already exists

I have an rman script which have been using on 8.1.7.4 for several
years, but when I run it on 10.2.0.2.0 I get the following error message
for each channel:

RMAN-03009: failure of backup command on ch1 channel at 05/08/2007
09:32:03
ORA-19504: failed to create file
"/ora10/oradata/orabkup/peregrine/hot_copies/peregrine_070508093147_1.rb
k"
ORA-27038: created file already exists

My script is shown below.  I have played around with the format such as
adding a %p after the channel number in the file name, but I still get
the same error.  Any suggestions?

Thanks,
Peter Schauss

========================================================================
======

#!/bin/ksh
#
#  rman_bkup.ksh
#
#  Backup a database using rman
#
echo " "
echo " * set Oracle environment variables  "
export PATH=${PATH}:/usr/local/bin
export ORACLE_BASE=/opt/oracle
export ORACLE_HOME=/opt/oracle/product/10.2.0/db_1
export BACKUP_DIR=/ora10/oradata/orabkup/$1/hot_copies
export BACKUP_DIR2=/ora10/oradata/orabkup/$1/hot_copies
export PATH=$PATH:$ORACLE_HOME/bin
export ORACLE_SID=$1

echo " "


signon=`cat $ORACLE_BASE/maint/dba.ctl/dba.$1`
#
BASE_NAME=`date +$1_%y%m%d%H%M%S`
#
rman  target $signon nocatalog <<EOF
run {
allocate channel ch1 type disk format '$BACKUP_DIR/${BASE_NAME}_1.rbk';
allocate channel ch2 type disk format '$BACKUP_DIR/${BASE_NAME}_2.rbk';
allocate channel ch3 type disk format '$BACKUP_DIR/${BASE_NAME}_3.rbk';
allocate channel ch4 type disk format '$BACKUP_DIR/${BASE_NAME}_4.rbk';
allocate channel ch5 type disk format '$BACKUP_DIR/${BASE_NAME}_5.rbk';
allocate channel ch6 type disk format '$BACKUP_DIR/${BASE_NAME}_6.rbk';
backup database;
sql 'ALTER SYSTEM ARCHIVE LOG CURRENT';
}
exit
EOF
#
#  Backup the control file which now contains a record
#  of this backup.
#
sqlplus $signon <<EOF
alter database backup controlfile to
'$BACKUP_DIR/${BASE_NAME}_control.bak';
exit
EOF
#
--
//www.freelists.org/webpage/oracle-l


--
//www.freelists.org/webpage/oracle-l


Other related posts: