[20121127]ora-0060[2662]错误的产生以及模拟.txt

[20121127]ora-0060[2662]错误的产生以及模拟.txt

转抄链接:http://www.xifenfei.com/1509.html

一、错误现象(alert日志中)
Errors in file /opt/oracle/admin/conner/udump/conner_ora_31607.trc:
ORA-00600: internal error code, arguments: [2662], [0], [897694446], [0], [897695488], [8388697], [], []

二、错误解释
ORA-600 [2662] "Block SCN is ahead of Current SCN",说明当前数据库的数据块的SCN早于当前的SCN,主要是和存储在UGA变量中的
dependent SCN进行比较,如果当前的SCN小于它,数据库就会产生这个ORA-600 [2662]的错误了。这个错误一共有五个参数,分别代表不同的含义
ORA-600 [2662] [a] [b] {c} [d] [e]
Arg [a] Current SCN WRAP
Arg [b] Current SCN BASE
Arg {c} dependent SCN WRAP
Arg [d] dependent SCN BASE
Arg [e] Where present this is the DBA where the dependent SCN came from.
注:897694446
三、错误原因
1.使用隐含参数_ALLOW_RESETLOGS_CORRUPTION后resetlogs打开数据库
2.硬件错误引起数据库没法写控制文件和重做日志文件
3.错误的部分恢复数据库
4.恢复了控制文件但是没有使用recover database using backup controlfile进行恢复
5.数据库crash后设置了_DISABLE_LOGGING隐含参数
6.在并行服务器环境中DLM存在问题

四、解决办法
1、如果SCN相差不多,可以通过多次重起数据库解决(每次加1)

2、通过10015 ADJUST_SCN事件来增进current SCN
1)计算level
1.1) Arg {c}* 4得出一个数值,假设为V_Wrap
1.2) 如果Arg [d]=0,则V_Wrap值为需要的level
Arg [d] Arg [d] Arg [d] 1.3)SCN被增进了1024*1024*1024*level(level*10 billion)

根据以上介绍,看看自己是否能产生这个错误。不过自己有点疑问,如果传输表空间,数据文件里面记录的scn比当前数据库的scn大,oracle是如何处理?
难道数据库也会选择最大的scn同步吗?

1.建立测试例子以及环境:

SQL> select * from v$version where rownum
BANNER
--------------------------------------------------------------------------------
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production

SQL> select ora_rowscn ,rowid ,dept1.* from dept1;
ORA_ROWSCN ROWID                  DEPTNO DNAME          LOC
---------- ------------------ ---------- -------------- -------------
3010500340 AAAcC1AAIAAAACDAAA         50 TEST           BBBBB
3010500340 AAAcC1AAIAAAACDAAB         10 ACCOUNTING     NEW YORK
3010500340 AAAcC1AAIAAAACDAAC         20 RESEARCH       DALLAS
3010500340 AAAcC1AAIAAAACDAAD         30 SALES          CHICAGO
3010500340 AAAcC1AAIAAAACDAAE         40 OPERATIONS     BOSTON
3179982460 AAAcC1AAIAAAACHAAA         60 AAAAAA         BBBBB
6 rows selected.
SQL> @ lookup_rowid AAAcC1AAIAAAACHAAA
    OBJECT       FILE      BLOCK        ROW
---------- ---------- ---------- ----------
    114869          8        135          0

SQL> select current_scn from v$database ;
CURRENT_SCN
-----------
 3179982478
