Muhammad Nadeem Chaudhry's Blog


Restoring RMAN backup on a new machine

Posted in Uncategorized by Muhammad Nadeem Chaudhry on January 22, 2011

to restore RMAN backup to a new machine follow these steps on windows:
– install oracle software on the machine with the same directory structure as the database
we have its backup
– copy backup comes from original database to the same directory as it is defined in the database
controlfile(backup folder)
– create windows service for the database
C:\>oradim -new -sid ORCL -startmode m
C:\>oradim -edit -sid ORCL -startmode a
– Get the dbid from the remote database
let dbid=1145595280
– Connect with rman to the target database at local server
C:\>Documents and Settings\Administrator>rman target /
Recovery Manager: Release 9.2.0.1.0 – Production
Copyright (c) 1995, 2002, Oracle Corporation. All rights reserved.
connected to target database (not started)
RMAN> set dbid 1145595280
executing command: SET DBID
RMAN> startup nomount
startup failed: ORA-01078: failure in processing system parameters
LRM-00109: could not open parameter file ‘D:\ORACLE\ORA92\DATABASE\INITORCL.ORA’
trying to start the Oracle instance without parameter files …
Oracle instance started
Total System Global Area 97589952 bytes
Fixed Size 453312 bytes
Variable Size 46137344 bytes
Database Buffers 50331648 bytes
Redo Buffers 667648 bytes
RMAN> restore spfile from ‘E:\rman_backup\control\CC-1145595280-20070506-01’;
Starting restore at 06-MAY-07
using target database controlfile instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=9 devtype=DISK
channel ORA_DISK_1: autobackup found: E:\rman_backup\control\CC-1145595280-20070
506-01
channel ORA_DISK_1: SPFILE restore from autobackup complete
Finished restore at 06-MAY-07
– create db directory structure like the primary db
‘d:\oracle\oradata\orcl’,’d:\oracle\oradata\orcl\archive’
RMAN> startup force nomount;
Oracle instance started
Total System Global Area 135338868 bytes
Fixed Size 453492 bytes
Variable Size 109051904 bytes
Database Buffers 25165824 bytes
Redo Buffers 667648 bytes

Error: 

RMAN-03002: failure of startup command at 04/09/2008 18:13:56 RMAN-04014: startup failed: 

ORA-02778: Name given for the log directory is invalid

Solutions: Create bdump,udump,cdump and create folder at C:\oracle\product\10.1.0\admin\orcl

RMAN> restore controlfile from ‘E:\rman_backup\control\CC-1145595280-20070506-01’;
Starting restore at 06-MAY-07
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=13 devtype=DISK
channel ORA_DISK_1: restoring controlfile
channel ORA_DISK_1: restore complete
replicating controlfile
input filename=D:\ORACLE\ORADATA\ORCL\CONTROL01.CTL
output filename=D:\ORACLE\ORADATA\ORCL\CONTROL02.CTL
output filename=D:\ORACLE\ORADATA\ORCL\CONTROL03.CTL
Finished restore at 06-MAY-07
RMAN> shutdown
Oracle instance shut down
RMAN> exit
Recovery Manager complete.
C:\Documents and Settings\Administrator>rman target /
Recovery Manager: Release 9.2.0.1.0 – Production
Copyright (c) 1995, 2002, Oracle Corporation. All rights reserved.
connected to target database (not started)
RMAN> startup mount;
database is already started
RMAN> shutdown immediate;
using target database controlfile instead of recovery catalog
database dismounted
Oracle instance shut down
– copy password file from primary database to the current database
RMAN> startup mount;
connected to target database (not started)
Oracle instance started
database mounted
Total System Global Area 135338868 bytes
Fixed Size 453492 bytes
Variable Size 109051904 bytes
Database Buffers 25165824 bytes
Redo Buffers 667648 bytes
RMAN> restore database;
Starting restore at 06-MAY-07
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=13 devtype=DISK
allocated channel: ORA_DISK_2
channel ORA_DISK_2: sid=14 devtype=DISK
channel ORA_DISK_1: starting datafile backupset restore
channel ORA_DISK_1: specifying datafile(s) to restore from backup set
restoring datafile 00001 to D:\ORACLE\ORADATA\ORCL\SYSTEM01.DBF
restoring datafile 00002 to D:\ORACLE\ORADATA\ORCL\UNDOTBS01.DBF
restoring datafile 00003 to D:\ORACLE\ORADATA\ORCL\CWMLITE01.DBF
restoring datafile 00004 to D:\ORACLE\ORADATA\ORCL\DRSYS01.DBF
restoring datafile 00005 to D:\ORACLE\ORADATA\ORCL\EXAMPLE01.DBF
restoring datafile 00006 to D:\ORACLE\ORADATA\ORCL\INDX01.DBF
restoring datafile 00007 to D:\ORACLE\ORADATA\ORCL\ODM01.DBF
restoring datafile 00008 to D:\ORACLE\ORADATA\ORCL\TOOLS01.DBF
restoring datafile 00009 to D:\ORACLE\ORADATA\ORCL\USERS01.DBF
restoring datafile 00010 to D:\ORACLE\ORADATA\ORCL\XDB01.DBF
restoring datafile 00011 to D:\ORACLE\ORADATA\ORCL\OEM_REPOSITORY.DBF
restoring datafile 00012 to D:\ORACLE\ORADATA\ORCL\USERS02.DBF
channel ORA_DISK_1: restored backup piece 1
piece handle=E:\RMAN_BACKUP\LEVEL0\BAK_64_621616943_LEVEL0.BAK tag=TAG20070503T1
52256 params=NULL
channel ORA_DISK_1: restore complete
Finished restore at 06-MAY-07

