Let, you are restoring the archive backup from tape to the same host or other host.
1) To restore archive files
--Connect to RMAN from the host to which you want to restore the archive files
set DBID 4256854606 (if you want to restore it to some other hosts - you have to specify the DBID (which you can get from v$database) of the backed up database)
CONNECT TARGET /
run
{
allocate channel t1 type 'sbt_tape' parms 'ENV=(+tape library softlink+)';
allocate channel t2 type 'sbt_tape' parms 'ENV=(+tape library softlink+)';
restore archivelog from sequence until sequence ; -- add thread (if rac)
release channel t1;
release channel t2;
}
exit
2) To restore backup
set DBID 4256854606 (if you want to restore it to some other hosts - you have to specify the DBID (which you can get from v$database) of the backed up database)
CONNECT TARGET /
run
{
allocate channel t1 type 'sbt_tape' parms 'ENV=(+tape library softlink+)';
allocate channel t2 type 'sbt_tape' parms 'ENV=(+tape library softlink+)';
set until time "to_date('backup completion timestamp')"; - alternatively you can specify SCN also
set newname for DATAFILE 1 to '+new datafile name/raw device+'; - if the host where you are restoring has a different file system structure
set newname for DATAFILE 2 to '+new datafile name/raw device+';
set newname for DATAFILE 3 to '+new datafile name/raw device+';
..............
..............(add the set newname lines to the total no:of datafiles in the database)
RESTORE DATABASE;
SWITCH DATAFILE ALL;
release channel t1;
release channel t2;
}
EXIT
EOF
[Collected ]
--- Cheers !!!
1) To restore archive files
--Connect to RMAN from the host to which you want to restore the archive files
set DBID 4256854606 (if you want to restore it to some other hosts - you have to specify the DBID (which you can get from v$database) of the backed up database)
CONNECT TARGET /
run
{
allocate channel t1 type 'sbt_tape' parms 'ENV=(+tape library softlink+)';
allocate channel t2 type 'sbt_tape' parms 'ENV=(+tape library softlink+)';
restore archivelog from sequence
release channel t1;
release channel t2;
}
exit
2) To restore backup
set DBID 4256854606 (if you want to restore it to some other hosts - you have to specify the DBID (which you can get from v$database) of the backed up database)
CONNECT TARGET /
run
{
allocate channel t1 type 'sbt_tape' parms 'ENV=(+tape library softlink+)';
allocate channel t2 type 'sbt_tape' parms 'ENV=(+tape library softlink+)';
set until time "to_date('backup completion timestamp')"; - alternatively you can specify SCN also
set newname for DATAFILE 1 to '+new datafile name/raw device+'; - if the host where you are restoring has a different file system structure
set newname for DATAFILE 2 to '+new datafile name/raw device+';
set newname for DATAFILE 3 to '+new datafile name/raw device+';
..............
..............(add the set newname lines to the total no:of datafiles in the database)
RESTORE DATABASE;
SWITCH DATAFILE ALL;
release channel t1;
release channel t2;
}
EXIT
EOF
[Collected ]
--- Cheers !!!
Comments
Post a Comment