alog start with '/data/IP' noprompt;
searching for all files that match the pattern /data/IP
List of Files Unknown to the Database
=====================================
File Name: /data/IP/archivelog/2015_09_25/o1_mf_1_7945_c0bh8dgv_.arc
File Name: /data/IP/archivelog/2015_09_25/o1_mf_1_7942_c0bc4hv5_.arc
File Name: /data/IP/archivelog/2015_09_25/o1_mf_1_7944_c0bfx7l2_.arc
File Name: /data/IP/archivelog/2015_09_25/o1_mf_1_7940_c0b7ntyf_.arc
File Name: /data/IP/archivelog/2015_09_25/o1_mf_1_7941_c0b9kdlw_.arc
File Name: /data/IP/archivelog/2015_09_25/o1_mf_1_7943_c0bdkzyp_.arc
cataloging files...
cataloging done
List of Cataloged Files
=======================
File Name: /data/IP/archivelog/2015_09_25/o1_mf_1_7945_c0bh8dgv_.arc
File Name: /data/IP/archivelog/2015_09_25/o1_mf_1_7942_c0bc4hv5_.arc
File Name: /data/IP/archivelog/2015_09_25/o1_mf_1_7944_c0bfx7l2_.arc
File Name: /data/IP/archivelog/2015_09_25/o1_mf_1_7940_c0b7ntyf_.arc
File Name: /data/IP/archivelog/2015_09_25/o1_mf_1_7941_c0b9kdlw_.arc
File Name: /data/IP/archivelog/2015_09_25/o1_mf_1_7943_c0bdkzyp_.arc
RMAN> recover database until time "to_date('20150925 18:00:00','yyyymmdd hh24:mi:ss')";
Starting recover at 25-SEP-15
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=1641 devtype=DISK
allocated channel: ORA_DISK_2
channel ORA_DISK_2: sid=1639 devtype=DISK
allocated channel: ORA_DISK_3
channel ORA_DISK_3: sid=1638 devtype=DISK
allocated channel: ORA_DISK_4
channel ORA_DISK_4: sid=1637 devtype=DISK
allocated channel: ORA_DISK_5
channel ORA_DISK_5: sid=1636 devtype=DISK
starting media recovery
archive log thread 1 sequence 7939 is already on disk as file /data/IP/archivelog/2015_09_25/o1_mf_1_7939_c0b5fr87_.arc
archive log thread 1 sequence 7940 is already on disk as file /data/IP/archivelog/2015_09_25/o1_mf_1_7940_c0b7ntyf_.arc
archive log filename=/data/IP/archivelog/2015_09_25/o1_mf_1_7939_c0b5fr87_.arc thread=1 sequence=7939
archive log filename=/data/IP/archivelog/2015_09_25/o1_mf_1_7940_c0b7ntyf_.arc thread=1 sequence=7940
media recovery complete, elapsed time: 00:04:07
Finished recover at 25-SEP-15
? ? 进入sqlplus,修改联机重做日志的位置.因为这个位置还是生产库的,还原库上不一定有这个路径.
SQL> select 'alter database rename file ''' ||member|| ''' to ''/data/oracledata/oradata/mvbox/redo' || rownum ||'.log'';' sql from v$logfile;
SQL
alter database rename file '/data/oracledata/oradata/mvbox/redo04.log1' to '/data/oracledata/oradata/mvbox/redo1.log';
alter database rename file '/data/dblog/redo04.log2' to '/data/oracledata/oradata/mvbox/redo2.log';
alter database rename file '/data/oracledata/oradata/mvbox/redo05.log3' to '/data/oracledata/oradata/mvbox/redo3.log';
alter database rename file '/data/dblog/redo05.log4' to '/data/oracledata/oradata/mvbox/redo4.log';
alter database rename file '/data/oracledata/oradata/mvbox/redo06.log5' to '/data/oracledata/oradata/mvbox/redo5.log';
alter database rename file '/data/dblog/redo06.log6' to '/data/oracledata/oradata/mvbox/redo6.log';
alter database rename file '/data/oracledata/oradata/mvbox/redo07.log7' to '/data/oracledata/oradata/mvbox/redo7.log';
alter database rename file '/data/dblog/redo07.log8' to '/data/oracledata/oradata/mvbox/redo8.log';
alter database rename file '/data/oracledata/oradata/mvbox/redo