Skip to Main Content

Database Software

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

RMAN backup strange error

aLuViAnNov 19 2012 — edited Nov 19 2012
Hi,

I'm working on a backup UNIX script for having scheduled backups and obsolete backup cleanups using this script and cron utility.
I'm working on a 11gR2 database standard edition (thats why i take two backups in one script with no parallelism) with RHEL5.4 OS.

The script (up to now) is as follows:

+#!/bin/sh+

+# Start of Configurable Section+

export ORACLE_HOME=/dbapp/oracle/product/11.2.0
export ORACLE_SID=eris0
export BACKUP_MEDIA=DISK
export BACKUP_TYPE=FULL
export MAXPIECESIZE=32G

+# End of Configurable Section+
+# Start of site specific parameters+

export BACKUP_MOUNTPOINT_A=/backup
export BACKUP_MOUNTPOINT_B=/dbdata/backup
export LOG_DIR=/backup/log
export DATE=$(date "%m-%d-%Y")+
+export LOC_A=${BACKUP_MOUNTPOINT_A}/${ORACLE_SID}/$DATE+
+export LOC_B=${BACKUP_MOUNTPOINT_B}/${ORACLE_SID}/$DATE+

+mkdir -p ${BACKUP_MOUNTPOINT_A}/${ORACLE_SID}/$DATE+
+mkdir -p ${BACKUP_MOUNTPOINT_B}/${ORACLE_SID}/$DATE+

+# End of site specific parameters+

export TMPDIR=/tmp
export NLS_DATE_FORMAT="MM/DD/YY HH24:MI:SS"
export TIMESTAMP=`date %T-%m-%d-%Y`+
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/usr/lib:/lib
export LIBPATH=$ORACLE_HOME/lib:/usr/lib:/lib
export SHLIB_PATH=$ORACLE_HOME/lib:/usr/lib:/lib
export LOG=/backup
+LOG=${LOG}/log/${ORACLE_SID}_${BACKUP_TYPE}_${BACKUP_MEDIA}_${TIMESTAMP}.log+
export TMPLOG=/dbdata/backup/tmplog.$$
echo `date` "Starting $BACKUP_TYPE Backup of $ORACLE_SID \
to $BACKUP_MEDIA" > $LOG
+export LOCKFILE=$ORACLE_BASE/${ORACLE_SID}_${BACKUP_TYPE}_${BACKUP_MEDIA}.lock+
+if [ -f $LOCKFILE ]; then+
echo `date` "Script running. Exiting ..." >> $LOG
else
echo "Do NOT delete this file. Used for RMAN locking" > $LOCKFILE
+$ORACLE_HOME/bin/rman log=$TMPLOG <<EOF+
connect target /
CONFIGURE RETENTION POLICY TO RECOVERY WINDOW OF 3 DAYS;
CONFIGURE CONTROLFILE AUTOBACKUP ON;
CONFIGURE BACKUP OPTIMIZATION ON;
CONFIGURE DEFAULT DEVICE TYPE TO disk;

+BACKUP DATABASE PLUS ARCHIVELOG FORMAT '${LOC_A}/${ORACLE_SID}_${BACKUP_TYPE}_${TIMESTAMP}_%p_%s.rman' DELETE INPUT;+

ALLOCATE CHANNEL FOR MAINTENANCE DEVICE TYPE DISK;
CROSSCHECK BACKUP;
DELETE NOPROMPT EXPIRED BACKUP;
DELETE NOPROMPT OBSOLETE DEVICE TYPE DISK;
CROSSCHECK ARCHIVELOG ALL;
DELETE NOPROMPT EXPIRED ARCHIVELOG ALL;

+BACKUP DATABASE PLUS ARCHIVELOG FORMAT '${LOC_B}/${ORACLE_SID}_${BACKUP_TYPE}_${TIMESTAMP}_%p_%s.rman';+
EOF

RC=$?
cat $TMPLOG >> $LOG
rm $LOCKFILE
echo `date` "Script lock file removed" >> $LOG
rm $TMPLOG
fi

