Home » RDBMS Server » Backup & Recovery » restoring database to different box
restoring database to different box [message #258918] Mon, 13 August 2007 15:24 Go to next message
DriveShaft
Messages: 20
Registered: August 2007
Junior Member
Prod box us HPUX, Dev box is Linux RHEL 3. I am trying to use my backups to restore the production database over to the development box.

I am using rman (script in cron) to do my backups. Here is what the rman script looks like.

connect target

run {
allocate channel orabkup type disk format '/oracle10g/backups/%d/b_%u_%s_%p';
backup (database include current controlfile);
backup (archivelog all delete input);
}

report obsolete;
delete noprompt obsolete;


Here is RMAN configuration parameters on the Prod Box.

using target database control file instead of recovery catalog
RMAN configuration parameters are:
CONFIGURE RETENTION POLICY TO REDUNDANCY 1; # default
CONFIGURE BACKUP OPTIMIZATION OFF; # default
CONFIGURE DEFAULT DEVICE TYPE TO DISK; # default
CONFIGURE CONTROLFILE AUTOBACKUP OFF; # default
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 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 '/oracle10g/app/oracle/product/10.2.0/db_1/dbs/snapcf_instname.f'; # default


I moved over the 3 files created under the backup directory. Im assuming that one has the datafiles, one has the control files, and the other has the archive logs.

What would be the correct way to restore this database on the dev box using these 3 files? I have attempted to restore the control file but it complains every time about autobackup or that the piece is not a valid backup piece.
Re: restoring database to different box [message #258924 is a reply to message #258918] Mon, 13 August 2007 15:40 Go to previous messageGo to next message
DreamzZ
Messages: 1666
Registered: May 2007
Location: Dreamzland
Senior Member
STARTUP NOMOUNT FORCE;
RESTORE SPFILE FROM BACKUPPIECENAME;
RESTORE CONTROFILE FROM BACKUPPIECENAME;
ALTER DATABASE MOUNT;
RESTORE DATABASE;
RESCOVER DATABASE;
Re: restoring database to different box [message #258926 is a reply to message #258924] Mon, 13 August 2007 15:48 Go to previous messageGo to next message
DriveShaft
Messages: 20
Registered: August 2007
Junior Member
Thanks for the reply.

When trying to restore either the spfile or the control file I get the same error for both cases.

RMAN> restore controlfile from '/u01/b_4dip0b3o_141_1';

Starting restore at 13-AUG-07
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=36 devtype=DISK

RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of restore command at 08/13/2007 15:44:35
RMAN-06172: no autobackup found or specified handle is not a valid copy or piece
Re: restoring database to different box [message #258927 is a reply to message #258926] Mon, 13 August 2007 16:01 Go to previous messageGo to next message
DreamzZ
Messages: 1666
Registered: May 2007
Location: Dreamzland
Senior Member
Use
restore controlfile from tag 'tag name here';
Re: restoring database to different box [message #258930 is a reply to message #258927] Mon, 13 August 2007 16:12 Go to previous messageGo to next message
DriveShaft
Messages: 20
Registered: August 2007
Junior Member
Iv tried that too, and it complains that it needs to be restored from autobackup?

RMAN> restore controlfile from tag 'TAG20070810T010004';

Starting restore at 13-AUG-07
using channel ORA_DISK_1

RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of restore command at 08/13/2007 16:09:36
RMAN-06563: control file or SPFILE must be restored using FROM AUTOBACKUP
Re: restoring database to different box [message #258932 is a reply to message #258930] Mon, 13 August 2007 16:25 Go to previous messageGo to next message
DreamzZ
Messages: 1666
Registered: May 2007
Location: Dreamzland
Senior Member
When you took backup whats the value of auto backup controlfile?
was that enabled ?if yes then


Try this command
Restore controlfile from autobackup;
Re: restoring database to different box [message #258934 is a reply to message #258932] Mon, 13 August 2007 16:29 Go to previous messageGo to next message
DriveShaft
Messages: 20
Registered: August 2007
Junior Member
No...it was/is off

CONFIGURE CONTROLFILE AUTOBACKUP OFF; # default


I see that many people say you should turn this on, but its off by default so I would assume that one would be able to do a backup and restore without having to change the default value?

I went ahead and tried what you said anyways and here is what I get...

RMAN> set dbid=4121490858;

executing command: SET DBID

RMAN> restore controlfile from autobackup;

Starting restore at 13-AUG-07
using channel ORA_DISK_1

channel ORA_DISK_1: looking for autobackup on day: 20070813
channel ORA_DISK_1: looking for autobackup on day: 20070812
channel ORA_DISK_1: looking for autobackup on day: 20070811
channel ORA_DISK_1: looking for autobackup on day: 20070810
channel ORA_DISK_1: looking for autobackup on day: 20070809
channel ORA_DISK_1: looking for autobackup on day: 20070808
channel ORA_DISK_1: looking for autobackup on day: 20070807
channel ORA_DISK_1: no autobackup in 7 days found
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of restore command at 08/13/2007 16:32:15
RMAN-06172: no autobackup found or specified handle is not a valid copy or piece

[Updated on: Mon, 13 August 2007 16:33]

Report message to a moderator

Re: restoring database to different box [message #258939 is a reply to message #258934] Mon, 13 August 2007 16:56 Go to previous messageGo to next message
DreamzZ
Messages: 1666
Registered: May 2007
Location: Dreamzland
Senior Member
Quote:
RMAN> restore controlfile from autobackup;



This only works when controlfile aubackup set to ON.
Re: restoring database to different box [message #259144 is a reply to message #258939] Tue, 14 August 2007 09:12 Go to previous messageGo to next message
DriveShaft
Messages: 20
Registered: August 2007
Junior Member
So rman can not be used to restore a backup taken with rman unless autobackups is turned on?

If thats the case, why would it default to "off" if restores can not be done without it?
Re: restoring database to different box [message #259154 is a reply to message #259144] Tue, 14 August 2007 09:31 Go to previous messageGo to next message
Michel Cadot
Messages: 64152
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Quote:
If thats the case, why would it default to "off" if restores can not be done without it?

That's a good question. To keep the old behaviour, in time this does not exist, I think.

Nevertheless, you should be able to restore your controlfile from the backup as you included it.

Regards
Michel
Re: restoring database to different box [message #259192 is a reply to message #259154] Tue, 14 August 2007 11:02 Go to previous messageGo to next message
DriveShaft
Messages: 20
Registered: August 2007
Junior Member
I took a fresh backup with autobackups turned on. The only difference here was that it wrote my control file to the db_1/dbs path rather than to the directory where my datafiles and archive logs were backed up to.

I get the same exact error as above when attempted to restore my control file on the other box.

Could this be because box A is HPUX and box B is Linux?
Could this be because I don't have the same directory paths on box B?
Am I doing the correct steps to backup a database on box A and restore it on box B?
Re: restoring database to different box [message #259278 is a reply to message #259192] Tue, 14 August 2007 22:58 Go to previous messageGo to next message
Arju
Messages: 1554
Registered: June 2007
Location: Dhaka,Bangladesh. Mobile:...
Senior Member

DriveShaft wrote on Tue, 14 August 2007 22:02
I took a fresh backup with autobackups turned on. The only difference here was that it wrote my control file to the db_1/dbs path rather than to the directory where my datafiles and archive logs were backed up to.

I get the same exact error as above when attempted to restore my control file on the other box.

Could this be because box A is HPUX and box B is Linux?
Could this be because I don't have the same directory paths on box B?
Am I doing the correct steps to backup a database on box A and restore it on box B?



I dont think so.

Use ,
Restore controlfile from <specified path of path>
in nomount state

and in mount/open state use
Restore controlfile to < current control filename> from <backup filename of control file>

[Updated on: Tue, 14 August 2007 23:01]

Report message to a moderator

Re: restoring database to different box [message #259393 is a reply to message #259278] Wed, 15 August 2007 08:41 Go to previous messageGo to next message
DriveShaft
Messages: 20
Registered: August 2007
Junior Member
If you look at the third post, you will see that "restoring controlfile from path" was the first thing that was tried.

When you say "I don't think so", which question were you answering. I am leaning toward it being an issue between HPUX and LINUX. Everything I have tried seems to work just fine when using the same box to do the restore on, but keep in mind I am trying to restore the backed up files to a different box with a different OS.

Has anyone ever restored RMAN backups from a HPUX box onto a LINUX box?
Re: restoring database to different box [message #259432 is a reply to message #259393] Wed, 15 August 2007 10:49 Go to previous messageGo to next message
DreamzZ
Messages: 1666
Registered: May 2007
Location: Dreamzland
Senior Member
I had the same problem when i was creating database on mine DEV environment,almost i tried more then 10 to 15 times but the same problem,you know where did i do mistake.

I Didn't apply the VERITAS patch for DST.

When i applied patch the same command returned me the message

DataBase Created.

Re: restoring database to different box [message #259933 is a reply to message #259393] Thu, 16 August 2007 20:59 Go to previous message
ebrian
Messages: 2794
Registered: April 2006
Senior Member
DriveShaft wrote on Wed, 15 August 2007 09:41

Has anyone ever restored RMAN backups from a HPUX box onto a LINUX box?

You can not restore your database directly to RHEL from HPUX. However, since you are on 10g and want to copy the database to a platform with a different Endian format than your PROD box, you can consider Cross-Platform Tranportable Tablespace.

As a side note, even if you have CONTROLFILE AUTOBACKUP set to OFF, as long as you backup datafile #1 (which will be the case with a whole database backup), the controlfile will be backed up automatically. Nevertheless, it's good practice to set CONTROLFILE AUTOBACKUP to ON.

RMAN> configure controlfile autobackup off;

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

RMAN> backup datafile 1;

Starting backup at 16-AUG-07
using channel ORA_DISK_1
channel ORA_DISK_1: starting full datafile backupset
channel ORA_DISK_1: specifying datafile(s) in backupset
input datafile fno=00001 name=E:\ORACLE\ORADATA\WIN10G\SYSTEM01.DBF
channel ORA_DISK_1: starting piece 1 at 16-AUG-07
channel ORA_DISK_1: finished piece 1 at 16-AUG-07
piece handle=E:\ORACLE\FLASH_RECOVERY_AREA\WIN10G\BACKUPSET\2007_08_16\O1_MF_NNNDF_TAG20070816T21494
1_3D9ZOOPY_.BKP tag=TAG20070816T214941 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:55
channel ORA_DISK_1: starting full datafile backupset
channel ORA_DISK_1: specifying datafile(s) in backupset
including current control file in backupset
including current SPFILE in backupset
channel ORA_DISK_1: starting piece 1 at 16-AUG-07
channel ORA_DISK_1: finished piece 1 at 16-AUG-07
piece handle=E:\ORACLE\FLASH_RECOVERY_AREA\WIN10G\BACKUPSET\2007_08_16\O1_MF_NCSNF_TAG20070816T21494
1_3D9ZQHHN_.BKP tag=TAG20070816T214941 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:06
Finished backup at 16-AUG-07
Previous Topic: backup report
Next Topic: Error: indx_data.dbf
Goto Forum:
  


Current Time: Sat Dec 10 12:44:54 CST 2016

Total time taken to generate the page: 0.15842 seconds