Chinaunix首页 | 论坛 | 博客
  • 博客访问: 642955
  • 博文数量: 70
  • 博客积分: 145
  • 博客等级: 入伍新兵
  • 技术积分: 1150
  • 用 户 组: 普通用户
  • 注册时间: 2012-10-11 08:15
个人简介

没有简介就是最好的简介

文章分类

全部博文(70)

文章存档

2020年(1)

2018年(2)

2017年(3)

2016年(11)

2015年(12)

2014年(16)

2013年(19)

2012年(6)

我的朋友

分类: Oracle

2016-04-05 15:31:41

SQL> startup

ORACLE instance started.

 

Total System Global Area 8885620736 bytes

Fixed Size                  2228744 bytes

Variable Size            1442844152 bytes

Database Buffers         7415529472 bytes

Redo Buffers               25018368 bytes

Database mounted.

ORA-10458: standby database requires recovery

ORA-01194: file 52 needs more recovery to be consistent

ORA-01110: data file 52: '/oracle/oradata/orcl/YDDS01.dbf'
备库重启的时候出现报错,手动恢复数据文件

SQL> recover managed standby database disconnect;

Media recovery complete.

SQL> alter database open;

alter database open

*

ERROR at line 1:

ORA-10456: cannot open standby database; media recovery session may be in progress
重新恢复数据

SQL> startup nomount;

ORACLE instance started.

 

Total System Global Area 8885620736 bytes

Fixed Size                  2228744 bytes

Variable Size            1442844152 bytes

Database Buffers         7415529472 bytes

Redo Buffers               25018368 bytes

 

恢复控制文件

RMAN> restore controlfile from '/backup/o1_mf_s_907811707_chojcw6k_.bkp';   此处恢复控制文件方式不正确(主库正常备份)

 

Starting restore at 30-MAR-16

using target database control file instead of recovery catalog

allocated channel: ORA_DISK_1

channel ORA_DISK_1: SID=197 device type=DISK

 

channel ORA_DISK_1: restoring control file

channel ORA_DISK_1: restore complete, elapsed time: 00:00:02

output file name=/oracle/oradata/phyorcl/control01.ctl

output file name=/oracle/fast_recovery_area/phyorcl/control02.ctl

Finished restore at 30-MAR-16

 

 

SQL> alter database mount;

 

Database altered.

 

 

控制文件恢复成功。

恢复数据文件

run

{

allocate channel d1 type disk;

allocate channel d2 type disk;

allocate channel d3 type disk;

allocate channel d4 type disk;

restore database until sequence  76423;

release channel d1;

release channel d2;

release channel d3;

release channel d4;

}

RMAN> alter database open resetlogs;

 

database opened

 

SQL> alter database recover managed standby database using current logfile disco

nnect from session;

alter database recover managed standby database using current logfile disconnect

 from session

*

ERROR at line 1:

ORA-01665: control file is not a standby control file

 

SQL> select controlfile_type from v$database;

 

CONTROL

-------

CURRENT


RMAN> restore  standby controlfile from '/backup/o1_mf_s_907811707_chojcw6k_.bkp';

 

Starting restore at 31-MAR-16

using target database control file instead of recovery catalog

allocated channel: ORA_DISK_1

channel ORA_DISK_1: SID=197 device type=DISK

 

channel ORA_DISK_1: restoring control file

channel ORA_DISK_1: restore complete, elapsed time: 00:00:01

output file name=/oracle/oradata/phyorcl/control01.ctl

output file name=/oracle/fast_recovery_area/phyorcl/control02.ctl

Finished restore at 31-MAR-16

 

RMAN> alter database mount;

 

database mounted

 

released channel: ORA_DISK_1

 

RMAN> alter database open;

 

RMAN-00571: ===========================================================

RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============

RMAN-00571: ===========================================================

RMAN-03002: failure of alter db command at 03/31/2016 08:15:19

ORA-10458: standby database requires recovery

ORA-01190: control file or data file 1 is from before the last RESETLOGS

ORA-01110: data file 1: '/oracle/oradata/orcl/system01.dbf'

问题原因:备库出现问题后,由于主库的归档日志已经删除,手动恢复的控制文件的时候,控制文件恢复不正确,导致备库出现异常。
解决方法:恢复控制文件的时候要恢复成standby模式
一种方式:restore  standby controlfile from '/backup/o1_mf_s_907811707_chojcw6k_.bkp';
二种方式:BACKUP CURRENT CONTROLFILE FOR STANDBY;主库备份controlfile为standby,备库进行恢复




阅读(2662) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~