When I ran it for the first time and checked the places I've asked rman to put the backups, everything seemed to be fine, untill I checked the logs:

Recovery Manager: Release 11.2.0.1.0 - Production on Mon Nov 19 11:49:20 2012

Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved.

RMAN>
connected to target database: ERIS0 (DBID=1096586066)

RMAN>
using target database control file instead of recovery catalog
old RMAN configuration parameters:
CONFIGURE RETENTION POLICY TO RECOVERY WINDOW OF 3 DAYS;
new RMAN configuration parameters:
CONFIGURE RETENTION POLICY TO RECOVERY WINDOW OF 3 DAYS;
new RMAN configuration parameters are successfully stored

RMAN>
old RMAN configuration parameters:
CONFIGURE CONTROLFILE AUTOBACKUP ON;
new RMAN configuration parameters:
CONFIGURE CONTROLFILE AUTOBACKUP ON;
new RMAN configuration parameters are successfully stored

RMAN>
old RMAN configuration parameters:
CONFIGURE BACKUP OPTIMIZATION ON;
new RMAN configuration parameters:
CONFIGURE BACKUP OPTIMIZATION ON;
new RMAN configuration parameters are successfully stored

RMAN>
old RMAN configuration parameters:
CONFIGURE DEFAULT DEVICE TYPE TO DISK;
new RMAN configuration parameters:
CONFIGURE DEFAULT DEVICE TYPE TO DISK;
new RMAN configuration parameters are successfully stored

RMAN>
RMAN>

Starting backup at 11/19/12 11:49:21
current log archived
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=516 device type=DISK
skipping archived log file /dbapp/oracle/flash_recovery_area/eris0/ERIS0/archivelog/2012_11_19/o1_mf_1_31_8bmt1pt3_.arc; already backed up 1 time(s)
channel ORA_DISK_1: starting archived log backup set
channel ORA_DISK_1: specifying archived log(s) in backup set
input archived log thread=1 sequence=32 RECID=27 STAMP=799760873
input archived log thread=1 sequence=33 RECID=28 STAMP=799760876
input archived log thread=1 sequence=34 RECID=29 STAMP=799760963
channel ORA_DISK_1: starting piece 1 at 11/19/12 11:49:23
channel ORA_DISK_1: finished piece 1 at 11/19/12 11:49:24
piece handle=/backup/eris0/11-19-2012/eris0_FULL_11:49:20-11-19-2012_1_163.rman tag=TAG20121119T114923 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
channel ORA_DISK_1: deleting archived log(s)
archived log file name=/dbapp/oracle/flash_recovery_area/eris0/ERIS0/archivelog/2012_11_19/o1_mf_1_32_8bmtsk0j_.arc RECID=27 STAMP=799760873
archived log file name=/dbapp/oracle/flash_recovery_area/eris0/ERIS0/archivelog/2012_11_19/o1_mf_1_33_8bmtsn0v_.arc RECID=28 STAMP=799760876
archived log file name=/dbapp/oracle/flash_recovery_area/eris0/ERIS0/archivelog/2012_11_19/o1_mf_1_34_8bmtwc29_.arc RECID=29 STAMP=799760963
channel ORA_DISK_1: deleting archived log(s)
archived log file name=/dbapp/oracle/flash_recovery_area/eris0/ERIS0/archivelog/2012_11_19/o1_mf_1_31_8bmt1pt3_.arc RECID=26 STAMP=799760110
Finished backup at 11/19/12 11:49:24

