peledc
asked on
RMAN: recover on a diferent server
Hi,
Oracle 9.2
OS is Win2K
I perform daily backups with RMAN (without a catalog).
I'm practicing recovery modes and I manage to recover from many scenarios.
I have problems understanding how to perform a complete recovery after the Server has crashed and I install Oracle software on a different server with a new IP.
I would be greatfull if you could direct me with the correct action items.
This question is only addressed to those who have actually done it.
My RMAN backup is:
run {
SQL "ALTER SYSTEM ARCHIVE LOG CURRENT";
allocate channel c1 device type disk format 'd:\oracle\backup\%U';
backup database ;
backup archivelog all delete input;
}
Thanks
Peled
Oracle 9.2
OS is Win2K
I perform daily backups with RMAN (without a catalog).
I'm practicing recovery modes and I manage to recover from many scenarios.
I have problems understanding how to perform a complete recovery after the Server has crashed and I install Oracle software on a different server with a new IP.
I would be greatfull if you could direct me with the correct action items.
This question is only addressed to those who have actually done it.
My RMAN backup is:
run {
SQL "ALTER SYSTEM ARCHIVE LOG CURRENT";
allocate channel c1 device type disk format 'd:\oracle\backup\%U';
backup database ;
backup archivelog all delete input;
}
Thanks
Peled
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
The datapieces 03FCOI5E_1_1 and 04FCOIHE_1_1
were transferred to the new host machine “shvertner”.
Transfer INIT.ORA file from the target to the cloning instance.
Change all data file locations mentioned in the INIT.ORA file.
Transfer the password file PWDmain.ora file. (…\ora92\database)
RMAN is alias for connecting to the duplicate database.
SQL> connect sys/reks@rman as sysdba
Connected.
SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup nomount
ORACLE instance started.
Total System Global Area 118562548 bytes
Fixed Size 454388 bytes
Variable Size 83886080 bytes
Database Buffers 33554432 bytes
Redo Buffers 667648 bytes
SQL>
SQL>alter database mount
RMAN>connect target sys/reks@rman
run{
allocate channel c1 type disk;
restore controlfile;
}
Change the password file with the password file from the target database to avoid the error message:
SQL> alter database mount;
alter database mount
*
ERROR at line 1:
ORA-01991: invalid password file 'D:\oracle\ora92\DATABASE\
Now you have to use the passwords from the old target database (in my case the MAIN instance from the ‘main’ computer!
SQL> alter database mount;
RMAN> @restore.txt
run {
allocate channel c1 type disk;
allocate channel c2 type disk;
allocate channel c3 type disk;
set newname for datafile 1 to 'D:\ORACLE\ORADATA\MAIN\SY
set newname for datafile 2 to 'D:\ORACLE\ORADATA\MAIN\UN
set newname for datafile 3 to 'D:\ORACLE\ORADATA\MAIN\CW
set newname for datafile 4 to 'D:\ORACLE\ORADATA\MAIN\DR
set newname for datafile 5 to 'D:\ORACLE\ORADATA\MAIN\EX
set newname for datafile 6 to 'D:\ORACLE\ORADATA\MAIN\IN
set newname for datafile 7 to 'D:\ORACLE\ORADATA\MAIN\OD
set newname for datafile 8 to 'D:\ORACLE\ORADATA\MAIN\TO
set newname for datafile 9 to 'D:\ORACLE\ORADATA\MAIN\US
set newname for datafile 10 to 'D:\ORACLE\ORADATA\MAIN\XD
set newname for datafile 11 to 'D:\ORACLE\ORADATA\MAIN\TS
set newname for datafile 12 to 'D:\ORACLE\ORADATA\MAIN\TS
set newname for datafile 13 to 'D:\ORACLE\ORADATA\MAIN\TS
set newname for datafile 14 to 'D:\ORACLE\ORADATA\MAIN\TS
set newname for datafile 15 to 'D:\ORACLE\ORADATA\MAIN\TS
set newname for datafile 16 to 'D:\ORACLE\ORADATA\MAIN\TS
set newname for datafile 17 to 'D:\ORACLE\ORADATA\MAIN\TS
set newname for datafile 18 to 'D:\ORACLE\ORADATA\MAIN\TS
set newname for datafile 19 to 'D:\ORACLE\ORADATA\MAIN\TS
set newname for datafile 20 to 'D:\ORACLE\ORADATA\MAIN\TS
set newname for datafile 21 to 'D:\ORACLE\ORADATA\MAIN\TS
set newname for datafile 22 to 'D:\ORACLE\ORADATA\MAIN\TS
set newname for datafile 23 to 'D:\ORACLE\ORADATA\MAIN\TS
set newname for datafile 24 to 'D:\ORACLE\ORADATA\MAIN\TS
set newname for datafile 25 to 'D:\ORACLE\ORADATA\MAIN\TS
set newname for datafile 26 to 'D:\ORACLE\ORADATA\MAIN\TS
set newname for datafile 27 to 'D:\ORACLE\ORADATA\MAIN\TS
set newname for datafile 28 to 'D:\ORACLE\ORADATA\MAIN\TS
set newname for datafile 29 to 'D:\ORACLE\ORADATA\MAIN\TS
set newname for datafile 30 to 'D:\ORACLE\ORADATA\MAIN\TS
set newname for datafile 31 to 'D:\ORACLE\ORADATA\MAIN\TS
set newname for datafile 32 to 'D:\ORACLE\ORADATA\MAIN\TS
set newname for datafile 33 to 'D:\ORACLE\ORADATA\MAIN\TS
set newname for datafile 34 to 'D:\ORACLE\ORADATA\MAIN\TS
set newname for datafile 35 to 'D:\ORACLE\ORADATA\MAIN\TS
set newname for datafile 36 to 'D:\ORACLE\ORADATA\MAIN\TS
set newname for datafile 37 to 'D:\ORACLE\ORADATA\MAIN\TS
set newname for datafile 38 to 'D:\ORACLE\ORADATA\MAIN\TS
set newname for datafile 39 to 'D:\ORACLE\ORADATA\MAIN\TS
set newname for datafile 40 to 'D:\ORACLE\ORADATA\MAIN\TS
set newname for datafile 41 to 'D:\ORACLE\ORADATA\MAIN\TS
set newname for datafile 42 to 'D:\ORACLE\ORADATA\MAIN\TS
restore database;
}
SQL> select name from v$datafile;
D:\ORACLE\ORADATA\MAIN\SYS
D:\ORACLE\ORADATA\MAIN\UND
D:\ORACLE\ORADATA\MAIN\CWM
D:\ORACLE\ORADATA\MAIN\DRS
D:\ORACLE\ORADATA\MAIN\EXA
D:\ORACLE\ORADATA\MAIN\IND
D:\ORACLE\ORADATA\MAIN\ODM
D:\ORACLE\ORADATA\MAIN\TOO
D:\ORACLE\ORADATA\MAIN\USE
D:\ORACLE\ORADATA\MAIN\XDB
E:\ORACLE_DB_MAIN\ORADATA\
E:\ORACLE_DB_MAIN\ORADATA\
E:\ORACLE_DB_MAIN\ORADATA\
E:\ORACLE_DB_MAIN\ORADATA\
E:\ORACLE_DB_MAIN\ORADATA\
E:\ORACLE_DB_MAIN\ORADATA\
E:\ORACLE_DB_MAIN\ORADATA\
E:\ORACLE_DB_MAIN\ORADATA\
E:\ORACLE_DB_MAIN\ORADATA\
E:\ORACLE_DB_MAIN\ORADATA\
E:\ORACLE_DB_MAIN\ORADATA\
E:\ORACLE_DB_MAIN\ORADATA\
E:\ORACLE_DB_MAIN\ORADATA\
E:\ORACLE_DB_MAIN\ORADATA\
E:\ORACLE_DB_MAIN\ORADATA\
E:\ORACLE_DB_MAIN\ORADATA\
E:\ORACLE_DB_MAIN\ORADATA\
E:\ORACLE_DB_MAIN\ORADATA\
E:\ORACLE_DB_MAIN\ORADATA\
E:\ORACLE_DB_MAIN\ORADATA\
E:\ORACLE_DB_MAIN\ORADATA\
E:\ORACLE_DB_MAIN\ORADATA\
E:\ORACLE_DB_MAIN\ORADATA\
E:\ORACLE_DB_MAIN\ORADATA\
E:\ORACLE_DB_MAIN\ORADATA\
E:\ORACLE_DB_MAIN\ORADATA\
E:\ORACLE_DB_MAIN\ORADATA\
E:\ORACLE_DB_MAIN\ORADATA\
E:\ORACLE_DB_MAIN\ORADATA\
E:\ORACLE_DB_MAIN\ORADATA\
E:\ORACLE_DB_MAIN\ORADATA\
E:\ORACLE_DB_MAIN\ORADATA\
42 rows selected.
==========================
alter database rename file 'E:\ORACLE_DB_MAIN\ORADATA
alter database rename file 'E:\ORACLE_DB_MAIN\ORADATA
alter database rename file 'E:\ORACLE_DB_MAIN\ORADATA
alter database rename file 'E:\ORACLE_DB_MAIN\ORADATA
alter database rename file 'E:\ORACLE_DB_MAIN\ORADATA
alter database rename file 'E:\ORACLE_DB_MAIN\ORADATA
alter database rename file 'E:\ORACLE_DB_MAIN\ORADATA
alter database rename file 'E:\ORACLE_DB_MAIN\ORADATA
alter database rename file 'E:\ORACLE_DB_MAIN\ORADATA
alter database rename file 'E:\ORACLE_DB_MAIN\ORADATA
alter database rename file 'E:\ORACLE_DB_MAIN\ORADATA
alter database rename file 'E:\ORACLE_DB_MAIN\ORADATA
alter database rename file 'E:\ORACLE_DB_MAIN\ORADATA
alter database rename file 'E:\ORACLE_DB_MAIN\ORADATA
alter database rename file 'E:\ORACLE_DB_MAIN\ORADATA
alter database rename file 'E:\ORACLE_DB_MAIN\ORADATA
alter database rename file 'E:\ORACLE_DB_MAIN\ORADATA
alter database rename file 'E:\ORACLE_DB_MAIN\ORADATA
alter database rename file 'E:\ORACLE_DB_MAIN\ORADATA
alter database rename file 'E:\ORACLE_DB_MAIN\ORADATA
alter database rename file 'E:\ORACLE_DB_MAIN\ORADATA
alter database rename file 'E:\ORACLE_DB_MAIN\ORADATA
alter database rename file 'E:\ORACLE_DB_MAIN\ORADATA
alter database rename file 'E:\ORACLE_DB_MAIN\ORADATA
alter database rename file 'E:\ORACLE_DB_MAIN\ORADATA
alter database rename file 'E:\ORACLE_DB_MAIN\ORADATA
alter database rename file 'E:\ORACLE_DB_MAIN\ORADATA
alter database rename file 'E:\ORACLE_DB_MAIN\ORADATA
alter database rename file 'E:\ORACLE_DB_MAIN\ORADATA
alter database rename file 'E:\ORACLE_DB_MAIN\ORADATA
alter database rename file 'E:\ORACLE_DB_MAIN\ORADATA
alter database rename file 'E:\ORACLE_DB_MAIN\ORADATA
alter database rename file 'E:\ORACLE_DB_MAIN\ORADATA
alter database rename file 'E:\ORACLE_DB_MAIN\ORADATA
alter database rename file 'E:\ORACLE_DB_MAIN\ORADATA
alter database rename file 'E:\ORACLE_DB_MAIN\ORADATA
alter database rename file 'E:\ORACLE_DB_MAIN\ORADATA
alter database rename file 'E:\ORACLE_DB_MAIN\ORADATA
alter database rename file 'E:\ORACLE_DB_MAIN\ORADATA
alter database rename file 'E:\ORACLE_DB_MAIN\ORADATA
alter database rename file 'E:\ORACLE_DB_MAIN\ORADATA
alter database rename file 'E:\ORACLE_DB_MAIN\ORADATA
alter database rename file 'E:\ORACLE_DB_MAIN\ORADATA
alter database rename file 'E:\ORACLE_DB_MAIN\ORADATA
alter database rename file 'E:\ORACLE_DB_MAIN\ORADATA
SQL> select name from v$datafile;
NAME
--------------------------
D:\ORACLE\ORADATA\MAIN\SYS
D:\ORACLE\ORADATA\MAIN\UND
D:\ORACLE\ORADATA\MAIN\CWM
D:\ORACLE\ORADATA\MAIN\DRS
D:\ORACLE\ORADATA\MAIN\EXA
D:\ORACLE\ORADATA\MAIN\IND
D:\ORACLE\ORADATA\MAIN\ODM
D:\ORACLE\ORADATA\MAIN\TOO
D:\ORACLE\ORADATA\MAIN\USE
D:\ORACLE\ORADATA\MAIN\XDB
D:\ORACLE\ORADATA\MAIN\TSD
D:\ORACLE\ORADATA\MAIN\TSD
D:\ORACLE\ORADATA\MAIN\TSI
D:\ORACLE\ORADATA\MAIN\TSD
D:\ORACLE\ORADATA\MAIN\TSI
D:\ORACLE\ORADATA\MAIN\TSD
D:\ORACLE\ORADATA\MAIN\TSI
D:\ORACLE\ORADATA\MAIN\TSD
D:\ORACLE\ORADATA\MAIN\TSI
D:\ORACLE\ORADATA\MAIN\TSD
D:\ORACLE\ORADATA\MAIN\TSI
D:\ORACLE\ORADATA\MAIN\TSD
D:\ORACLE\ORADATA\MAIN\TSI
D:\ORACLE\ORADATA\MAIN\TSD
D:\ORACLE\ORADATA\MAIN\TSI
D:\ORACLE\ORADATA\MAIN\TSR
D:\ORACLE\ORADATA\MAIN\TSR
D:\ORACLE\ORADATA\MAIN\TSI
D:\ORACLE\ORADATA\MAIN\TSD
D:\ORACLE\ORADATA\MAIN\TSI
D:\ORACLE\ORADATA\MAIN\TSD
D:\ORACLE\ORADATA\MAIN\TSI
D:\ORACLE\ORADATA\MAIN\TSD
D:\ORACLE\ORADATA\MAIN\TSI
D:\ORACLE\ORADATA\MAIN\TSD
D:\ORACLE\ORADATA\MAIN\TSI
D:\ORACLE\ORADATA\MAIN\TSD
D:\ORACLE\ORADATA\MAIN\TSI
D:\ORACLE\ORADATA\MAIN\TSD
D:\ORACLE\ORADATA\MAIN\TSI
D:\ORACLE\ORADATA\MAIN\TSR
D:\ORACLE\ORADATA\MAIN\TSR
42 rows selected.
==========================
SQL> alter database open resetlogs;
RESETLOGS Specify RESETLOGS to reset the current log sequence number to 1
and discards any redo information that was not applied during recovery, ensuring
that it will never be applied. This effectively discards all changes that are in the redo
log, but not in the database.
You must specify RESETLOGS to open the database after performing media
recovery with an incomplete recovery using the RECOVER clause or with a backup
control file. After opening the database with this clause, you should perform a
complete database backup.
THE DATABASE IS RESTORED AT THE DIFFERENT NODE (HOST).
Unexpected side effect: On the computer on which I work in tnsnames.ora file the host of the MAIN alias was silently changed from “main’ to “shvertner”. 5 days I did not notice this!!!
Problems with RMAN after the restoring:
RMAN> list backup;
(connected to the old or to the new created target database)
results error:
RMAN-20003: target database incarnation not found in recovery catalog
RMAN> list incarnation;
Lists one incarnation in the recovery catalog.
DB Key Inc Key DB Name DB ID CUR Reset SCN Reset Time
______ ________ ________ ___________ ___ _________ ___________
1 2 MAIN 200722603 YES 190578 24-SEP-03
FIX:
RMAN> reset database;
New incarnation of the database registered in recovery catalog
Starting full resync of recovery catalog
Full resync complete
SURPRISE:
Instead the directory E:\ORACLE_DB_MAIN\ORADATA\
the new database directory was displayed: D:\ORACLE\ORADATA\MAIN\SYS
RMAN> list incarnation;
Lists TWO incarnations in the recovery catalog.
DB Key Inc Key DB Name DB ID CUR Reset SCN Reset Time
______ ________ ________ ___________ ___ _________ ___________
1 2 MAIN 200722603 NO 190578 24-SEP-03
1 951 MAIN 200722603 YES 44011554 06-FEB-04
How to reset using the OLD incarnation?
Look in:
Note:1070453.6
RMAN Point-in-Time Recovery of a Backup From Before Last Resetlogs
RMAN>reset database to incarnation 2;
Look in:
Note:48364.1
OERR RMAN 20011 target database incarnation is not current in recovery catalog
Resetting RMAN to a Previous Incarnation: (DO NOT EXPERIMENT!!!!)
2-174 Oracle9 i Recovery Manager Reference
Example The following scenario
makes an old incarnation of database trgt current again:
# step 1: obtain the primary key of old incarnation
LIST INCARNATION OF DATABASE trgt;
List of Database Incarnations
DB Key Inc Key DB Name DB ID CUR Reset SCN Reset Time
------- ------- -------- ---------------- --- ---------- ----------
1 2 TRGT 1334358386 NO 154381 OCT 30 2001 16:02:12
1 116 TRGT 1334358386 YES 154877 OCT 30 2001 16:37:39
# step 2: start instance and reset database to incarnation key 2
STARTUP FORCE NOMOUNT;
RESET DATABASE TO INCARNATION 2;
# step 3: restore control file from previous incarnation, then shut down instance
# and mount control file
RESTORE CONTROLFILE;
STARTUP FORCE MOUNT;
# step 4: restore and recover the database to a point before the RESETLOGS
RESTORE DATABASE UNTIL SCN 154876;
RECOVER DATABASE UNTIL SCN 154876;
# step 5: make this incarnation the current incarnation and then list incarnations:
ALTER DATABASE OPEN RESETLOGS;
LIST INCARNATION OF DATABASE trgt;
List of Database Incarnations
DB Key Inc Key DB Name DB ID CUR Reset SCN Reset Time
------- ------- -------- ---------------- --- ---------- ----------
1 2 TRGT 1334358386 NO 154381 OCT 30 2001 16:02:12
1 116 TRGT 1334358386 NO 154877 OCT 30 2001 16:37:39
1 311 TRGT 1334358386 YES 154877 OCT 30 2001 17:17:03
See also:
Managing the Recovery Manager Repository 16-1
RMAN User’s guide
See also:
Maintaining RMAN Repository Note125303.1