eygle.com   eygle.com
eygle.com eygle
eygle.com  
 

« ORA-01114、ORA-27067错误案例一则 | Blog首页 | 使用DATAPUMP导致ORA-00600 17020错误 »

Oracle如何维护SMON_SCN_TIME表?
modb.pro

今天客户的数据库再次出现了ORA-1461错误:
ORA-1461 encountered when generating server alert SMG-3500

这个错误之前已经记录过,在10.2.0.4中修正,在10.2.0.3中也并不会带来严重的问题。
但是还是又仔细看了一下这个错误提示:
update smon_scn_time set orig_thread=0, time_mp=:1, time_dp=:2, scn=:3,
scn_wrp=:4, scn_bas=:5, num_mappings=:6, tim_scn_map=:7 where thread=0 and
scn = (select min(scn) from smon_scn_time where thread=0)

这是由于数据库内部更新smon_scn_time出现的错误,这个字典表用于维护Oracle至关重要的SCN与时间的对应关系,Flashback等重要特性也以来于此。

但是这个表的记录是循环使用的,那么Oracle如何循环使用呢?
这个Bug中的这个语句说明了这个过程:
update smon_scn_time
set orig_thread=0, time_mp=:1, time_dp=:2, scn=:3,scn_wrp=:4, scn_bas=:5, num_mappings=:6, tim_scn_map=:7
where thread=0 and scn = (select min(scn) from smon_scn_time where thread=0)

原来是找出SCN最小的一个,来Update,这效率也够低的。

这个表中其实并不包含Long型数据,所以这个错误提示的根本原因其实更复杂,涉及了一连串的Bug:


SQL> desc smon_scn_time
Name                                      Null?    Type
----------------------------------------- -------- ----------------------------
THREAD                                            NUMBER
TIME_MP                                            NUMBER
TIME_DP                                            DATE
SCN_WRP                                            NUMBER
SCN_BAS                                            NUMBER
NUM_MAPPINGS                                      NUMBER
TIM_SCN_MAP                                        RAW(1200)
SCN                                                NUMBER
ORIG_THREAD                                        NUMBER



历史上的今天...
    >> 2016-04-09文章:
    >> 2013-04-09文章:
    >> 2012-04-09文章:
    >> 2008-04-09文章:
           数据字典表之:DBA_TABLES
    >> 2006-04-09文章:
           经典重现

By eygle on 2009-04-09 00:58 | Comments (0) | Case | 2247 |


CopyRight © 2004~2020 云和恩墨,成就未来!, All rights reserved.
数据恢复·紧急救援·性能优化 云和恩墨 24x7 热线电话:400-600-8755 业务咨询:010-59007017-7040 or 7037 业务合作: marketing@enmotech.com