案例:Standby RAC遭遇ORA-1157,1111,1110导致实例crash处理

环境:RHEL 6.5 + Oracle RAC 11.2.0.4 + Dataguard

今天在实验环境的Pirmary RAC主库上做了一个增加表空间的操作,结果Standby RAC启动同步后直接crash,具体报错如下:

Fri Aug 11 19:14:20 2017
Completed: ALTER DATABASE MOUNT /* db agent *//* {1:53752:2} */
ALTER DATABASE OPEN /* db agent *//* {1:53752:2} */
AUDIT_TRAIL initialization parameter is changed to OS, as DB is NOT compatible for database opened with read-only access
This instance was first to open
Fri Aug 11 19:14:23 2017
Using STANDBY_ARCHIVE_DEST parameter default value as USE_DB_RECOVERY_FILE_DEST
Beginning Standby Crash Recovery.
Serial Media Recovery started
Fri Aug 11 19:14:24 2017
Managed Standby Recovery starting Real Time Apply
Fri Aug 11 19:14:25 2017
Warning: VKTM detected a time drift.
Time drifts can result in an unexpected behavior such as time-outs. Please check trace file for more details.
Fri Aug 11 19:14:26 2017
Primary database is in MAXIMUM PERFORMANCE mode
Fri Aug 11 19:14:26 2017
Primary database is in MAXIMUM PERFORMANCE mode
RFS[1]: Assigned to RFS process 4031
RFS[1]: Selected log 11 for thread 1 sequence 171 dbid -1785877518 branch 919999037
Standby Crash Recovery aborted due to error 1111.
Errors in file /opt/app/oracle/diag/rdbms/mynas/jyzhao1/trace/jyzhao1_ora_3923.trc:
ORA-01111: name for data file 10 is unknown - rename to correct file
ORA-01110: data file 10: '/opt/app/oracle/product/11.2.0/dbhome_1/dbs/UNNAMED00010'
ORA-01157: cannot identify/lock data file 10 - see DBWR trace file
ORA-01111: name for data file 10 is unknown - rename to correct file
ORA-01110: data file 10: '/opt/app/oracle/product/11.2.0/dbhome_1/dbs/UNNAMED00010'
Fri Aug 11 19:14:27 2017
RFS[2]: Assigned to RFS process 4029
RFS[2]: Selected log 13 for thread 1 sequence 170 dbid -1785877518 branch 919999037
Fri Aug 11 19:14:28 2017
RFS[3]: Assigned to RFS process 4043
RFS[3]: Selected log 22 for thread 2 sequence 134 dbid -1785877518 branch 919999037
RFS[4]: Assigned to RFS process 4041
RFS[4]: Selected log 23 for thread 2 sequence 135 dbid -1785877518 branch 919999037
Completed Standby Crash Recovery.
Fri Aug 11 19:14:31 2017
Abort recovery for domain 0
Errors in file /opt/app/oracle/diag/rdbms/mynas/jyzhao1/trace/jyzhao1_ora_3923.trc:
ORA-10458: standby database requires recovery
ORA-01157: cannot identify/lock data file 10 - see DBWR trace file
ORA-01111: name for data file 10 is unknown - rename to correct file
ORA-01110: data file 10: '/opt/app/oracle/product/11.2.0/dbhome_1/dbs/UNNAMED00010'
ORA-10458 signalled during: ALTER DATABASE OPEN /* db agent *//* {1:53752:2} */...
Fri Aug 11 19:14:33 2017
Shutting down instance (abort)
License high water mark = 9
USER (ospid: 4089): terminating the instance
Instance terminated by USER, pid = 4089
Fri Aug 11 19:14:34 2017
Instance shutdown complete

根据报错查到MOS相关文档:

How to resolve ORA-01111 ORA-01110 ORA-01157 in a physical standby database (文档 ID 1416554.1)

这里应该就可以猜测出原因基本就是由于主库建立一个文件,备库同步日志,没有创建正确。

MOS 解决方案核心内容:

SQL>ALTER DATABASE RECOVER MANAGED STANDBY DATABASE CANCEL;
SQL>ALTER SYSTEM SET STANDBY_FILE_MANAGEMENT=MANUAL SID='*';
Rename the unknown datafile 97. SQL> ALTER DATABASE RENAME FILE '/u01/app/oracle/product/10.2.0.5/db_1/dbs/UNNAMED00097' to '</absolute path/real datafile name>'; Create a empty datafile which same structure as the datafile 97 and it would need all archivelogs from time of creation for recovery Alter database create datafile '/u01/app/oracle/product/10.2.0.5/db_1/dbs/UNNAMED00097' as '+DATA_ACS4/' size <Actual size of datafile on Primary>
Please note while giving the above command on ASM you also need to specify the action size of the datafile from the primary (Query v$datafiles for Bytes column) SQL>ALTER SYSTEM SET STANDBY_FILE_MANAGEMENT=AUTO SID='*';
SQL>ALTER DATABASE RECOVER MANAGED STANDBY DATABASE DISCONNECT;
SQL>ALTER DATABASE RECOVER MANAGED STANDBY DATABASE USING CURRENT LOGFILE DISCONNECT;

