RMAN> startup nomount;
Oracle instance started
Total System Global Area 839282688 bytes
Fixed Size 2217992 bytes
Variable Size 574621688 bytes
Database Buffers 260046848 bytes
Redo Buffers 2396160 bytes
RMAN> restore spfile to '/u01/app/oracle/product/11.2.0/dbhome_1/dbs/spfileasm.ora' from '/oradata/rmanbackup/c-3825267224-20130202-00';
Starting restore at 02-FEB-13
using channel ORA_DISK_1
channel ORA_DISK_1: restoring spfile from AUTOBACKUP /oradata/rmanbackup/c-3825267224-20130202-00
channel ORA_DISK_1: SPFILE restore from AUTOBACKUP complete
Finished restore at 02-FEB-13
spfile转换为pfile,然后将pfile中参数修改为普通fileystem上的
RMAN> shutdown immediate
Oracle instance shut down
RMAN> startup nomount;
connected to target database (not started)
Oracle instance started
Total System Global Area 839282688 bytes
Fixed Size 2217992 bytes
Variable Size 574621688 bytes
Database Buffers 260046848 bytes
Redo Buffers 2396160 bytes
RMAN> restore controlfile from '/oradata/rmanbackup/c-3825267224-20130202-00';
Starting restore at 02-FEB-13
using channel ORA_DISK_1
channel ORA_DISK_1: restoring control file
channel ORA_DISK_1: restore complete, elapsed time: 00:00:01
output file name=/oradata/asm/control01.ctl
output file name=/oradata/asm/control02.ctl
Finished restore at 02-FEB-13
RMAN> alter database mount;
database mounted
released channel: ORA_DISK_1
RMAN> alter database mount;
database mounted
released channel: ORA_DISK_1
RMAN> run
2> {allocate channel c1 type disk;
3> allocate channel c2 type disk;
4> set newname for datafile 1 to '/oradata/asm/system01.dbf';
5> set newname for datafile 2 to '/oradata/asm/sysaux01.dbf';
6> set newname for datafile 3 to '/oradata/asm/undotbs01.dbf';
7> set newname for datafile 4 to '/oradata/asm/users.dbf';
8> restore database;
9> switch datafile all;
10> recover database;
11> release channel c1;
12> release channel c2;
13> }
allocated channel: c1
channel c1: SID=20 device type=DISK
/
allocated channel: c2
channel c2: SID=21 device type=DISK
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
Starting restore at 02-FEB-13
channel c1: starting datafile backup set restore
channel c1: specifying datafile(s) to restore from backup set
channel c1: restoring datafile 00001 to /oradata/asm/system01.dbf
channel c1: restoring datafile 00002 to /oradata/asm/sysaux01.dbf
channel c1: restoring datafile 00003 to /oradata/asm/undotbs01.dbf
channel c1: restoring datafile 00004 to /oradata/asm/users.dbf
channel c1: reading from backup piece /oradata/rmanbackup/0fo0uqoj_1_1
channel c1: piece handle=/oradata/rmanbackup/0fo0uqoj_1_1 tag=TAG20130202T085338
channel c1: restored backup piece 1
channel c1: restore complete, elapsed time: 00:03:09
Finished restore at 02-FEB-13
datafile 1 switched to datafile copy
input datafile copy RECID=9 STAMP=806318426 file name=/oradata/asm/system01.dbf
datafile 2 switched to datafile copy
input datafile copy RECID=10 STAMP=806318426 file name=/oradata/asm/sysaux01.dbf
datafile 3 switched to datafile copy
input datafile copy RECID=11 STAMP=806318426 file name=/oradata/asm/undotbs01.dbf
datafile 4 switched to datafile copy
input datafile copy RECID=12 STAMP=806318426 file name=/oradata/asm/users.dbf
Starting recover at 02-FEB-13
starting media recovery
archived log for thread 1 with sequence 12 is already on disk as file +FLASH/asm/archivelog/2013_02_02/thread_1_seq_12.257.806316975
archived log for thread 1 with sequence 13 is already on disk as file +DATA/asm/redo01.log
archived log file name=+FLASH/asm/archivelog/2013_02_02/thread_1_seq_12.257.806316975 thread=1 sequence=12
archived log file name=+DATA/asm/redo01.log thread=1 sequence=13
media recovery complete, elapsed time: 00:00:01
Finished recover at 02-FEB-13
released channel: c1
released channel: c2
RMAN> alter database open resetlogs;
database opened然后删除在asm上的logfile,创建logfile于普通的filesystem上。
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/24237320/viewspace-1060191/ ,如需转载,请注明出处,否则将追究法律责任。