Restore to a different node with RMAN and EMC Networker
rysalkaFeb 27 2009 — edited Mar 1 2009Please, really need help :)
I took hotbackup using RMAN catalog which went to tape. Here is the script for that:
connect target sys/****@PROD;*
connect rcvcat rman/***@catalog;*
*run {*
allocate channel t1 type 'SBT_TAPE';
send 'NSR_ENV=(NSR_SERVER="**",NSR_DATA_VOLUME_POOL=Oracle)';*
*backup database plus archivelog;*
*release channel t1;*
*}*
My settings include control file autobackup as follows:
*RMAN> show all;*
*RMAN configuration parameters are:*
*CONFIGURE RETENTION POLICY TO RECOVERY WINDOW OF 10 DAYS;*
*CONFIGURE BACKUP OPTIMIZATION OFF; # default*
*CONFIGURE DEFAULT DEVICE TYPE TO DISK;*
*CONFIGURE CONTROLFILE AUTOBACKUP ON;*
*CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE 'SBT_TAPE' TO '/NMO_%F/';*
*CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '%F'; # default*
*CONFIGURE DEVICE TYPE DISK PARALLELISM 1 BACKUP TYPE TO BACKUPSET; # default*
*CONFIGURE DATAFILE BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default*
*CONFIGURE ARCHIVELOG BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default*
*CONFIGURE CHANNEL DEVICE TYPE DISK FORMAT '/data/backups/PROD/ora_df%t_s%s_s%p';*
*CONFIGURE MAXSETSIZE TO UNLIMITED; # default*
*CONFIGURE ENCRYPTION FOR DATABASE OFF; # default*
*CONFIGURE ENCRYPTION ALGORITHM 'AES128'; # default*
*CONFIGURE ARCHIVELOG DELETION POLICY TO NONE; # default*
*CONFIGURE SNAPSHOT CONTROLFILE NAME TO '/data/backups/PROD/hotbkp/snapcf_PROD.f';*
I am trying to restore this backup that is on tape (EMC Networker) to a different node. I can do this outside of Networker without any problems. However, when I try to get the backup from tape I have this issue:
1. initPROD.ora is created and modified accordingly on a new server
2. Export sid, startup nomount on new server
export ORACLE_SID=PROD (on this new server)
*rman target /*
*startup nomount*
3. I then run the following and get this error:
*RMAN> run {*
*2> allocate channel t1 type 'SBT_TAPE'*
*3> send 'NSR_ENV=(NSR_SERVER="***",NSR_CLIENT="********")';*
*4> restore controlfile from autobackup;*
*5> sql 'alter database mount';*
*6> sql 'alter database rename file "/data/dbf/PROD/redo01.log" to "/data/scratch/dbf/PROD/redo01.log"';*
*7> sql 'alter database rename file "/data/dbf/PROD/redo02.log to "/data/scratch/dbf/PROD/redo02.log"';*
*8> sql 'alter database rename file "/data/dbf/PROD/redo03.log to "/data/scratch/dbf/PROD/redo03.log"';*
*9> set until sequence 22; (I get this from archive logs)*
*10> set newname for datafile 1 to '/data/scratch/dbf/PROD/system01.dbf';*
*11> set newname for datafile 2 to '/data/scratch/dbf/PROD/undotbs01.dbf';*
*12> set newname for datafile 3 to '/data/scratch/dbf/PROD/sysaux01.dbf';*
*13> set newname for datafile 4 to '/data/scratch/dbf/PROD/users01.dbf';*
*14> restore database;*
*15> switch datafile all;*
*16> recover database;*
*17> alter database open resetlogs;*
*18> }*
*allocated channel: t1*
*channel t1: sid=149 devtype=SBT_TAPE*
*channel t1: NMO v4.5.0.0*
*Starting restore at 27-FEB-09*
*released channel: t1*
*RMAN-00571: ===========================================================*
*RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============*
*RMAN-00571: ===========================================================*
*RMAN-03002: failure of restore command at 02/27/2009 22:10:43*
*RMAN-06495: must explicitly specify DBID with SET DBID command*
I cannot seem to pass this error. This error indicates that the db has to be either mounted or DBID set before the restore of teh controlfile. Mounting db before the restore of the controlfile does not work. Setting db id 1) does not make sense because if the primary db is down then I cannot get it, right? My primary is up now, so I was able to get db id, but setting it made the restore hang with the following:
*RMAN> run {*
*connect target*
*set dbid=466048808*
*2> allocate channel t1 type 'SBT_TAPE'*
*3> send 'NSR_ENV=(NSR_SERVER="***",NSR_CLIENT="********")';*
*4> restore controlfile from autobackup;*
*5> sql 'alter database mount';*
*6> sql 'alter database rename file "/data/dbf/PROD/redo01.log" to "/data/scratch/dbf/PROD/redo01.log"';*
*7> sql 'alter database rename file "/data/dbf/PROD/redo02.log to "/data/scratch/dbf/PROD/redo02.log"';*
*8> sql 'alter database rename file "/data/dbf/PROD/redo03.log to "/data/scratch/dbf/PROD/redo03.log"';*
*9> set until sequence 22; (I get this from archive logs)*
*10> set newname for datafile 1 to '/data/scratch/dbf/PROD/system01.dbf';*
*11> set newname for datafile 2 to '/data/scratch/dbf/PROD/undotbs01.dbf';*
*12> set newname for datafile 3 to '/data/scratch/dbf/PROD/sysaux01.dbf';*
*13> set newname for datafile 4 to '/data/scratch/dbf/PROD/users01.dbf';*
*14> restore database;*
*15> switch datafile all;*
*16> recover database;*
*17> alter database open resetlogs;*
*18> }*
*connected to target database: PROD (not mounted)*
*executing command: SET DBID*
*using target database control file instead of recovery catalog*
*allocated channel: t1*
*channel t1: sid=152 devtype=SBT_TAPE*
*channel t1: NMO v4.5.0.0*
*Starting restore at 27-FEB-09*
*channel t1: looking for autobackup on day: 20090227*
*channel t1: looking for autobackup on day: 20090226*
*channel t1: looking for autobackup on day: 20090225*
It looks like it cannot find the autbackup of controlfile? But when I list backup while connected to the target db and rman catalog, I see that autobackup is included in every hot backup that we do:
*BS Key Type LV Size Device Type Elapsed Time Completion Time*
*4639 Full 7.00M SBT_TAPE 00:00:04 27-FEB-09*
*BP Key: 4641 Status: AVAILABLE Compressed: NO Tag: TAG20090227T150141*
*Handle: /NMO_c-466048808-20090227-01/ Media:*
*Control File Included: Ckp SCN: 23352682865 Ckp time: 27-FEB-09*
*SPFILE Included: Modification time: 26-FEB-09*
I am stuck What I am doing wrong? Thank you!
Edited by: rysalka on Feb 28, 2009 8:35 AM