$ bc
bc 1.06
Copyright 1991-1994, 1997, 1998, 2000 Free Software Foundation, Inc.
This is free software with ABSOLUTELY NO WARRANTY.
For details type `warranty'.
obase=16
3179982460
BD8AAE7C
3179992460
BD8AD58C

2.关闭数据库,修改file=8,block=135的信息。
--intel 系列CPU ,标识16进制是小头在前。

BBED> find /x 7cae8abd top
 File: /u01/app/oracle11g/oradata/test/test01.dbf (8)
 Block: 135                                                                    Offsets:    8 to 8191                                                                 Dba:0x02000087
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 7cae8abd 00000206 b8b50000 01000000 b5c00100 99ab8abd 00000000 02003200 80000002 09000c00 ea250000 072ec000 97130c00 00800000 546f81b3 05000a00 3b2c0000 f526c000 ab140c00 01200000
BBED> find
 File: /u01/app/oracle11g/oradata/test/test01.dbf (8)
 Block: 135                                                                    Offsets:   88 to 8191                                                                 Dba:0x02000087
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 7cae8abd 00000000 00000000 00010100 ffff1400 851f711f 711f0000 0100851f 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
BBED> find
BBED-00212: search string not found
--find发现仅仅存在两处。
BBED> map /v
 File: /u01/app/oracle11g/oradata/test/test01.dbf (8)
 Block: 135                                   Dba:0x02000087
------------------------------------------------------------
 KTB Data Block (Table/Cluster)
 struct kcbh, 20 bytes                      @0
    ub1 type_kcbh                           @0
    ub1 frmt_kcbh                           @1
    ub1 spare1_kcbh                         @2
    ub1 spare2_kcbh                         @3
    ub4 rdba_kcbh                           @4
    ub4 bas_kcbh                            @8
    ub2 wrp_kcbh                            @12
    ub1 seq_kcbh                            @14
    ub1 flg_kcbh                            @15
    ub2 chkval_kcbh                         @16
    ub2 spare3_kcbh                         @18
 struct ktbbh, 72 bytes                     @20
    ub1 ktbbhtyp                            @20
    union ktbbhsid, 4 bytes                 @24
    struct ktbbhcsc, 8 bytes                @28
    sb2 ktbbhict                            @36
    ub1 ktbbhflg                            @38
    ub1 ktbbhfsl                            @39
    ub4 ktbbhfnx                            @40
    struct ktbbhitl[2], 48 bytes            @44
 struct kdbh, 14 bytes                      @100
    ub1 kdbhflag                            @100
    sb1 kdbhntab                            @101
    sb2 kdbhnrow                            @102
    sb2 kdbhfrre                            @104
    sb2 kdbhfsbo                            @106
    sb2 kdbhfseo                            @108
    sb2 kdbhavsp                            @110
    sb2 kdbhtosp                            @112
 struct kdbt[1], 4 bytes                    @114
    sb2 kdbtoffs                            @114
    sb2 kdbtnrow                            @116
 sb2 kdbr[1]                                @118
 ub1 freespace[8049]                        @120
 ub1 rowdata[19]                            @8169
 ub4 tailchk                                @8188
BBED> p ktbbh.ktbbhitl[1]
struct ktbbhitl[1], 24 bytes                @68
   struct ktbitxid, 8 bytes                 @68
      ub2 kxidusn                           @68       0x0005
      ub2 kxidslt                           @70       0x000a
      ub4 kxidsqn                           @72       0x00002c3b
   struct ktbituba, 8 bytes                 @76
      ub4 kubadba                           @76       0x00c026f5
      ub2 kubaseq                           @80       0x14ab
      ub1 kubarec                           @82       0x0c
   ub2 ktbitflg                             @84       0x2001 (KTBFUPB)
   union _ktbitun, 2 bytes                  @86
      sb2 _ktbitfsc                         @86       0
      ub2 _ktbitwrp                         @86       0x0000
   ub4 ktbitbas                             @88       0xbd8aae7c
--感觉仅仅修改offset=8那里就可以了。即 ub4 bas_kcbh 
--把scn调大3179992460(增加10000),十六进制BD8AD58C。
BBED> set offset 8
BBED> modify /x 8cd58abd
BBED-00209: invalid number (8cd58abd)
BBED> modify /x 8cd5
BBED> set offset +2
        OFFSET          10
BBED> modify /x 8abd
--后面补上的。
BBED> set offset 88
BBED> modify /x 8cd5
BBED> set offset +2
BBED> modify /x 8abd
--
BBED> sum
Check value for File 8, Block 135:
current = 0xb5b8, required = 0xce48
BBED> sum apply
Check value for File 8, Block 135:
current = 0xce48, required = 0xce48
BBED> p kcbh.bas_kcbh
ub4 bas_kcbh                                @8        0xbd8ad58c
BBED> p ktbbh.ktbbhitl[1]
struct ktbbhitl[1], 24 bytes                @68
   struct ktbitxid, 8 bytes                 @68
      ub2 kxidusn                           @68       0x0005
      ub2 kxidslt                           @70       0x000a
      ub4 kxidsqn                           @72       0x00002c3b
   struct ktbituba, 8 bytes                 @76
      ub4 kubadba                           @76       0x00c026f5
      ub2 kubaseq                           @80       0x14ab
      ub1 kubarec                           @82       0x0c
   ub2 ktbitflg                             @84       0x2001 (KTBFUPB)
   union _ktbitun, 2 bytes                  @86
      sb2 _ktbitfsc                         @86       0
      ub2 _ktbitwrp                         @86       0x0000
   ub4 ktbitbas                             @88       0xbd8ad58c
BBED> sum apply
Check value for File 8, Block 135:
current = 0xce48, required = 0xce48
BBED> verify
DBVERIFY - Verification starting
FILE = /u01/app/oracle11g/oradata/test/test01.dbf
BLOCK = 135
Block 135 is corrupt
Corrupt block relative dba: 0x02000087 (file 0, block 135)
Fractured block found during verification
Data in bad block:
 type: 6 format: 2 rdba: 0x02000087
 last change scn: 0x0000.bd8ad58c seq: 0x2 flg: 0x06
 spare1: 0x0 spare2: 0x0 spare3: 0x0
 consistency value in tail: 0xae7c0602
 check value in block header: 0xce48
 computed block checksum: 0x0

DBVERIFY - Verification complete
Total Blocks Examined         : 1
Total Blocks Processed (Data) : 0
Total Blocks Failing   (Data) : 0
Total Blocks Processed (Index): 0
Total Blocks Failing   (Index): 0
Total Blocks Empty            : 0
Total Blocks Marked Corrupt   : 1
Total Blocks Influx           : 2
Message 531 not found;  product=RDBMS; facility=BBED
--不行,还要修改tailchk。
BBED> p tailchk
ub4 tailchk                                 @8188     0xae7c0602
--注意这里offset=8190
BBED> modify /x 8cd5 offset 8190
 File: /u01/app/oracle11g/oradata/test/test01.dbf (8)
 Block: 135                                                                    Offsets: 8190 to 8191                                                                 Dba:0x02000087
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 8cd5
 
BBED> sum apply
Check value for File 8, Block 135:
current = 0xb5b8, required = 0xb5b8
BBED> verify
DBVERIFY - Verification starting
FILE = /u01/app/oracle11g/oradata/test/test01.dbf
BLOCK = 135
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

--OK,修改完成。

3.启动数据库测试看看。

SQL> select ora_rowscn ,rowid ,dept1.* from dept1;
ORA_ROWSCN ROWID                  DEPTNO DNAME          LOC
---------- ------------------ ---------- -------------- -------------
3010500340 AAAcC1AAIAAAACDAAA         50 TEST           BBBBB
3010500340 AAAcC1AAIAAAACDAAB         10 ACCOUNTING     NEW YORK
3010500340 AAAcC1AAIAAAACDAAC         20 RESEARCH       DALLAS
3010500340 AAAcC1AAIAAAACDAAD         30 SALES          CHICAGO
3010500340 AAAcC1AAIAAAACDAAE         40 OPERATIONS     BOSTON
3179982460 AAAcC1AAIAAAACHAAA         60 AAAAAA         BBBBB
6 rows selected.

--奇怪ora_rowscn为什么还是3179982460。而不是3179992460.
--主要offset=88 itl中的内容没有修改。修改以后直接报错。(前面修改ITL的部分是后来补上的)

SQL> select current_scn from v$database ;
select current_scn from v$database
                        *
ERROR at line 1:
ORA-00600: internal error code, arguments: [2662], [0], [3179982959], [0], [3179992460], [33554567], [], [], [], [], [], []
SQL> @10to16 33554567
10 to 16 HEX
--------------
       2000087
SQL> select
dbms_utility.data_block_address_file(to_number('&1','xxxxxxxxxxxxxxxx')) rfile#,
dbms_utility.data_block_address_block(to_number('&&1','xxxxxxxxxxxxxxxx')) block#
from dual;
    RFILE#     BLOCK#
---------- ----------
         8        135

按照文档的解决方法:

转抄链接:http://www.xifenfei.com/1509.html

1、如果SCN相差不多,可以通过多次重起数据库解决(每次加1)

2、通过10015 ADJUST_SCN事件来增进current SCN
1)计算level
1.1) Arg {c}* 4得出一个数值,假设为V_Wrap
1.2) 如果Arg [d]=0,则V_Wrap值为需要的level
Arg [d] Arg [d] Arg [d] 1.3)SCN被增进了1024*1024*1024*level(level*10 billion)

我的相差不多:
SQL> select 3179992460- current_scn from v$database ;

3179992460-CURRENT_SCN
----------------------
                  8747

等上一段时间就应该没有问题了。不等执行如下:

create table t1 (a number,b varchar2(10));
begin
 for i in 1..10000         loop
  insert into t1 values (i,'test');
  commit;
 end loop;
end;
/
SQL> select 3179992460- current_scn from v$database ;
3179992460-CURRENT_SCN
----------------------
                 -1711
SQL> select ora_rowscn ,rowid ,dept1.* from dept1;
ORA_ROWSCN ROWID                  DEPTNO DNAME          LOC
---------- ------------------ ---------- -------------- -------------
3010500340 AAAcC1AAIAAAACDAAA         50 TEST           BBBBB
3010500340 AAAcC1AAIAAAACDAAB         10 ACCOUNTING     NEW YORK
3010500340 AAAcC1AAIAAAACDAAC         20 RESEARCH       DALLAS
3010500340 AAAcC1AAIAAAACDAAD         30 SALES          CHICAGO
3010500340 AAAcC1AAIAAAACDAAE         40 OPERATIONS     BOSTON
3179992460 AAAcC1AAIAAAACHAAA         60 AAAAAA         BBBBB
6 rows selected.

--现在问题消失。

时间: 2024-10-23 19:57:21

[20121127]ora-0060[2662]错误的产生以及模拟.txt的相关文章

ORA-00600 [2662]错误解决过程

错误|过程|解决 ORA-00600 [2662]错误解决过程 数据库版本:7.3.2   背景: 客户那边数据库突然出现一个current日志文件坏了,导致数据库crash了,然后现场工程师使用_ALLOW_RESETLOGS_CORRUPTION = TRUE这个隐含参数,做了不完全恢复后强行将数据库打开.可是打开数据库后发现只能用internal用户连接进去,别的用户连接都报错,错误信息如下: ORA-00600: internal error code, arguments: [2662

[20170512]ora-00600[2662]错误3.txt

[20170512]ora-00600[2662]错误3.txt --//前一阵子的测试:链接http://blog.itpub.net/267265/viewspace-2137424/ --//本想测试修改一些重要的信息块,结果提升了scn的结果,但是如果异常关闭,就没有这样的结果. --//前几看http://www.itpub.net/thread-2087326-1-1.html --//很奇怪看到的scn号减少的,理论讲出现这个错误,如果不断重启scn号每次加1,差距不大可以追上.

ORA-600(2662)错误的重现和解决(二)

前两天同事在测试DATA GUARD的时候将主库的ONLINE日志意外覆盖,造成数据库无法打开,采用隐含参数的方法打开又碰到ORA-600错误,最后采用设置EVENTS的方式解决. 由于是在别人的机器上操作,而且很多操作都是摸索进行,因此没有将操作记录下来.现在打算重现一下问题并简单记录解决过程. 上篇已经描述了问题的产生步骤,下面描述解决这个问题的方法. ORA-600(2662)错误的重现和解决(一):http://yangtingkun.itpub.net/post/468/464682

ORACLE的ORA-1693错误以及表和索引的表空间的移动

本公司开发的软件,有客户不能上传大的附件,页面不报任何错误.查看JBOSS日志,同样看不到任何错误,排除了软件本身故障. 在查看oracle数据库日志,发现当上传大的附件时出现错误信息 OEA_1693: MAX # EXTENTS 4096 reached in lobsegment nes.sys_LOB0000024832C00008$$ 解决过程 上网找了下资料 ORA-1693 max # extents (string) reached in lob segment string.s

MySQL5.5安装出现CMake错误找不到CMakelists.txt原因

今天虚拟机上测试安装 CentOS6.3 + PHP5.4.8 + MySQL5.5.28,结果捣鼓了半天 MySQL都没装上,老是CMake目录下找不到那个 lists 文件,郁闷的不行,最后发现问题所在,总结在下面(我是把软件包下载错了): 1. 检查参数是否配置错误  可以参考这里的官方说明 http://dev.mysql.com/doc/refman/5.5/en/source-configuration-options.html#cmake-general-options  我的配置

[20170417]另类提升scn2.txt

[20170417]另类提升scn2.txt --//上个星期的测试偶然发现,通过修改一些块的scn能够提升scn.我还是通过例子说明: --//如果数据库异常关闭,在某种特殊修复后,会出现数据文件块的scn大于数据文件头的scn号,这样在访问这些块时会报: Errors in file /opt/oracle/admin/conner/udump/conner_ora_31607.trc: ORA-00600: internal error code, arguments: [2662], [

plsql连接oracle数据库报ora 12154错误解决方法_oracle

plsql连接oracle数据库报ora 12154错误 今天遇到一个问题,使用sqlplus能够连接到远程的数据库,但是使用plsql却连接不上,报错"ORA-12154: TNS: 无法解析指定的连接标识符" 解决方法如下: 1.先检查服务器端的监听服务是否打开,如果没有打开请启动其监听 客户端:tnsping <tns_name> 服务器Linux下: #>lsnrctl status 查看监听状态 #>lsnrctl start 启动监听 2.通过Sql

掉电引起的ORA-1172错误解决过程(二)

由于UPS故障,导致机房连续多次掉电,问题解决后,发现一台本地测试数据库打开时报错,ORA-1172.ORA-1151错误. 掉电引起的ORA-1172错误解决过程(一):http://yangtingkun.itpub.net/post/468/465223 尝试打开数据库.     上一篇介绍了问题的产生和现象,下面尝试用EVENTS方式打开数据库,不过由于出现ORA-600 2662错误的机制与上面一篇文章不同,因此这里不需要设置隐含参数_allow_resetlogs_corruptio

Oracle的常见错误及解决办法

                      ORA-12528: TNS:listener: all appropriate instances are blocking new connections     ORA-12528问题是因为监听中的服务使用了动态服务,实例虽然启动,但没有注册到监听.实例是通过PMON进程注册到监听上的,而PMON进程需要在MOUNT状态下才会启动.所以造成了上面的错误. 解决这个问题,有三种方法:1.把监听设置为静态:2.在tnsnames.ora中追加(UR=