RMAN> recover database;

ORA-19698: F:\ORACLE\PRODUCT\10.1.0\ORADATA\TESTDB1\REDO01.LOG is from different database: id=4011070094, db_name=TESTDB1″ 

Resolution:

If the error “ORA-19698: %s is from different database: id=string, db_name=string” is seen during an Oracle disaster recovery operation, perform the following.

Bring the database to nomount state. 

2. Empty the contents of the directory (under the oradata directory) containing the data files and online redo logs of the newly created database.

3. Re-try the control file restore operation

 RMAN> recover database;
Starting recover at 06-MAY-07
using channel ORA_DISK_1
using channel ORA_DISK_2
channel ORA_DISK_1: starting incremental datafile backupset restore
channel ORA_DISK_1: specifying datafile(s) to restore from backup set
destination for restore of datafile 00001: D:\ORACLE\ORADATA\ORCL\SYSTEM01.DBF
destination for restore of datafile 00002: D:\ORACLE\ORADATA\ORCL\UNDOTBS01.DBF
destination for restore of datafile 00003: D:\ORACLE\ORADATA\ORCL\CWMLITE01.DBF
destination for restore of datafile 00004: D:\ORACLE\ORADATA\ORCL\DRSYS01.DBF
destination for restore of datafile 00005: D:\ORACLE\ORADATA\ORCL\EXAMPLE01.DBF
destination for restore of datafile 00006: D:\ORACLE\ORADATA\ORCL\INDX01.DBF
destination for restore of datafile 00007: D:\ORACLE\ORADATA\ORCL\ODM01.DBF
destination for restore of datafile 00008: D:\ORACLE\ORADATA\ORCL\TOOLS01.DBF
destination for restore of datafile 00009: D:\ORACLE\ORADATA\ORCL\USERS01.DBF
destination for restore of datafile 00010: D:\ORACLE\ORADATA\ORCL\XDB01.DBF
destination for restore of datafile 00011: D:\ORACLE\ORADATA\ORCL\OEM_REPOSITORY
.DBF
destination for restore of datafile 00012: D:\ORACLE\ORADATA\ORCL\USERS02.DBF
channel ORA_DISK_1: restored backup piece 1
piece handle=E:\RMAN_BACKUP\LEVEL2\BAK_68_621875547_LEVEL2.BAK tag=TAG20070506T1
51313 params=NULL
channel ORA_DISK_1: restore complete
starting media recovery
channel ORA_DISK_1: starting archive log restore to default destination
channel ORA_DISK_1: restoring archive log
archive log thread=1 sequence=98
channel ORA_DISK_1: restored backup piece 1
piece handle=E:\RMAN_BACKUP\ARCH\BAK_70_621875630_ARCH.BAK tag=TAG20070506T15143
7 params=NULL
channel ORA_DISK_1: restore complete
archive log filename=D:\ORACLE\ORADATA\ORCL\ARCHIVE\ARC00098.001 thread=1 sequen
ce=98
unable to find archive log
archive log thread=1 sequence=99
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of recover command at 05/06/2007 15:43:06
RMAN-06054: media recovery requesting unknown log: thread 1 scn 17505361
RMAN> alter database open resetlogs;
database opened
RMAN> exit
Recovery Manager complete.

One Response to 'Restoring RMAN backup on a new machine'

Subscribe to comments with RSS or TrackBack to 'Restoring RMAN backup on a new machine'.

  1. Kieron said,

    i followed this step for step and got it on my first try thanks a lot it was way easier and clearer than some of the others i came across


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s


%d bloggers like this: