ITPub博客

首页 > Linux操作系统 > Linux操作系统 > 双节点rac环境异机恢复到单节点环境中遇到的报错

双节点rac环境异机恢复到单节点环境中遇到的报错

原创 Linux操作系统 作者:墨雪-guoyan 时间:2013-08-23 16:50:25 0 删除 编辑

源库环境:linux5.5 oracle 双节点   测试库环境:linux5.5  oracle11g 单节点

1、恢复完数据库文件后recover出错;

 

archived log file name=/u01/app/oracle/product/11.2.0/db_1/dbs/arch2_13345_754742428.dbf thread=2 sequence=13345
unable to find archived log
archived log thread=2 sequence=13346
released channel: c1
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of recover command at 08/22/2013 11:36:07
RMAN-06054: media recovery requesting unknown archived log for thread 2 with sequence 13346 and starting SCN of 659478044

这个错误是和恢复全不全有关系,如果你想不完全恢复就不用在意,我这里还是想办法应用了一下错误提示中的日志,首先从报错来看是这个日志没应用,我在相应的目录下查看发现这个日志本来就没restore过来,于是就去源库拷,但是源库的归档日志是放在asm磁盘上,没法直接拷,就用rman的backup as copy  但是中间有报错了,

RMAN> run {
2> allocate channel d1 type disk;
3> backup as copy archivelog from sequence 13346 format '/opt/app/oracle/2_13346.arc';
4> release channel d1;
5> }
using target database control file instead of recovery catalog
allocated channel: d1
channel d1: sid=2152 instance=curprod3 devtype=DISK

Starting backup at 23-JUL-08
released channel: d1

RMAN-03002: failure of backup command at 07/23/2008 17:33:45
RMAN-20242: specification does not match any archive log in the recovery catalog

这个问题 在metlink上解决:


CAUSE

This is a RAC database and the thread number was not specified in the backup statement.

SOLUTION

Specify the thread as part of the backup command, for instance:
backup archivelog from sequence 13346 thread 2  format '/opt/app/oracle/2_13346.arc';

拷到备库应用完还是提示有日志需要应用,由于这里不需要完全恢复,因此就直接aopen resetlogs,但是这个是还报错:

RMAN> alter database open resetlogs;

RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of alter db command at 08/22/2013 16:08:40
ORA-00349: failure obtaining block size for '+data2'
ORA-15001: diskgroup "DATA2" does not exist or is not mounted

这个是logfile找不到原因,错误中提升的 data2是源库的文件路径

于是就重建控制文件,修改logifle的路径 在此open resetlogs 就可以了

简单描述一下如何重建控制文件:

1、alter database backup controlfile to trace,然后在alert日志文件中找到对应的trace文件,编辑可用信息:
CREATE CONTROLFILE REUSE DATABASE "ORC5BMP" RESETLOGS FORCE LOGGING ARCHIVELOG
    MAXLOGFILES 192
    MAXLOGMEMBERS 3
    MAXDATAFILES 1024
    MAXINSTANCES 32
    MAXLOGHISTORY 4672
LOGFILE
  GROUP 1 '/u01/app/oracle/redo1.dbf'  SIZE 50M BLOCKSIZE 512,
  GROUP 2 '/u01/app/oracle/redo2.dbf'  SIZE 50M BLOCKSIZE 512,
  GROUP 3 '/u01/app/oracle/redo3.dbf'  SIZE 50M BLOCKSIZE 512,
  GROUP 4 '/u01/app/oracle/redo4.dbf'  SIZE 50M BLOCKSIZE 512,
  GROUP 5 '/u01/app/oracle/redo5.dbf'  SIZE 512M BLOCKSIZE 512,
  GROUP 6 '/u01/app/oracle/redo6.dbf'  SIZE 512M BLOCKSIZE 512
-- STANDBY LOGFILE
DATAFILE
  '+DATA1/orc5bmp/datafile/system.277.824059539',
  '+DATA1/orc5bmp/datafile/sysaux.278.824059539',
  '+DATA1/orc5bmp/datafile/undotbs1.279.824059541',
  '+DATA1/orc5bmp/datafile/undotbs2.285.824059969',
  '+DATA1/orc5bmp/datafile/users.284.824059969',
  '+DATA1/test1/datafile/bmp_dat01.dbf',
  '+DATA1/test1/datafile/bmp_dat02.dbf',
  '+DATA1/test1/datafile/bmp_dat03.dbf',
  '+DATA1/test1/datafile/system2.dbf',
  '+DATA1/test1/datafile/sysaux2.dbf',
  '+DATA1/test1/datafile/bmp_idx01.dbf',
  '+DATA1/test1/datafile/bmp_idx02.dbf',
  '+DATA1/test1/datafile/bmp_idx03.dbf',
  '+DATA1/test1/datafile/system3.dbf'
CHARACTER SET ZHS16GBK
;

重建过程中其实也有报错:

SQL> @/u01/app/oracle/diag/rdbms/orc5bmp/test1/trace/test.sql
ORACLE instance started.

Total System Global Area  705662976 bytes
Fixed Size                  2216704 bytes
Variable Size             201329920 bytes
Database Buffers          499122176 bytes
Redo Buffers                2994176 bytes
    AXLOGMEMBERS 3
    *
ERROR at line 3:
ORA-01967: invalid option for CREATE CONTROLFILE

我的解决办法就是:在创建脚本里把AXLOGMEMBERS 3 参数取了~~~

接着再 alter database open resetlogs


SQL> alter database open resetlogs;
alter database open resetlogs
*
ERROR at line 1:
ORA-38856: cannot mark instance UNNAMED_INSTANCE_2 (redo thread 2) as enabled

 

metlink解决办法:
SQL> alter system set "_no_recovery_through_resetlogs"=true scope=memory;

System altered.

至于为啥要设置,暂时还没搞懂,就此为止不完全异机恢复完毕

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

请登录后发表评论 登录
全部评论

注册时间:2013-02-18

  • 博文量
    14
  • 访问量
    68181