Video Screencast Help
Protect Your POS Environment Against Retail Data Breaches. Learn More.

Restore SAP Backups using RMAN

Created: 08 Mar 2011 • Updated: 14 Mar 2011 | 9 comments
PQuicken's picture
This issue has been solved. See solution.

Hi

 

we are trying to do a desaster recovery test for SAP on Oracle. After having done successful backups the sap admin tries to recover the oracle database based on the backups we did with the brtools. When you to a list backup of database we get the correct output. When we try to do a validate or a restore command based on the tags, backup sets or timestamps we get the following issue:

BS Key  Type LV Size       Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
581     Full    57.06G     SBT_TAPE    00:14:26     08-MAR-11
        BP Key: 581   Status: AVAILABLE  Compressed: NO  Tag: BEFJWXKQ
        Handle: MI1001_befjwxkq.700_1   Media:
  List of Datafiles in backup set 581
  File LV Type Ckp SCN    Ckp Time  Name
  ---- -- ---- ---------- --------- ----
  1       Full 153016816  08-MAR-11 /oracle/db/MI1/sapdata5/system_1/system.data1
  2       Full 153016816  08-MAR-11 /oracle/db/MI1/sapdata6/undo_1/undo.data1
  4       Full 153016816  08-MAR-11 /oracle/db/MI1/sapdata1/sr3_1/sr3.data1
  6       Full 153016816  08-MAR-11 /oracle/db/MI1/sapdata3/sr3_3/sr3.data3
  8       Full 153016816  08-MAR-11 /oracle/db/MI1/sapdata1/sr3700_1/sr3700.data1
  10      Full 153016816  08-MAR-11 /oracle/db/MI1/sapdata3/sr3700_3/sr3700.data3
 

 

RMAN> validate backupset 581;

using channel ORA_SBT_TAPE_1
using channel ORA_DISK_1
channel ORA_SBT_TAPE_1: starting validation of datafile backupset
channel ORA_SBT_TAPE_1: reading from backup piece MI1001_befjwxkq.700_1
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03009: failure of validate command on ORA_SBT_TAPE_1 channel at 03/08/2011 22:11:40
ORA-19870: error reading backup piece MI1001_befjwxkq.700_1
ORA-19507: failed to retrieve sequential file, handle="MI1001_befjwxkq.700_1", parms=""
ORA-27029: skgfrtrv: sbtrestore returned error
ORA-19511: Error received from media manager layer, error text:
   Backup file <MI1001_befjwxkq.700_1> not found in NetBackup catalog

 

 

 

During the rman restore of the SAP backup:

RMAN> run {
2> allocate channel t1 type 'SBT_TAPE';
3> allocate channel t2 type 'SBT_TAPE';
4> send 'NB_ORA_POLICY=SAP_MI1_ORACLE, NB_ORA_SERV=przlnbm001';
5> restore database from tag 'BEFITXUP';
6> }

 

allocated channel: t1
channel t1: sid=2492 instance=MI1001 devtype=SBT_TAPE
channel t1: Veritas NetBackup for Oracle - Release 7.0 (2010010419)

 

allocated channel: t2
channel t2: sid=2491 instance=MI1001 devtype=SBT_TAPE
channel t2: Veritas NetBackup for Oracle - Release 7.0 (2010010419)

 

sent command to channel: t1
sent command to channel: t2

 

Starting restore at 02-MAR-11

 

channel t1: starting datafile backupset restore
channel t1: specifying datafile(s) to restore from backup set
restoring datafile 00001 to /oracle/db/MI1/sapdata5/system_1/system.data1
restoring datafile 00002 to /oracle/db/MI1/sapdata6/undo_1/undo.data1
restoring datafile 00004 to /oracle/db/MI1/sapdata1/sr3_1/sr3.data1
restoring datafile 00006 to /oracle/db/MI1/sapdata3/sr3_3/sr3.data3
restoring datafile 00008 to /oracle/db/MI1/sapdata1/sr3700_1/sr3700.data1
restoring datafile 00010 to /oracle/db/MI1/sapdata3/sr3700_3/sr3700.data3
channel t1: reading from backup piece MI1001_befitxup.604_1
channel t2: starting datafile backupset restore
channel t2: specifying datafile(s) to restore from backup set
restoring datafile 00003 to /oracle/db/MI1/sapdata5/sysaux_1/sysaux.data1
restoring datafile 00005 to /oracle/db/MI1/sapdata2/sr3_2/sr3.data2
restoring datafile 00007 to /oracle/db/MI1/sapdata4/sr3_4/sr3.data4
restoring datafile 00009 to /oracle/db/MI1/sapdata2/sr3700_2/sr3700.data2
restoring datafile 00011 to /oracle/db/MI1/sapdata4/sr3700_4/sr3700.data4
restoring datafile 00012 to /oracle/db/MI1/sapdata5/sr3usr_1/sr3usr.data1
restoring datafile 00013 to /oracle/db/MI1/sapdata6/undo_2/undo_2.data
channel t2: reading from backup piece MI1001_befitxup.605_1
ORA-19870: error reading backup piece MI1001_befitxup.604_1
ORA-19507: failed to retrieve sequential file, handle="MI1001_befitxup.604_1", parms=""
ORA-27029: skgfrtrv: sbtrestore returned error
ORA-19511: Error received from media manager layer, error text:
   Backup file <MI1001_befitxup.604_1> not found in NetBackup catalog
