设为首页 收藏本站
查看: 530|回复: 0

[经验分享] 数据库启动时遇到ORA-01578错误

[复制链接]
累计签到:1 天
连续签到:1 天
发表于 2014-5-26 15:35:22 | 显示全部楼层 |阅读模式
数据库启动的时候遇到坏块,特别是SYSTEM表空间中的一些底层表,如UNDO$,OBJ$等一些表,会导致数据库不能正常open,当然我们可以通过增加一些隐藏参数来达到跳过坏块来启动数据库,也可以通过bbed工具来手动修复块来。下面是自己的一个测试环境遇到这样的错误,通过bbed工具来修复
        
        
欢迎大家加入ORACLE超级群:17115662 免费解决各种ORACLE问题,以后BLOG将迁移到http://www.htz.pw
        
        
1,数据库版本
                 
SQL> select * from v$version;
                  
                  
BANNER
                  
--------------------------------------------------------------------------------
                  
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
                  
PL/SQL Release 11.2.0.3.0 - Production
                  
CORE    11.2.0.3.0      Production
                  
TNS for Linux: Version 11.2.0.3.0 - Production
                  
NLSRTL Version 11.2.0.3.0 - Production
                  
                  
[oracle@www.htz.pw ~]$sqlplus / as sysdba
                  
                  
SQL*Plus: Release 11.2.0.3.0 Production on Sun May 25 04:36:03 2014
                  
                  
Copyright (c) 1982, 2011, Oracle.  All rights reserved.
                  
                  
Connected to an idle instance.
                  
                  
SQL> startup
                  
ORACLE instance started.
                  
                  
Total System Global Area  237998080 bytes
                  
Fixed Size                  2227216 bytes
                  
Variable Size             146801648 bytes
                  
Database Buffers           83886080 bytes
                  
Redo Buffers                5083136 bytes
                  
Database mounted.
                  
ORA-01092: ORACLE instance terminated. Disconnection forced
                  
ORA-00604: error occurred at recursive SQL level 1
                  
ORA-00607: Internal error occurred while making a change to a data block
                  
ORA-00600: internal error code, arguments: [kdBlkCheckError], [1], [225],
                  
[6108], [], [], [], [], [], [], [], []
                  
Process ID: 12178
                  
Session ID: 1 Serial number: 5
      
        
2,启动报错
                 
[oracle@www.htz.pw ~]$sqlplus / as sysdba
                  
                  
SQL*Plus: Release 11.2.0.3.0 Production on Sun May 25 04:20:44 2014
                  
                  
Copyright (c) 1982, 2011, Oracle.  All rights reserved.
                  
                  
Connected to an idle instance.
                  
                  
SQL> startup
                  
ORACLE instance started.
                  
                  
Total System Global Area  237998080 bytes
                  
Fixed Size                  2227216 bytes
                  
Variable Size             146801648 bytes
                  
Database Buffers           83886080 bytes
                  
Redo Buffers                5083136 bytes
                  
Database mounted.
                  
ORA-01092: ORACLE instance terminated. Disconnection forced
                  
ORA-00604: error occurred at recursive SQL level 1
                  
