暂无图片
暂无图片
1
暂无图片
暂无图片
暂无图片

Oracle ORA-600[4193] 问题处理

原创 ORA-DBA 2022-01-02
341

ORA-600 [4193] WhenTrying To Open The Database [ID 763566.1]

 Ora-600 [4193] WhenOpening Or Shutting Down A Database [ID 452662.1]

Errors in alert.log:

Tue Jul 17 13:38:13 2007
Errors in file /home/oracle/oracle/product/10.2.0/yms/rdbms/log/yms_smon_8337.trc:
ORA-00607: Internal error occurred while making a change to a data block
ORA-00600: internal error code, arguments: [4193], [3552], [3554], [], [], []

原因
--数据库在启动时需要进行一个前滚的操作,在前滚时会应用redo 到undo block上,操作时会检查undorecord里的seq#和 redo record里的seq#.



These seq#should be the same because when we apply a redo record we must apply itto the correct version of the block.

--正常情况下,这2者的seq# 应该是一致的。



We can onlyapply a redo record to a block that contains the same seq# as in the redorecord.

--在一致的情况下,我们才应用redo record 到undo record。



If the seq# do not match then ORA-600[4193][a].[b] is raised. .

Arg [a] Undorecord seq number --> seq: 0xde0 = 3552
Arg [b] Redo record seq number --> seq: 0x0de2 = 3554

--如果不一致就会出现ORA-600[4193][a][b]的错误。其中a 是undo 里的seq#记录,b是redo 里的seq# 值。 这里的值都是十六进程,我们可以通过to_number() 这个函数来转换一下:



SYS@anqing1(rac1)> Select to_number('de0','xxxx') from dual;

TO_NUMBER('DE0','XXXX')

-----------------------

3552



This implies some kind of block corruptionin either the redo or the undo block.

--当redo record 和 undo record 不一致时,就会抛出ORA-600[4193]的错误。



相关的文章参考:

Oracledatafile block 格式 说明

http://www.cndba.cn/Dave/article/1375


Oracle 实例恢复时 前滚(roll forward) 后滚(roll back) 问题




1.2.3 Solution

1.2.3.1 If Database is opened:

--在db open 状态下,解决的方法如下:

1) Find out the rollback segment, based onthe first part of the xid: 0x0002.045.00006c61

usn=2 is the segment_id

selectsegment_name,status from dba_rollback_segs where segment_id=2;

RS_DATA1 ONLINE



2) Dump the transaction table of the rollbacksegment to see if all TX are commited:

alter system dump undoheader RS_DATA1;



Oracle dumpundo 说明

http://blog.csdn.net/tianlesoftware/article/details/6672417



3) check the trace file created underuser_dump_dest

In the trace filesearch for the Keyword "TRN TBL"

TRN TBL::

index state cflags wrap# uel scn dba
-----------------------------------------------------------------------------
0x00 9 0x00 0x21eb1 0x0023 0x0000.d28c43e9 0x00000000 ......

state=9 means transaction is committed



4) offline the rollback segment:

alter rollbacksegment rs_data1 offline;
select status from dba_rollback_segs wheresegment_id=2;

5) if STATUS=OFFLINE

droprollback segment RS_DATA1;



1.2.3.2 If Database doesn't open:

--如果数据库不是open状态,处理方法如下:

1. a) If using rollbacksegments, remove the rollback_segments line from init.ora, and open database

b) If usingundo segments set undo_management = manual in init.ora/spfile, and try to opendatabase.

2. If database opens means all transactionsare committed, and you can drop the rollback segment or the undo tablespace





1.3 bug 导致的ORA-600[4193]
MOS:

ORA-600 [4193] "seq# mismatch whileadding undo record" [ID 39282.1]

Bug 8240762 - Undo corruptions with ORA-600[4193]/ORA-600 [4194] or ORA-600 [4137] [ID 8240762.8]



Undo corruptionmay be caused after a shrink and the same undo block may be used for two different transactions causing several internal errors like:

ORA-600 [4193] / ORA-600 [4194] for newtransactions

