Oracle 11g单实例RMAN恢复到Oracle 11g RAC(5)

MEMBER
-----------------------------------------------------------------
/u01/app/oracle/oradata/orcl/redo03.log
/u01/app/oracle/oradata/orcl/redo02.log
/u01/app/oracle/oradata/orcl/redo01.log

(3) 查看临时文件

SQL> select name from v$tempfile;

NAME
-----------------------------------------------------------------
/u01/app/oracle/oradata/orcl/temp01.dbf

(4) 查看源端数据文件构造RMAN RUN脚本。

SQL> set line 80
SQL> set pagesize 9999
SQL> col file_name for a60
SQL> select 'set newname for datafile '||file_id||' to '''||'+DATA'||''';' cmd from dba_data_files order by file_id;

CMD
-----------------------------------------------------------------------------
set newname for datafile 1 to '+DATA';
set newname for datafile 2 to '+DATA';
set newname for datafile 3 to '+DATA';
set newname for datafile 4 to '+DATA';
set newname for datafile 5 to '+DATA';

SQL> select 'set newname for tempfile '||file_id||' to '''||'+DATA'||''';' cmd from dba_temp_files;

CMD
-----------------------------------------------------------------------------
set newname for tempfile 1 to '+DATA';

8. 恢复数据文件

#通过RMAN重命名数据文件进行恢复到本地的文件系统上。

rman target /

run {
set newname for datafile 1 to '+DATA';
set newname for datafile 2 to '+DATA';
set newname for datafile 3 to '+DATA';
set newname for datafile 4 to '+DATA';
set newname for datafile 5 to '+DATA';
set newname for tempfile 1 to '+DATA';
restore database;
switch datafile all;
switch tempfile all;
}


executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
Starting restore at 2017/09/16 10:11:14
using channel ORA_DISK_1
channel ORA_DISK_1: starting datafile backup set restore
channel ORA_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_DISK_1: restoring datafile 00001 to +DATA
channel ORA_DISK_1: restoring datafile 00003 to +DATA
channel ORA_DISK_1: restoring datafile 00005 to +DATA
channel ORA_DISK_1: reading from backup piece /u01/orabak/full_ORCL_20170916_2_1
channel ORA_DISK_1: piece handle=/u01/orabak/full_ORCL_20170916_2_1 tag=TAG20170916T082835
channel ORA_DISK_1: restored backup piece 1
channel ORA_DISK_1: restore complete, elapsed time: 00:00:25
channel ORA_DISK_1: starting datafile backup set restore
channel ORA_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_DISK_1: restoring datafile 00002 to +DATA
channel ORA_DISK_1: restoring datafile 00004 to +DATA
channel ORA_DISK_1: reading from backup piece /u01/orabak/full_ORCL_20170916_1_1
channel ORA_DISK_1: piece handle=/u01/orabak/full_ORCL_20170916_1_1 tag=TAG20170916T082835
channel ORA_DISK_1: restored backup piece 1
channel ORA_DISK_1: restore complete, elapsed time: 00:00:25
Finished restore at 2017/09/16 10:12:05
datafile 1 switched to datafile copy
input datafile copy RECID=6 STAMP=954843125 file name=+DATA/orcl/datafile/system.268.954843075
datafile 2 switched to datafile copy
input datafile copy RECID=7 STAMP=954843125 file name=+DATA/orcl/datafile/sysaux.271.954843101
datafile 3 switched to datafile copy
input datafile copy RECID=8 STAMP=954843125 file name=+DATA/orcl/datafile/undotbs1.269.954843075
datafile 4 switched to datafile copy
input datafile copy RECID=9 STAMP=954843126 file name=+DATA/orcl/datafile/users.272.954843101
datafile 5 switched to datafile copy
input datafile copy RECID=10 STAMP=954843126 file name=+DATA/orcl/datafile/tjoa.270.954843075
renamed tempfile 1 to +DATA in control file

9. 恢复数据库

RMAN> list backup of archivelog all;

List of Backup Sets
===================


BS Key  Size      Device Type Elapsed Time Completion Time   
------- ---------- ----------- ------------ -------------------
5      3.00K      DISK        00:00:00    2017/09/16 08:29:23
        BP Key: 5  Status: AVAILABLE  Compressed: NO  Tag: TAG20170916T082923
        Piece Name: /u01/orabak/arch_ORCL_20170916_6_1

List of Archived Logs in backup set 5
  Thrd Seq    Low SCN    Low Time            Next SCN  Next Time
  ---- ------- ---------- ------------------- ---------- ---------
  1    120    2896890    2017/09/16 08:29:19 2896899    2017/09/16 08:29:19
  1    121    2896899    2017/09/16 08:29:19 2896908    2017/09/16 08:29:23
  1    122    2896908    2017/09/16 08:29:23 2896917    2017/09/16 08:29:23

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/aa77a59583b6c95f5802bacd557127d5.html