ORA-01578: ORACLE data block corrupted (file # 1, block # 225)
                  
ORA-01110: data file 1: '/oracle/app/oracle/oradata/orcl1123/system01.dbf'
                  
Process ID: 1617
                  
Session ID: 1 Serial number: 5
                                    
                  
此块就是存储undo$基表的块,在数据库启动的时候,做恢复的时候,是需要去读undo块的,所以导致报错
      
        
3bbed修复坏块
                 
BBED> verify
                  
DBVERIFY - Verification starting
                  
FILE = /oracle/app/oracle/oradata/orcl1123/system01.dbf
                  
BLOCK = 225
                  
                  
Block Checking: DBA = 4194529, Block Type = KTB-managed data block
                  
Found block already marked corrupted
                  
                  
DBVERIFY - Verification complete
                  
                  
Total Blocks Examined         : 1
                  
Total Blocks Processed (Data) : 1
                  
Total Blocks Failing   (Data) : 0
                  
Total Blocks Processed (Index): 0
                  
Total Blocks Failing   (Index): 0
                  
Total Blocks Empty            : 0
                  
Total Blocks Marked Corrupt   : 0
                  
Total Blocks Influx           : 0
                  
Message 531 not found;  product=RDBMS; facility=BBED
                  
这里发现块被标记为坏块,其实这里知道就是把seq更改为FF了,下面我们修改回来就可以了
                  
BBED> p kcbh
                  
struct kcbh, 20 bytes                       @0      
                  
   ub1 type_kcbh                            @0        0x06
                  
   ub1 frmt_kcbh                            @1        0xa2
                  
   ub1 spare1_kcbh                          @2        0x00
                  
   ub1 spare2_kcbh                          @3        0x00
                  
   ub4 rdba_kcbh                            @4        0x004000e1
                  
   ub4 bas_kcbh                             @8        0x0021beaa
                  
   ub2 wrp_kcbh                             @12       0x0000
                  
   ub1 seq_kcbh                             @14       0xff
                  
   ub1 flg_kcbh                             @15       0x04 (KCBHFCKV)
                  
   ub2 chkval_kcbh                          @16       0x4cba
                  
   ub2 spare3_kcbh                          @18       0x0000
                  
                  
BBED> set mode edit
                  
        MODE            Edit
                  
                  
BBED> set count 16
                  
        COUNT           16
                  
                  
BBED> modify /x 00 offset 14
                  
Warning: contents of previous BIFILE will be lost. Proceed? (Y/N) y
                  
File: /oracle/app/oracle/oradata/orcl1123/system01.dbf (0)
                  
Block: 225              Offsets:   14 to   29           Dba:0x00000000
                  
------------------------------------------------------------------------
                  
0004ba4c 00000100 00000f00 0000aabe
                  
                  
<32 bytes per line>
                  
                  
                  
BBED> set offset 8188
                  
        OFFSET          8188
                  
                  
BBED> dump
                  
File: /oracle/app/oracle/oradata/orcl1123/system01.dbf (0)
                  
Block: 225              Offsets: 8188 to 8191           Dba:0x00000000
                  
------------------------------------------------------------------------
                  
ff06aabe
                  
                  
<32 bytes per line>
                  
                  
BBED> modify /x 00 offset 8188
                  
File: /oracle/app/oracle/oradata/orcl1123/system01.dbf (0)
                  
Block: 225              Offsets: 8188 to 8191           Dba:0x00000000
                  
------------------------------------------------------------------------
                  
0006aabe
                  
                  
<32 bytes per line>
                  
                  
BBED> p tailchk
                  
ub4 tailchk                                 @8188     0xbeaa0600
                  
                  
                  
BBED> sum apply
                  
Check value for File 0, Block 225:
                  
current = 0x4cba, required = 0x4cba
                  
                  
BBED> verify
                  
DBVERIFY - Verification starting
                  
FILE = /oracle/app/oracle/oradata/orcl1123/system01.dbf
                  
BLOCK = 225
                  
                  
Block Checking: DBA = 4194529, Block Type = KTB-managed data block
                  
data header at 0x2a98b8725c
                  
kdbchk: row locked by non-existent transaction
                  
        table=0   slot=20
                  
        lockid=1   ktbbhitc=2
                  
Block 225 failed with check code 6101
                  
                  
DBVERIFY - Verification complete
                  
                  
Total Blocks Examined         : 1
                  
Total Blocks Processed (Data) : 1
                  
Total Blocks Failing   (Data) : 1
                  
Total Blocks Processed (Index): 0
                  
Total Blocks Failing   (Index): 0
                  
Total Blocks Empty            : 0
                  
Total Blocks Marked Corrupt   : 0
                  
Total Blocks Influx           : 0
                  
Message 531 not found;  product=RDBMS; facility=BBED
                  
这里看到报了ITL相当的一些东西,原因是由于原来做实验的时候,手动提交了数据。
                  
报错代码的意思是,slot=20的行被锁住,占用了itl2.
                  
                  
下面是dump数据库看一下第21号的lb标记符
                  
tl: 58 fb: --H-FL-- lb: 0x1  cc: 17
                  
col  0: [ 2]  c1 15
                  
col  1: [10]  5f 53 59 53 53 4d 55 32 30 24
                  
col  2: [ 2]  c1 02
                  
col  3: [ 2]  c1 06
                  
col  4: [ 3]  c2 03 49
                  
col  5: [ 5]  c4 02 62 0a 09
                  
col  6: [ 1]  80
                  
col  7: [ 3]  c2 03 2a
                  
col  8: [ 3]  c2 02 3e
                  
col  9: [ 1]  80
                  
col 10: [ 2]  c1 04
                  
col 11: [ 2]  c1 06
                  
col 12: *NULL*
                  
col 13: *NULL*
                  
col 14: *NULL*
                  
col 15: *NULL*
                  
col 16: [ 2]  c1 0
                  
                  
BBED> p *kdbr[20]
                  
rowdata[634]
                  
------------
                  
ub1 rowdata[634]                            @1823     0x2c
                  
                  
BBED> set offset 1823
                  
        OFFSET          1823
                  
                  
BBED> dump
                  
File: /oracle/app/oracle/oradata/orcl1123/system01.dbf (0)
                  
Block: 225              Offsets: 1823 to 1838           Dba:0x00000000
                  
------------------------------------------------------------------------
                  
2c011102 c1150a5f 53595353 4d553230
                  
BBED> modify /x 2c00
                  
File: /oracle/app/oracle/oradata/orcl1123/system01.dbf (0)
                  
Block: 225              Offsets: 1823 to 1838           Dba:0x00000000
                  
------------------------------------------------------------------------
                  
2c001102 c1150a5f 53595353 4d553230
                  
                  
<32 bytes per line>
                  
                  
                  
                  
BBED> sum apply
                  
Check value for File 0, Block 225:
                  
current = 0x6ec1, required = 0x6ec1
                  
                  
BBED> verify
                  
DBVERIFY - Verification starting
                  
FILE = /oracle/app/oracle/oradata/orcl1123/system01.dbf
                  
BLOCK = 225
                  
                  
                  
DBVERIFY - Verification complete
                  
                  
Total Blocks Examined         : 1
                  
Total Blocks Processed (Data) : 1
                  
Total Blocks Failing   (Data) : 0
                  
Total Blocks Processed (Index): 0
                  
Total Blocks Failing   (Index): 0
                  
Total Blocks Empty            : 0
                  
Total Blocks Marked Corrupt   : 0
                  
Total Blocks Influx           : 0
                  
Message 531 not found;  product=RDBMS; facility=BBED
                  
                  
块不在报错。验证通过
      
        
4,数据库正常打开
                                                              
SQL> alter database open;
                  
                  
Database altered.
                  
                  
undo块能正常访问
                  
SQL> select name from undo$;
                  
                  
NAME
                  
------------------------------
                  
SYSTEM
                  
_SYSSMU1$
                  
_SYSSMU10$
                  
_SYSSMU11$
                  
_SYSSMU12$
                  
_SYSSMU13$
                  
_SYSSMU14$
                  
_SYSSMU15$
                  
_SYSSMU16$
                  
_SYSSMU17$
                  
_SYSSMU18$
                  
                  
NAME
                  
------------------------------
                  
_SYSSMU19$
                  
_SYSSMU2$
                  
_SYSSMU20$
                  
_SYSSMU3$
                  
_SYSSMU4$
                  
_SYSSMU5$
                  
_SYSSMU6$
                  
_SYSSMU7$
                  
_SYSSMU8$
                  
_SYSSMU9$
                  
                  
21 rows selected.


运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.iyunv.com/thread-19629-1-1.html 上篇帖子: lsnrctl start启动监听很慢(AIX平台) 下篇帖子: 在vmware server中部署linux redhat 5.4 ORACLE RAC11g +ASM 数据库
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

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