重庆思庄Oracle、Redhat认证学习论坛

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 1856|回复: 0
打印 上一主题 下一主题

[Oracle] ORA-10458、ORA-01196、ORA-01110异常处理

[复制链接]
跳转到指定楼层
楼主
发表于 2022-1-22 23:56:41 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
主备数据库版本:oracle 11.2.0.4
问题描述:主备库都开启的状态单独重启备库出现以下异常
SQL> startup
ORACLE instance started.
Total System Global Area 3206836224 bytes
Fixed Size                 2257520 bytes
Variable Size           1811942800 bytes
Database Buffers        1375731712 bytes
Redo Buffers              16904192 bytes
Database mounted.
ORA-10458: standby database requires recovery
ORA-01196: file 1 is inconsistent due to a failed media recoverysession
ORA-01110: data file 1:'/u01/app/oracle/oradata/orcl151/system01.dbf'
查询资料,确认到异常原因为日志的scn与控制文件不一致,以下为处理步骤:
备库启动到mount状态:
SQL> shutdown immediate;
ORA-01109: database not open
Database dismounted.
ORACLE instance shut down.
SQL> startup mount;
ORACLE instance started.
Total System Global Area 3206836224 bytes
Fixed Size                 2257520 bytes
Variable Size            1811942800bytes
Database Buffers        1375731712 bytes
Redo Buffers              16904192 bytes
Database mounted.
SQL> alter database recover managed standby database usingcurrent logfile disconnect from session;
Database altered.
主库操作:
SQL> alter system switch logfile;
System altered.
SQL> select thread#,sequence#,to_char(first_time,'yyyy-mm-ddhh24:mi:ss'),applied from v$archived_log where first_time>sysdate-1 order by1,2;
…(此处省略)
   THREAD#  SEQUENCE#TO_CHAR(FIRST_TIME,'YYYY-MM-DDHH24:MI: APPLIED
---------- ---------- --------------------------------------------------------
         1        138 2022-01-22 22:43:24                    YES
         1        139 2022-01-22 22:43:51                    NO
         1        139 2022-01-22 22:43:51                    YES
         1        140 2022-01-22 22:46:05                    NO
         1        140 2022-01-22 22:46:05                    YES
         1        141 2022-01-22 22:46:41                    NO
         1        141 2022-01-22 22:46:41                    YES
         1        142 2022-01-22 22:50:06                    NO
         1        142 2022-01-22 22:50:06                    NO
42 rows selected.

注意:待全部归档日志归档完成,在到备库操作。
说明:同一时间点APPLIED值一个为NO,一个为YES,才算正常。
此时备库操作:
SQL> alter database recover managed standby database cancle;
alter database recover managed standby database cancle
*
ERROR at line 1:
ORA-00274: illegal recovery option CANCLE
确认主备库监听正常开启,然后tnsping测试互通性,发现备库tnsping不通主库,而主库能tnsping通备库.
查看主库防火墙,确认为开启状态,将其关闭后主备库通信无问题.

备库再次执行:
SQL> alter database recover managed standby database cancel;
Database altered.
SQL> alter database open;
Database altered.
SQL> alter database recover managed standby database usingcurrent logfile disconnect from session;
Database altered.
成功开启备库.

分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
收藏收藏 支持支持 反对反对
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

QQ|手机版|小黑屋|重庆思庄Oracle、Redhat认证学习论坛 ( 渝ICP备12004239号-4 )

GMT+8, 2024-9-10 04:54 , Processed in 0.079266 second(s), 21 queries .

重庆思庄学习中心论坛-重庆思庄科技有限公司论坛

© 2001-2020

快速回复 返回顶部 返回列表