Description
(1). The db_name needs to be the same when Rman is backed up to a different machine recovery.
If you want to change to another instance name, you can change it with the NID command after the restore succeeds. The information of the instance name is recorded in the control file, so if the instance name is inconsistent at the time of recovery, the error will be returned.
(2). When the path to recovery is inconsistent with the source library, you need to specify the new location using the SET command in the Restore command and use switch datafile all to update the change information to the control file.
Test environment:
Source database server A, installed in E, backup directory already in e disk;
Source database Server B, installed in Disk F.
------------- -----------------------
First, the source database preparation work
----------------------- -------------
--1. Query dbid
Sql> select Name,dbid from V$database;
NAME DBID
--------- ----------
ORCL 1320546556
--2. Backup source Data db
run {
configure retention policy to recovery window of 14 days;
configure controlfile autobackup on; --自动开启控制文件备份
configure controlfile autobackup format for device type disk to 'E:\backup\controlfile\bak_%F';
allocate channel c1 device type disk format 'E:\backup\data\bak_%u';
allocate channel c2 device type disk format 'E:\backup\data\bak_%u';
sql 'alter system archive log current';
backup incremental level=0 database skip inaccessible
plus archivelog filesperset 20
delete all input;
release channel c1;
release channel c2;
}
allocate channel for maintenance device type disk;
crosscheck backupset;
delete noprompt obsolete;
--or
run {
configure retention policy to recovery window of 14 days;
allocate channel c1 device type disk format 'E:\backup\data\bak_%u';
allocate channel c2 device type disk format 'E:\backup\data\bak_%u';
sql 'alter system archive log current';
backup incremental level=0 database skip inaccessible
plus archivelog filesperset 20
delete all input;
--手动直接指明备份文件名和路径
backup current controlfile tag='bak_ctrollfile' format='E:\backup\controlfile\bak_ctl_file_%U_%T';
backup spfile tag='bak_spfile' format='E:\backup\controlfile\bak_spfile_%U_% T';
release channel c1;
release channel c2;
}
allocate channel for maintenance device type disk;
crosscheck backupset;
delete noprompt obsolete;
--3. Manual Backup SPFile
Create pfile= ' E:\backup\inittest.ora ' from SPFile;
------------------------------------