ORA-600 [4137] for a transaction rollback



Undo segment shrink is internally done by Oracle.

--undo shrink 导致的undo corruptions



Workaround

Drop the undo segment.



Affects:
Product (Component)

Oracle Server (Rdbms)

Range of versions believed to be affected

Versions >= 10.2 but BELOW 11.2

Versions confirmed as being affected

10.2.0.4
10.2.0.3
Platforms affected

Generic (all / most platforms affected)

Fixed:
This issue is fixed in

11.2.0.1 (Base Release)
11.1.0.7.10 Patch Set Update
10.2.0.5 (Server Patch Set)
11.1.0.7 Patch 42 on Windows Platforms
10.2.0.4 Patch 40 on Windows Platforms

如果出现这种问题,drop 对应的undo segment 即可。

在启动数据库时会先进行一个forward 的操作,这时候会应用一些redo record 到undo block里,在apply 之前会先检查这2个block里面的seq#值,如果一致则ok,不一致,就会出现ORA-600[4193]的错误。



ORA-600[4193]的格式是:ORA-600[4193] [a].[b] :

Arg [a] Undorecord seq number --> seq: 0xde0 = 3552
Arg [b] Redo record seq number --> seq: 0x0de2 = 3554



参数A 是undo 里的seq#, 参数B是redo 里的seq#值,这个值可以从trace里也查看,也可以直接dump 对应的块:



Oracle DumpRedo Log File 说明

http://www.cndba.cn/Dave/article/1371


Oracle dumpundo 说明

http://blog.csdn.net/tianlesoftware/article/details/6672417



Oracledatafile block 格式 说明

http://www.cndba.cn/Dave/article/1375


dump 出来的seq值是十六进制的,可以使用to_number 函数转换:

SYS@anqing1(rac1)> Select to_number('de0','xxxx') from dual;

TO_NUMBER('DE0','XXXX')

-----------------------

3552



导致ORA-600[4193]的错误原因,MOS 上提到了2个:

1. 在DB open状态下复制了online redo log。

在open 状态下的复制,不能复制onlien redo log,而应复制归档,然后用open resetlogs,这样onlineredo log 会自动重建。

2. BUG 8240762 --shrink undo

ORA-600 [4193] /ORA-600 [4194] for new transactions

ORA-600 [4137] for a transaction rollback

这个bug 存在于Oracle 10.2.0.3,10.2.0.4 以及11gR1的版本里。



出现这种问题的解决方法是重建UNDO 表空间,现在使用SYSTEM下rollbacksegment 的系统基本是没有了。



在下面的Blog里列举了2种重建UNDO 的方法,这里列一种:

Currentonline Redo 和 Undo 损坏的处理方法

http://www.cndba.cn/dave/article/525


(1)用spfile 创建pfile,然后修改参数:

#*.undo_tablespace='UNDOTBS1'

#*.undo_management='AUTO'

#*.undo_tablespace

#*.undo_retention

undo_management='MANUAL'

rollback_segments='SYSTEM'



(2)用修改之后的pfile,重启DB

SQL> STARTUP MOUNTpfile='F:/initorcl.ora' ;



(3)删除原来的表空间,创建新的UNDO 表空间

SQL> drop tablespace undotbs;

SQL> create undo tablespace undotbs1datafile '/u01/oradata/undotbs1.dbf' size 10M;



(4)关闭数据库,修改pfile参数,然后用新的pfile创建spfile,在正常启动数据库。

*.undo_tablespace='UNDOTBS1'

*.undo_management='AUTO'

#undo_management='MANUAL'

#rollback_segments='SYSTEM'
————————————————
版权声明:本文为CSDN博主「Dave」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/tianlesoftware/article/details/7238771

「喜欢这篇文章,您的关注和赞赏是给作者最好的鼓励」
关注作者
【版权声明】本文为墨天轮用户原创内容,转载时必须标注文章的来源(墨天轮),文章链接,文章作者等基本信息,否则作者和墨天轮有权追究责任。如果您发现墨天轮中有涉嫌抄袭或者侵权的内容,欢迎发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。

评论