看起来和STANDBY_FILE_MANAGEMENT有关系,进一步查看show parameter STANDBY_FILE_MANAGEMENT

On Primary:
SYS@jyzhao1 > show parameter STANDBY_FILE_MANAGEMENT NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
standby_file_management string MANUAL
SYS@jyzhao1 > On Standby:
SQL> show parameter STANDBY_FILE_MANAGEMENT NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
standby_file_management string MANUAL
SQL>

发现果然都是MANUAL。

先处理当前问题,按照MOS的几种方法,选择适合我这里环境的方案:

创建和问题文件相同结构的空文件,然后备库开启应用所有归档文件即可完成恢复。

创建与错误数据文件结构相同的空文件,具体大小从主库查询,不加大小可能遭遇其他问题,详见上面MOS文档:

Alter database create datafile '/opt/app/oracle/product/11.2.0/dbhome_1/dbs/UNNAMED00010' as '+DATA/' size 104857600;

创建后,可以发现v$datafile已经正确:

SQL> select name from v$datafile;

NAME
--------------------------------------------------------------------------------
+DATA/mynas/datafile/system.258.951608183
+DATA/mynas/datafile/sysaux.257.951608183
+DATA/mynas/datafile/undotbs1.259.951608185
+DATA/mynas/datafile/users.265.951608205
+DATA/mynas/datafile/undotbs2.261.951608185
+DATA/mynas/datafile/dbs_d_jingyu.262.951608185
+DATA/mynas/datafile/dbs_i_jingyu.263.951608185
+DATA/mynas/datafile/test.264.951608185
+DATA/mynas/datafile/test2.260.951608185
/opt/app/oracle/product/11.2.0/dbhome_1/dbs/UNNAMED00010 10 rows selected. SQL> Alter database create datafile '/opt/app/oracle/product/11.2.0/dbhome_1/dbs/UNNAMED00010' as '+DATA/' size 104857600; Database altered. SQL> select name from v$datafile; NAME
--------------------------------------------------------------------------------
+DATA/mynas/datafile/system.258.951608183
+DATA/mynas/datafile/sysaux.257.951608183
+DATA/mynas/datafile/undotbs1.259.951608185
+DATA/mynas/datafile/users.265.951608205
+DATA/mynas/datafile/undotbs2.261.951608185
+DATA/mynas/datafile/dbs_d_jingyu.262.951608185
+DATA/mynas/datafile/dbs_i_jingyu.263.951608185
+DATA/mynas/datafile/test.264.951608185
+DATA/mynas/datafile/test2.260.951608185
+DATA/mynas/datafile/dbs_d_hank.273.951774293 10 rows selected.

然后修改STANDBY_FILE_MANAGEMENT=AUTO,正常开启数据库,开启实时应用:

SQL>ALTER SYSTEM SET STANDBY_FILE_MANAGEMENT=AUTO SID='*';
SQL>ALTER DATABASE OPEN;
SQL>ALTER DATABASE RECOVER MANAGED STANDBY DATABASE USING CURRENT LOGFILE DISCONNECT;

再测试增加数据文件,删除数据文件,都可以正常同步:

SYS@jyzhao1 >create tablespace dbs_only_test;
SYS@jyzhao1 >drop tablespace dbs_only_test including contents and datafiles;

备库都会自动的正常添加删除,日志都会记录如下:

Fri Aug 11 21:49:11 2017
Media Recovery Waiting for thread 1 sequence 175 (in transit)
Recovery of Online Redo Log: Thread 1 Group 11 Seq 175 Reading mem 0
Mem# 0: +FRA/mynas/standbylog/standby_group_11.log
Fri Aug 11 21:51:15 2017
Successfully added datafile 11 to media recovery
Datafile #11: '+DATA/mynas/datafile/dbs_only_test.275.951774665'
Fri Aug 11 21:53:20 2017
Recovery deleting file #11:'+DATA/mynas/datafile/dbs_only_test.275.951774665' from controlfile.
Deleted Oracle managed file +DATA/mynas/datafile/dbs_only_test.275.951774665
Recovery dropped tablespace 'DBS_ONLY_TEST'

总结:DG环境,一定要注意参数STANDBY_FILE_MANAGEMENT=AUTO,否则可能遇到类似情况。

