ITPub博客

首页 > Linux操作系统 > Linux操作系统 > 单实例恢复RAC数据库步骤(三)

单实例恢复RAC数据库步骤(三)

原创 Linux操作系统 作者:yangtingkun 时间:2011-02-28 23:57:42 0 删除 编辑

简单描述在测试服务器的单机环境恢复RAC产品数据库的步骤。

这一篇介绍数据库恢复过程。

单实例恢复RAC数据库步骤(一):http://yangtingkun.itpub.net/post/468/514155

单实例恢复RAC数据库步骤(二):http://yangtingkun.itpub.net/post/468/514246

 

 

首先恢复归档文件:

rman target /

Recovery Manager: Release 10.2.0.5.0 - Production on Mon Jan 17 16:15:23 2011

Copyright (c) 1982, 2007, Oracle.  All rights reserved.

connected to target database: ORCL (DBID=1264586523, not open)

RMAN> restore archivelog sequence between 13941 and 13942 thread 2;

Starting restore at 17-JAN-11
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=1638 devtype=DISK

channel ORA_DISK_1: starting archive log restore to default destination
channel ORA_DISK_1: restoring archive log
archive log thread=2 sequence=13941
channel ORA_DISK_1: reading from backup piece /rman/backup/orcl/5tm2af71_1_1
channel ORA_DISK_1: restored backup piece 1
failover to piece handle=/data/backup/orcl/5tm2af71_1_1 tag=TAG20110117T044518
channel ORA_DISK_1: restore complete, elapsed time: 00:00:02
channel ORA_DISK_1: starting archive log restore to default destination
channel ORA_DISK_1: restoring archive log
archive log thread=2 sequence=13942
channel ORA_DISK_1: reading from backup piece /rman/backup/orcl/60m2an40_1_1
channel ORA_DISK_1: restored backup piece 1
failover to piece handle=/data/backup/orcl/60m2an40_1_1 tag=TAG20110117T070016
channel ORA_DISK_1: restore complete, elapsed time: 00:00:03
Finished restore at 17-JAN-11

RMAN> restore archivelog sequence between 868 and 869 thread 1;

Starting restore at 17-JAN-11
using channel ORA_DISK_1

channel ORA_DISK_1: starting archive log restore to default destination
channel ORA_DISK_1: restoring archive log
archive log thread=1 sequence=868
channel ORA_DISK_1: reading from backup piece /rman/backup/orcl/5um2af72_1_1
channel ORA_DISK_1: restored backup piece 1
failover to piece handle=/data/backup/orcl/5um2af72_1_1 tag=TAG20110117T044518
channel ORA_DISK_1: restore complete, elapsed time: 00:00:01
channel ORA_DISK_1: starting archive log restore to default destination
channel ORA_DISK_1: restoring archive log
archive log thread=1 sequence=869
channel ORA_DISK_1: reading from backup piece /rman/backup/orcl/61m2an40_1_1
channel ORA_DISK_1: restored backup piece 1
failover to piece handle=/data/backup/orcl/61m2an40_1_1 tag=TAG20110117T070016
channel ORA_DISK_1: restore complete, elapsed time: 00:00:01
Finished restore at 17-JAN-11

RMAN> exit


Recovery Manager complete.

利用sqlplus执行日志文件重命名和恢复工作:

$ sqlplus / as sysdba

SQL*Plus: Release 10.2.0.5.0 - Production on Mon Jan 17 16:06:42 2011

Copyright (c) 1982, 2010, Oracle.  All Rights Reserved.


Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - 64bit Production
With the Partitioning, Data Mining and Real Application Testing options

SQL> ALTER DATABASE RENAME FILE '+DATADG/orcl/onlinelog/group_7.266.740450465' TO '/data/oradata/orcl/redo_7_1_1.log';

Database altered.

SQL> ALTER DATABASE RENAME FILE '+FRADG/orcl/onlinelog/group_7.304.740450465' TO '/data/oradata/orcl/redo_7_1_2.log';