ORA-19870: error reading backup piece MI1001_befitxup.605_1
ORA-19507: failed to retrieve sequential file, handle="MI1001_befitxup.605_1", parms=""
ORA-27029: skgfrtrv: sbtrestore returned error
ORA-19511: Error received from media manager layer, error text:
   Backup file <MI1001_befitxup.605_1> not found in NetBackup catalog
failover to previous backup

 

 

Any idea

 

Thanks

 

Peter

Comments 9 CommentsJump to latest comment

Will Restore's picture

Did you follow the steps in the Admin Guide for redirected restore?

Will Restore -- where there is a Will there is a way

PQuicken's picture

It is the same client. I implemeted the No.Restrictions file

 

Peter

PQuicken's picture

So just to be clear. It is the same client. It was backuped with a SAP Policy. Now the SAP DBA wants to do a restore of the Oracle DB just using RMAN.

Nicolai's picture

There is a difference in policy type using Oracle RMAN or SAP RMAN. Oracle is using type 4 and SAP uses type 17. Make sure you use SAP brtools or RMAN, but don't mix them. If you do a bpimagelist of the object in question field 8 of the IMAGE line will show you the recorded client type.

http://www.symantec.com/docs/TECH5584

Update:

Also set the Netbackup variables when restoring using brtools:

setenv NB_ORA_SAP=dummy   (force client type 17)
setenv SAP_CLIENT={client}
setenv NB_ORA_CLIENT={client}

 init{SID}.sap   
    backup_dev_type = rman_util
    rman_filesperset = 64
    rman_parms = "BLKSIZE=65536 ENV=(NB_ORA_SAP=dummy, SAP_CLIENT={client}, NB_ORA_CLIENT={client})"
    util_par_file = init{SID}.utl

Assumption is the mother of all mess ups.

If this post answered your'e qustion -  Please mark as a soloution.

SOLUTION
PQuicken's picture

I am pretty much aware of this fact and that Netbackup cross checks the client type and the handle it recieves for RMAN requesting a restore of a backup that is actually done for a SAP application. The customer argues that the backup via the backint interface in conjunction with RMAN results in the same data as if you would pull the data directly via RMAN. The question is if there is a way to prevent the Netbackup master server from doing the cross check of the client type and the handle it recieves from RMAN in case I do a validate or a restore request out of RMAN to do a restore of a backup image that was pulled for SAP.

 

Thanks

 

Peter

Nicolai's picture

You get some of the benefit Oracle RMAN provide when using SAP RMAN. But there are some rather large differences, when it comes to handling control files and recover catalog.

If you made the backup with SAP brtool, restore with brrecover. Did you use Oracle RMAN then stick to RMAN.

Just to pull a example:

If you do a backup using SAP RMAN, the data files will be backed up with RMAN, but registered with type 17 (SAP). Control files are however handled with backint (type 17) and not RMAN. When restoring everything with "pure RMAN", restore of control files will fail miserable as they where backed up outside of RMAN control.

Assumption is the mother of all mess ups.

If this post answered your'e qustion -  Please mark as a soloution.

Will Restore's picture

Rather than try unproven shortcut, it's better to follow prescribed process in the SAP Admin Guide.  If you use SAP to backup then use SAP to restore.  If you use RMAN to backup then use RMAN to restore.

Will Restore -- where there is a Will there is a way

PQuicken's picture

Hi all,

 

thanks for the imput. The NB_ORA_SAP did the trick and is supported according to Symantec support.

 

 

run {

allocate ch00 type 'sbt_tape' PARMS 'ENV=(NB_ORA_SAP=</path to the init<sid>.utl>, NB_ORA_CLIENT=<source client used in sap policy>'; restore database; recover database; release channel ch00; }

 

If this is successful run

alter database open resetlogs

to open the database.

 

Peter

Nicolai's picture

The variable must just be set to somthing, NB_ORA_SAP=bob, NB_ORA_SAP=1 will both work :-)

Thanks for marking as a soloution.

Assumption is the mother of all mess ups.

If this post answered your'e qustion -  Please mark as a soloution.