Oracle重建控制文件的实例教程


本文整理自网络,侵删。

前言

控制文件(control file)是一个相当小的文件(最多能增长到64M左右),其中包含Oracle需要的其他文件的一个目录。参数文件告知实例控制文件的位置,控制文件则告知示例数据库和在线重做日志文件的位置。控制文件还告知了Oracle其他一些事情,如已发生检查点的有关信息、数据库名(必须和db_name参数匹配)、创建数据库的时间戳、归档重做日志的历史(有时这会让控制文件变大)、RMAN信息等。

环境:OEL 5.7 + Oracle 10.2.0.5

背景:在Oracle的运维过程中,时常会遇到一些场景是需要重建控制文件才可以解决的。本文的场景可以通过复制控制文件到新路径,运行一段时间后,再用老的控制文件启动数据库重现。

1.当前故障现象

在使用旧的控制文件启动数据库时,报错ORA-01122、ORA-01110、ORA-01207:

SQL> shutdown abort
ORACLE instance shut down.
SQL> startup
ORACLE instance started.

Total System Global Area 599785472 bytes
Fixed Size   2098112 bytes
Variable Size  218106944 bytes
Database Buffers  373293056 bytes
Redo Buffers  6287360 bytes
Database mounted.
ORA-01122: database file 1 failed verification check
ORA-01110: data file 1: '/oradata/cxywdb/system01.dbf'
ORA-01207: file is more recent than control file - old control file

2.分析故障原因

根据报错信息查找MOS文档:

ORA-1122, ORA-1110, ORA-1207 while open the database after crash (文档 ID 283927.1)

延伸思考一下,为什么会这样?

主要错误是ORA-01207,利用oerr工具看到Oralce对这个错误的详细描述是:

01207, 00000, "file is more recent than control file - old control file"
// *Cause:  The control file change sequence number in the data file is
//         greater than the number in the control file. This implies that
//         the wrong control file is being used. Note that repeatedly causing
//         this error can make it stop happening without correcting the real
//         problem. Every attempt to open the database will advance the
//         control file change sequence number until it is great enough.
// *Action: Use the current control file or do backup control file recovery to
//         make the control file current. Be sure to follow all restrictions
//         on doing a backup control file recovery.

一般遇到这种情况,当前的控制文件肯定是找不到了。那么就得考虑重建控制文件来解决,MOS给出的建议也是重建控制文件。

3.重建控制文件

重建控制文件的核心步骤:

阅读剩余部分

相关阅读 >>

教你使用python连接oracle

oracle查看当前账号的相关信息

oracle数据库中的级联查询、级联删除、级联更新操作教程

直接拷贝数据文件实现oracle数据迁移

oracle知识整理笔记

linux静默安装oracle11g部分问题的解决方法

oracle中raise异常深入分析

oracle为啥叫甲骨文

oracle 存储过程、函数和触发器用法实例详解

oracle数据库中多条件查询语句怎么写?

更多相关阅读请进入《oracle》频道 >>


数据库系统概念 第6版
书籍

数据库系统概念 第6版

机械工业出版社

本书主要讲述了数据模型、基于对象的数据库和XML、数据存储和查询、事务管理、体系结构等方面的内容。



打赏

取消

感谢您的支持,我会继续努力的!

扫码支持
扫码打赏,您说多少就多少

打开支付宝扫一扫,即可进行扫码打赏哦

分享从这里开始,精彩与您同在

评论

管理员已关闭评论功能...