Database altered.

SQL> ALTER DATABASE RENAME FILE '+DATADG/orcl/onlinelog/group_8.302.740450465' TO '/data/oradata/orcl/redo_8_1_1.log';

Database altered.

SQL> ALTER DATABASE RENAME FILE '+FRADG/orcl/onlinelog/group_8.287.740450465' TO '/data/oradata/orcl/redo_8_1_2.log';

Database altered.

SQL> ALTER DATABASE RENAME FILE '+DATADG/orcl/onlinelog/group_9.300.740450467' TO '/data/oradata/orcl/redo_9_1_1.log';

Database altered.

SQL> ALTER DATABASE RENAME FILE '+FRADG/orcl/onlinelog/group_9.275.740450467' TO '/data/oradata/orcl/redo_9_1_2.log';

Database altered.

SQL> ALTER DATABASE RENAME FILE '+DATADG/orcl/onlinelog/group_10.303.740450467' TO '/data/oradata/orcl/redo_10_2_1.log';

Database altered.

SQL> ALTER DATABASE RENAME FILE '+FRADG/orcl/onlinelog/group_10.303.740450469' TO '/data/oradata/orcl/redo_10_2_2.log';

Database altered.

SQL> ALTER DATABASE RENAME FILE '+DATADG/orcl/onlinelog/group_11.301.740450469' TO '/data/oradata/orcl/redo_11_2_1.log';

Database altered.

SQL> ALTER DATABASE RENAME FILE '+FRADG/orcl/onlinelog/group_11.268.740450469' TO '/data/oradata/orcl/redo_11_2_2.log';

Database altered.

SQL> ALTER DATABASE RENAME FILE '+DATADG/orcl/onlinelog/group_12.258.740450471' TO '/data/oradata/orcl/redo_12_2_1.log';

Database altered.

SQL> ALTER DATABASE RENAME FILE '+FRADG/orcl/onlinelog/group_12.310.740450471' TO '/data/oradata/orcl/redo_12_2_2.log';

Database altered.

SQL> RECOVER DATABASE UNTIL CANCEL USING BACKUP CONTROLFILE
ORA-00279: change 913655386 generated at 01/17/2011 04:40:28 needed for thread 2
ORA-00289: suggestion : /data/oradata/orcl/archivelog/2_13941_738351476.dbf
ORA-00280: change 913655386 for thread 2 is in sequence #13941


Specify log: {=suggested | filename | AUTO | CANCEL}

ORA-00279: change 913655386 generated at 01/17/2011 04:40:33 needed for thread 1
ORA-00289: suggestion : /data/oradata/orcl/archivelog/1_868_738351476.dbf
ORA-00280: change 913655386 for thread 1 is in sequence #868


Specify log: {=suggested | filename | AUTO | CANCEL}

ORA-00279: change 913655567 generated at 01/17/2011 04:45:37 needed for thread 1
ORA-00289: suggestion : /data/oradata/orcl/archivelog/1_869_738351476.dbf
ORA-00280: change 913655567 for thread 1 is in sequence #869
ORA-00278: log file '/data/oradata/orcl/archivelog/1_868_738351476.dbf' no
longer needed for this recovery


Specify log: {=suggested | filename | AUTO | CANCEL}

ORA-00279: change 913655570 generated at 01/17/2011 04:45:12 needed for thread 2
ORA-00289: suggestion : /data/oradata/orcl/archivelog/2_13942_738351476.dbf
ORA-00280: change 913655570 for thread 2 is in sequence #13942
ORA-00278: log file '/data/oradata/orcl/archivelog/2_13941_738351476.dbf' no
longer needed for this recovery


Specify log: {=suggested | filename | AUTO | CANCEL}

ORA-00279: change 913670182 generated at 01/17/2011 07:00:05 needed for thread 2
ORA-00289: suggestion : /data/oradata/orcl/archivelog/2_13943_738351476.dbf
ORA-00280: change 913670182 for thread 2 is in sequence #13943
ORA-00278: log file '/data/oradata/orcl/archivelog/2_13942_738351476.dbf' no
longer needed for this recovery