案例:Standby RAC遭遇ORA-1157,1111,1110导致实例crash处理的更多相关文章

  1. 模拟生产搭建Standby RAC实验环境(11.2.0.4 DG)

    模拟生产搭建Standby RAC实验环境(11.2.0.4 DG) 环境:RHEL 6.5 + Oracle 11.2.0.4 GI.DB 1.需求背景介绍 2.准备工作 3.主库配置 4.备库配置 ...

  2. 同一环境下新建Standby RAC库

    需求:在同一个环境下新建Standby RAC库,即和Primary RAC在相同的磁盘组. 说明:生产环境一般不建议这样配置DG,因为存储层面是相同磁盘组,灾备的实际意义不大.我这里是用作读写分离. ...

  3. Data Guard Physical Standby - RAC Primary to RAC Standby 使用第二个网络 (Doc ID 1349977.1)

    Data Guard Physical Standby - RAC Primary to RAC Standby using a second network (Doc ID 1349977.1) A ...

  4. GIS案例学习笔记-CAD数据分层导入现有模板实例教程

    GIS案例学习笔记-CAD数据分层导入现有模板实例教程 联系方式:谢老师,135-4855-4328,xiexiaokui#qq.com 1. 原始数据: CAD数据 目标模板 2. 任务:分5个图层 ...

  5. GIS案例学习笔记-ArcGIS整图大图出图实例教程

    GIS案例学习笔记-ArcGIS整图大图出图实例教程 联系方式:谢老师,135-4855-4328,xiexiaokui#qq.com 1. 通过出图比例尺(1:2000),地图范围测算图纸大小. 图 ...

  6. 第7.25节 Python案例详解:使用property函数定义与实例变量同名的属性会怎样?

    第7.25节 Python案例详解:使用property函数定义与实例变量同名的属性会怎样? 一.    案例说明 我们上节提到了,使用property函数定义的属性不要与类内已经定义的普通实例变量重 ...

  7. rac库grid目录权限(6751)导致数据库宕机案例 此方法仅用于紧急救助

    问题: 我的rac环境不小心通过chown命令改变了/u01目录及其子目录的权限,导致rac节点2数据库宕掉,sqlplus下打开数据库报错如下: [oracle@node2 ~]$ sqlplus ...

  8. EXP/IMP迁移案例,IMP遭遇导入表的表空间归属问题

    生产环境: 源数据库:Windows Server + Oracle 11.2.0.1 目标数据库:SunOS + Oracle 11.2.0.3 1.确认迁移需求:源数据库cssf 用户所有表和数据 ...

  9. Oracle 11.2.0.1 ADG环境MRP进程遭遇ORA

    环境:Linux + Oracle 11.2.0.1 ADG现象:发现备库没有应用日志 1. 数据库查询备库目前状态发现备库目前没有应用日志,apply lag已经显示备库有3天21小时多没有应用日志 ...

随机推荐

  1. JS常用方法(获取Class、获取元素样式、事件监听、cookie、ajax等)

    var Util = {}; Util.byClass = function (oClass) {//全局获取 var tags = document.all ? document.all : doc ...

  2. laravel如何向视图传递变量的方法

    第一种: public function about(){ $name = "cai" return view("sites.about")->with( ...

  3. php的修改

    修改数据: (1)如果不是有外键的表,那么修改就正常的进行修改页面和修改处理页面就可以,但是有了外键的表,在进行遍历时就要写相应的条件了. 例如,有张表中有性别,但是进行创建表时是用的0或1来表示的, ...

  4. Linux10分钟入门

    最近打算考红帽认证,将自己学习到的和工作中常用的一些命令进行总结,供初学者和一定基础的参考. 想系统性学习的话,还是建议看书(鸟哥的Linux私房菜)和看视频(基础版,推荐马哥和老男孩,不推荐**** ...

  5. H3C交换机删除VLAN与其绑定端口配置

    在系统视图下,执行 undo int vlan 2 undo vlan 2 可以删除vlan2的配置信息. 执行 undo vlan all 可以删除所有的vlan信息. 在vlan2视图下,执行: ...

  6. View学习(二)-View的测量(measure)过程

    在上一篇文章中,我们介绍了DecorView与MeasureSpec, 下面的文章就开始讨论View的三大流程. View的三大流程都是通过ViewRoot来完成的.ViewRoot对应于ViewRo ...

  7. Jenkins的安装配置

    Jenkins的安装配置 一.Jenkins简介 Jenkins 是一个可扩展的持续集成引擎.Jenkins可以帮我们将代码进行统一的编译打包.还可以放到tomcat容器中进行发布.简单来说就是我们通 ...

  8. Struts 框架 之 Hello World

    Struts HelloWorld 第一步   导jar包 commons-fileupload-1.2.2.jar   [文件上传相关包] commons-io-2.0.1.jar     [输入输 ...

  9. es6的一些个人总结

    es6的一些知识点 前言:es6(ECMAscript2015)标准 let.const.var的一些区别 let.const 块级作用域.全局作用域.函数作用域 var 全局作用域.函数作用域 变量 ...

  10. Java 并发编程内部分享PPT分享

    .NET程序员转向JAVA领域,必备技术首当其冲就是JAVA Concurrency 并发编程. 最近系统性的学习了 Doug Lea <JAVA并发编程实战>一书.这书很有嚼劲,进入JA ...