Restore from backup

Make dirs:
/u0/backup//(arch, rman)
/opt/oracle/admin//(pfile, adump, bdump, cdump, udump)

Copy files:
sourse:/backup//rman/* dest:/backup//rman/

0. check OS variables (ORACLE_SID, etc).
1. rman target /
2. set DBID  (DBID from ctl_spfile__%Y%M%D__NNN.rman)
-- if spfile was used
3. startup nomount;
4. restore spfile from '/backup/MALINA/rman/ctl_spfile_MALINA_20070716_c-670772455-20070716-00.rman';
-- or
restore spfile to '/opt/oracle/product/10.2/dbs/spfileMALINA.ora' from '/backup/MALINA/rman/ctl_spfile_MALINA_20070716_c-670772455-20070716-00.rman';
5. startup force nomount; -- to read new settings from spfile
-- if pfile was used
4. copy pfile
5. startup nomount;
6. restore controlfile from '/backup/MALINA/rman/ctl_spfile_MALINA_20070716_c-670772455-20070716-00.rman';
7. shutdown immediate;
7.1. os command: orapwd file=/opt/oracle/product/10.2/dbs/orapw password=
7.2 restart rman (rman target /);
8. startup mount;
8.1 if need to change datafile location: (without temp tablespace)
run { set newname for datafile '/u1/' to '/u0/';
set newname for datafile '/u1/' to '/u0/';
restore database;
switch datafile all;
(after restore datafile for all log files) sql "alter database rename file  to "
(after restore add tempfile) alter tablespace TEMP add tempfile '/u0/...' size XXM reuse;
8.2 check/change archivelog destination
sql "alter system set archive_log_dest_1='location=/backup//arch';"
(alter system set log_archive_format='_%t_%s.arc')
(alter system set log_archive_start=TRUE)
9. restore database; -- if restoring from full backup
-- if restoring from incremental backup 
restore database preview; 
-- and one of 2 variants:
restore database;
restore database from tag='BACKUP INC_1';
restore database from tag='BACKUP INC_0';
recover database;
9.1 copy archlogs.
10. sql "recover database;" or (recover database until cancel;) or (recover database using backup controlfile UNTIL TIME '2004-09-10:12:00:00';)
10.1 -- if logfiles on another volume:
sql "alter database rename file  to ;"
11. sql "alter database open resetlogs;"
11.1 --add tempfile (in 10g it does automatically)
sql "alter tablespace TEMP add tempfile '/u0/oradata//temp01.dbf' size 1000M autoextend on unlimited reuse;"

12.1 review tnsnames & listener config files.
12.2 restart listener if needed.