Specify log: {=suggested | filename | AUTO | CANCEL}
/data/oradata/orcl/archivelog/archive_2_13943.log
ORA-00279: change 913670208 generated at 01/17/2011 07:00:34 needed for thread 1
ORA-00289: suggestion : /data/oradata/orcl/archivelog/1_870_738351476.dbf
ORA-00280: change 913670208 for thread 1 is in sequence #870
ORA-00278: log file '/data/oradata/orcl/archivelog/1_869_738351476.dbf' no
longer needed for this recovery


Specify log: {=suggested | filename | AUTO | CANCEL}
/data/oradata/orcl/archivelog/archive_1_870.log
ORA-00279: change 913768457 generated at 01/17/2011 08:36:12 needed for thread 2
ORA-00289: suggestion : /data/oradata/orcl/archivelog/2_13944_738351476.dbf
ORA-00280: change 913768457 for thread 2 is in sequence #13944
ORA-00278: log file '/data/oradata/orcl/archivelog/archive_2_13943.log' no
longer needed for this recovery


Specify log: {=suggested | filename | AUTO | CANCEL}
/data/oradata/orcl/archivelog/archive_2_13944.log
ORA-00279: change 913891849 generated at 01/17/2011 09:27:57 needed for thread 2
ORA-00289: suggestion : /data/oradata/orcl/archivelog/2_13945_738351476.dbf
ORA-00280: change 913891849 for thread 2 is in sequence #13945
ORA-00278: log file '/data/oradata/orcl/archivelog/archive_2_13944.log' no
longer needed for this recovery


Specify log: {=suggested | filename | AUTO | CANCEL}
/data/oradata/orcl/archivelog/archive_2_13945.log
ORA-00279: change 913979720 generated at 01/17/2011 10:06:52 needed for thread 2
ORA-00289: suggestion : /data/oradata/orcl/archivelog/2_13946_738351476.dbf
ORA-00280: change 913979720 for thread 2 is in sequence #13946
ORA-00278: log file '/data/oradata/orcl/archivelog/archive_2_13945.log' no
longer needed for this recovery


Specify log: {=suggested | filename | AUTO | CANCEL}
/data/oradata/orcl/archivelog/archive_2_13946.log
ORA-00279: change 913979790 generated at 01/17/2011 10:07:20 needed for thread 1
ORA-00289: suggestion : /data/oradata/orcl/archivelog/1_871_738351476.dbf
ORA-00280: change 913979790 for thread 1 is in sequence #871
ORA-00278: log file '/data/oradata/orcl/archivelog/archive_1_870.log' no longer
needed for this recovery


Specify log: {=suggested | filename | AUTO | CANCEL}
cancel
Media recovery cancelled.
SQL> SELECT NAME FROM V$TEMPFILE;

NAME
--------------------------------------------------------------------------------
+DATADG/orcl/tempfile/temp.263.736805823

SQL> ALTER DATABASE RENAME FILE '+DATADG/orcl/tempfile/temp.263.736805823' TO '/data/oradata/orcl/temp01.dbf';

Database altered.

SQL> ALTER DATABASE TEMPFILE '/data/oradata/orcl/temp01.dbf' DROP;     

Database altered.

SQL> ALTER DATABASE OPEN RESETLOGS;

Database altered.

SQL> ALTER TABLESPACE TEMP ADD TEMPFILE '/data/oradata/orcl/temp01.dbf' SIZE 4G;

Tablespace altered.

重建临时文件,然后将数据库打开,至此数据库恢复完毕。

如果数据库打算长期适用,可以根据现有的pfile创建SPFILE,方便以后的管理操作。

 

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/4227/viewspace-688150/,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论
暂无介绍

注册时间:2007-12-29

  • 博文量
    1955
  • 访问量
    10523586