mardi 17 mars 2015

RMAN: backup fails ANU2503E "Backup object already exists on TSM (Doc ID 443900.1)

Problem:


Sending backups to SBT fails with the follwoing error :


RMAN-03009: failure of backup command on ORA_SBT_TAPE_1 channel at 02/19/2015 10:35:07
ORA-19506: failed to create sequential file, name="igpu49hm_1_2", parms=""
ORA-27028: skgfqcre: sbtbackup returned error
ORA-19511: Error received from media manager layer, error text:
ANU2503E Backup object '/adsmorc//igpu49hm_1_2' already exists on TSM Server.
ORA-19600: input file is backup piece (+DGFRA/my_db/backupset/2015_01_31/annnf0_arch_id0_20150131_1807_0.3915.870458935)
ORA-19601: output file is backup piece (igpu49hm_1_2)

 Investigation:


 Based on the metalink note Doc ID 443900.1 :
 The basic problem is that when perform a backup using a disk channel, which does not use TDPO at all.Then allocate a channel with "sbt_tape" and perform a backup of the 'backup recovery area'. The problem is that the name of the backup piece when going to tape will take the same name as the backup piece already on disk.

In this case, this attempted to backup the same backup piece using TDPO twice. This caused the second backup attempt to fail, since this already had an image with the same name.

Since, TDPO does not choose the image name, but rather it's determined and passed by rman. TDPO will not allow duplicate backup images to be created to prevent overwriting an existing backup.

VERITAS is unwavering on allowing a backup_id within the catalog to be overwritten or reused. It will NOT happen. 



Solution:

Use the %t backup format option , so that the TDPO backup_id that is generated is unique for each copy.
so :

 run {
 allocate channel oem_disk_backup device type disk;
 recover copy of database with tag 'ORA$OEM_LEVEL_0';
 backup incremental level 1 cumulative copies=1 for recover of copy with tag 'ORA$OEM_LEVEL_0' database;
 release channel oem_disk_backup;
 allocate channel oem_sbt_backup1 type 'SBT_TAPE' format '"MY_FORMAT"_%d_d%s_p%p_%U_%t.bkp' maxpiecesize 100G parms='ENV=(TDPO_OPTFILE=/usr/tivoli/tsm/client/oracle/bin64/tdpo.opt)';
 backup archivelog all not backed up;
 backup recovery area;
 backup backupset all not backed up since time 'SYSDATE-1';
 }
RUN


Or just to send some backupieces :

{

CONFIGURE CONTROLFILE AUTOBACKUP OFF;

BACKUP DEVICE type SBT backupset 19941,19942,19943,19944,19945,19946,19947,19948,19949,19950,19951,19952,19953,19954,19955,19956,19957,19958,19959,19960,19961,19962,
 19963,19964,19965,19966,19967,19968,19969,19970,19971,19972,19973,19974,19975,19976,19977,19978,19979,19980,19981,19982,19983,19984,19985,19986,19987,19988,19989
format="MY_FORMAT_%U" ;

}

RMAN : ORA-00245: control file backup operation failed

Problem

The RMAN backup of a database in RAC environnement fails with the error: ORA-00245: control file backup operation failed.
 

Solution

What is a snapshot controlfile  ?
A snapshot controlfile is a read consistent copy of a database controlfile which RMAN creates because the controlfile is changed constantly.

The snapshot controlfile must be on a location shared by all RAC nodes in a cluster (it must be accessable by all nodes on which instances for an RAC database can run).
 
 

RMAN> show all;

CONFIGURE SNAPSHOT CONTROLFILE NAME TO '/apps/oracle/11202/rdb/rac/dbs/snapcf_MY_DB.f'; # default
 
 

1 . Find a shared location

for example : +DGDATA/MY_DB/CONTROLFILE/
 
2. Change the location
RMAN> CONFIGURE SNAPSHOT CONTROLFILE NAME TO '+DGDATA/MY_DB/CONTROLFILE/snapcf_MY_DB.f';

RMAN : ORA-01210: data file header is media corrupt

Problem:


Following a restore of a cold backup, we can not open the database (resetlogs) because of the error :
ORA-01210: data file header is media corrupt


ORA-01110: data file 50: '/apps/oracledata/MY_DB/indx0001/arc_event_index_069.dbf'
ORA-01122: database file 50 failed verification check
ORA-01110: data file 50:
'/apps/oracledata/MY_DB/indx0001/arc_event_index_069.dbf'
ORA-01210: data file header is media corrupt




 
 
 

Solution :

 1. Transform the database to archivelog mode to avoid


ORA-01145: offline immediate disallowed unless media recovery enabled

2. Put the datafile in offline mode



SQL> alter database datafile '/apps/oracledata/MY_DB/indx0001/arc_event_index_069.dbf' offline;

Database altered.

 


3. Move the datafile ..


SQL> !mv /apps/oracledata/ARC1EUP0/indx0001/arc_event_index_069.dbf /apps/oracledata/ARC1EUP0/indx0001/arc_event_index_069.dbf.old

 

 

4. Restore the datafile


RMAN> restore datafile 50;
Starting restore at 13-MAR-15
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=82 device type=DISK
allocated channel: ORA_DISK_2
channel ORA_DISK_2: SID=102 device type=DISK
allocated channel: ORA_DISK_3
channel ORA_DISK_3: SID=122 device type=DISK
allocated channel: ORA_DISK_4
channel ORA_DISK_4: SID=142 device type=DISK
channel ORA_DISK_1: starting datafile backup set restore
channel ORA_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_DISK_1: restoring datafile 00050 to /apps/oracledata/ARC1EUP0/indx0001/arc_event_index_069.dbf
channel ORA_DISK_1: reading from backup piece /apps/orafra/MY_DB/backupset/2015_02_20/o1_mf_nnnd0_COLD_I0_20150220_181_bggxzomh_.bkp
channel ORA_DISK_1: piece handle=/apps/orafra/MY_DB/backupset/2015_02_20/o1_mf_nnnd0_COLD_I0_20150220_181_bggxzomh_.bkp tag=COLD_I0_20150220_181
channel ORA_DISK_1: restored backup piece 1
channel ORA_DISK_1: reading from backup piece /apps/orafra/MY_DB/backupset/2015_02_20/o1_mf_nnnd0_COLD_I0_20150220_181_bggyof1t_.bkp
channel ORA_DISK_1: piece handle=/apps/orafra/MY_DB/backupset/2015_02_20/o1_mf_nnnd0_COLD_I0_20150220_181_bggyof1t_.bkp tag=COLD_I0_20150220_181
channel ORA_DISK_1: restored backup piece 2
channel ORA_DISK_1: restore complete, elapsed time: 00:19:50
Finished restore at 13-MAR-15

 

 

 


5. Open the database


SQL> alter database open resetlogs;

Database altered.