Starting backup at 11/19/12 11:49:24
using channel ORA_DISK_1
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00001 name=/dbdata/eris0/system01.dbf
input datafile file number=00015 name=/erisdata/eri0/reg_data.dbf
input datafile file number=00017 name=/erisdata/eri0/ret_data.dbf
input datafile file number=00013 name=/erisdata/eri0/adm_data.dbf
input datafile file number=00016 name=/erisdata/eri0/reg_index.dbf
input datafile file number=00018 name=/erisdata/eri0/ret_index.dbf
input datafile file number=00027 name=/erisdata/eri0/ppr_data.dbf
input datafile file number=00031 name=/erisdata/eri0/rac_data.dbf
input datafile file number=00037 name=/erisdata/eri0/ten_data.dbf
input datafile file number=00014 name=/erisdata/eri0/adm_index.dbf
channel ORA_DISK_1: starting piece 1 at 11/19/12 11:49:24
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of backup plus archivelog command at 11/19/2012 11:49:25
ORA-19504: failed to create file "/b_54nqmoi4_1_1"
ORA-27041: unable to open file
Linux-x86_64 Error: 2: No such file or directory
Additional information: 9

RMAN>
RMAN>
released channel: ORA_DISK_1
allocated channel: ORA_MAINT_DISK_1
channel ORA_MAINT_DISK_1: SID=516 device type=DISK

RMAN>
crosschecked backup piece: found to be 'AVAILABLE'
backup piece handle=/dbapp/oracle/flash_recovery_area/eris0/ERIS0/autobackup/2012_11_17/o1_mf_s_799604105_8bh1pk2r_.bkp RECID=5 STAMP=799604105

+.... [Some backup checks occur here, they are a looot! so I trimmed them]+

RMAN>
specification does not match any backup in the repository

RMAN>
RMAN retention policy will be applied to the command
RMAN retention policy is set to recovery window of 3 days
no obsolete backups found

RMAN>
specification does not match any archived log in the repository

RMAN>
specification does not match any archived log in the repository

RMAN>
RMAN>

Starting backup at 11/19/12 11:49:26
current log archived
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=644 device type=DISK
channel ORA_DISK_1: starting archived log backup set
channel ORA_DISK_1: specifying archived log(s) in backup set
input archived log thread=1 sequence=35 RECID=30 STAMP=799760969
channel ORA_DISK_1: starting piece 1 at 11/19/12 11:49:29
channel ORA_DISK_1: finished piece 1 at 11/19/12 11:49:30
piece handle=/dbdata/backup/eris0/11-19-2012/eris0_FULL_11:49:20-11-19-2012_1_165.rman tag=TAG20121119T114929 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 11/19/12 11:49:30

Starting backup at 11/19/12 11:49:30
using channel ORA_DISK_1
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00001 name=/dbdata/eris0/system01.dbf
input datafile file number=00015 name=/erisdata/eri0/reg_data.dbf
input datafile file number=00017 name=/erisdata/eri0/ret_data.dbf
input datafile file number=00013 name=/erisdata/eri0/adm_data.dbf
input datafile file number=00016 name=/erisdata/eri0/reg_index.dbf
input datafile file number=00018 name=/erisdata/eri0/ret_index.dbf
input datafile file number=00027 name=/erisdata/eri0/ppr_data.dbf
input datafile file number=00031 name=/erisdata/eri0/rac_data.dbf
input datafile file number=00037 name=/erisdata/eri0/ten_data.dbf
input datafile file number=00014 name=/erisdata/eri0/adm_index.dbf
channel ORA_DISK_1: starting piece 1 at 11/19/12 11:49:30
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of backup plus archivelog command at 11/19/2012 11:49:31
ORA-19504: failed to create file "/b_56nqmoia_1_1"
ORA-27041: unable to open file
Linux-x86_64 Error: 2: No such file or directory
Additional information: 9
RMAN>

Recovery Manager complete.
Mon Nov 19 11:49:31 UCT 2012 Script lock file removed

As you can see, both backups fail on the second part and they fail to create an oracle auto generated file which is under root folder! I've never asked oracle to put anything there, how could that be possible? I am making any mistakes here?

Also, I've checked the permissions on backup locations. They are fine.

Thank you all in advance!

Edited by: aLuViAn on Nov 19, 2012 3:30 AM
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 17 2012
Added on Nov 19 2012
13 comments
1,044 views