2009-11-20

Restoring 10g database to another location

Restoring M02 (10.2.0.4) from cold RMAN backup of M03 (10.2.0.3).
1.    stop all for M02
2.    delete M02 data files and redo
3.    change owner to ora10P1 (10.2.0.3 owner) for oradata and redo directories
/oracle/oradata/01/DHMERM02
/oracle/redo/DHMERM02
4.    copy M03 init file to new home (10.2.0.3)
5.    change $ORACLE_HOME and $ORACLE_SID to new home and SID=M03
6.    startup nomount as ora10P1
7.    restore control file
restore controlfile from '/oracle/oradata/01/DHMERM02/backup/DHMERM03/2009-09-17/dhmerm03_cf_1ukpfn6a_1_1';
8.    mount database
9.    copy backup files or NFS
10.    catalog the backup pieces
catalog backuppiece '/oracle/oradata/01/DHMERM02/backup/DHMERM03/2009-09-17/dhmerm03_cf_1ukpfn6a_1_1';
catalog backuppiece '/oracle/oradata/01/DHMERM02/backup/DHMERM03/2009-09-17/dhmerm03_db_1mkpfesv_1_1';
11.    create soft links for oradata and redo directories to link original M03 paths to M02 directories.
Alternatively  you can use SET NEWNAME FOR DATAFILE|TEMPFILE to rename files.
12.    restore database with RMAN
run
{
ALLOCATE CHANNEL d1 DEVICE TYPE DISK;
ALLOCATE CHANNEL d2 DEVICE TYPE DISK;
restore database;
}
alter database open resetlogs;
13.    prepare create control file script to rename database and files
14.    shutdown M03 and startup nomount M02
15.    create control file and open M02 with resetlogs
16.    add file to TEMP tablespace
17.    shutdown M02
18.    change ownership of oradata and redo directories and files to ora10M2 (10.2.0.4 owner)
19.    upgrade M02 to 10.2.0.4
lsnrctl start listener_name
sqlplus / as sysdba
startup upgrade
@?/rdbms/admin/utlu102i.sql
@?/rdbms/admin/catupgrd.sql
shutdown immediate
startup
@?/rdbms/admin/utlrp.sql