者:容易 2013-05-04 14:19:27


首先通过全备份恢复spfile和控制文件。
修改pfile中控制文件以及相关监控日志文件的位置,修改完成后生成新的spfile
*.audit_file_dest='/app/oracle/admin/pnrdb/adump'
*.background_dump_dest='/app/oracle/admin/pnrdb/bdump'
*.control_files='/app/oracle/oradata/pnrdb/control01.ctl','/app/oracle/oradata/pnrdb/control02.ctl','/app/oracle/oradata/pnrdb/control03.ctl'
*.core_dump_dest='/app/oracle/admin/pnrdb/cdump'
*.log_archive_dest_1='location=/app/oracle/oradata/archive'
*.user_dump_dest='/app/oracle/admin/pnrdb/udump'

查询临时文件的位置
select file#,name from v$tempfile;
1 /app/oracle/oradata/pnrdb/temp_01.dbf


查询数据文件的位置和文件号
select file#,name from v$datafile;
        1 /u02/pnrdb/system01.dbf
        2 /u02/pnrdb/bipusr03.dbf
        3 /u02/pnrdb/sysaux01.dbf
        4 /u02/pnrdb/users01.dbf
        5 /u02/pnrdb/CADATA.DBF
        6 /u02/pnrdb/RADATA.DBF
        7 /u02/pnrdb/RCDATA.DBF
        8 /u02/pnrdb/ttydata.dbf
        9 /u02/pnrdb/ttyind.dbf
       10 /u02/pnrdb/ttydata1.dbf
       11 /u02/pnrdb/ttydata2.dbf

 
RMAN异路径还原

run  {
set newname for datafile 1 to '/app/oracle/oradata/pnrdb/system01.dbf';
set newname for datafile 2 to '/app/oracle/oradata/pnrdb/bipusr03.dbf';
set newname for datafile 3 to '/app/oracle/oradata/pnrdb/sysaux01.dbf';
set newname for datafile 4 to '/app/oracle/oradata/pnrdb/users01.dbf';
set newname for datafile 5 to '/app/oracle/oradata/pnrdb/CADATA.DBF';
set newname for datafile 6 to '/app/oracle/oradata/pnrdb/RADATA.DBF';
set newname for datafile 7 to '/app/oracle/oradata/pnrdb/RCDATA.DBF';
set newname for datafile 8 to '/app/oracle/oradata/pnrdb/ttydata.dbf';
set newname for datafile 9 to '/app/oracle/oradata/pnrdb/ttyind.dbf';
set newname for datafile 10 to '/app/oracle/oradata/pnrdb/ttydata1.dbf';
set newname for datafile 11 to '/app/oracle/oradata/pnrdb/ttydata2.dbf';
set newname for tempfile 1 to '/app/oracle/oradata/pnrdb/temp_01.dbf';
restore database;
switch datafile all;
}


查询redo日志的路径
select group#,member from v$logfile;
---------- ------- ------- ---------------------------------------- ---
        3         ONLINE  /u03/pnrdb/redo03_a.log                  NO
        3         ONLINE  /u03/pnrdb/redo03_b.log                  NO
        4         ONLINE  /u03/pnrdb/redo04_a.log                  NO
        4         ONLINE  /u03/pnrdb/redo04_b.log                  NO
        5         ONLINE  /u03/pnrdb/redo05_a.log                  NO
        5         ONLINE  /u03/pnrdb/redo05_b.log                  NO
        6         ONLINE  /u03/pnrdb/redo06_a.log                  NO
        6         ONLINE  /u03/pnrdb/redo06_b.log                  NO
 
修改redo日志的路径  
alter database rename file '/u03/pnrdb/redo03_a.log' to '/app/oracle/oradata/pnrdb/redo03_a.log ';
alter database rename file '/u03/pnrdb/redo03_b.log' to '/app/oracle/oradata/pnrdb/redo03_b.log ';
alter database rename file '/u03/pnrdb/redo04_a.log' to '/app/oracle/oradata/pnrdb/redo04_a.log ';
alter database rename file '/u03/pnrdb/redo04_b.log' to '/app/oracle/oradata/pnrdb/redo04_b.log ';
alter database rename file '/u03/pnrdb/redo05_a.log' to '/app/oracle/oradata/pnrdb/redo05_a.log ';
alter database rename file '/u03/pnrdb/redo05_b.log' to '/app/oracle/oradata/pnrdb/redo05_b.log ';
alter database rename file '/u03/pnrdb/redo06_a.log' to '/app/oracle/oradata/pnrdb/redo06_a.log ';
alter database rename file '/u03/pnrdb/redo06_b.log' to '/app/oracle/oradata/pnrdb/redo06_b.log ';

One Response


    还没有评论!
1  

Leave your comment

请留下您的姓名(*)

请输入正确的邮箱地址(*)

请输入你的评论(*)


感谢开源 © 2016. All rights reserved.&3Q Open Source&^_^赣ICP备15012863^_^
乐于分享共同进步 KreativeThemes