一例ora 600 2662 错误解决

来源:互联网 发布:全角替换为半角 js 编辑:程序博客网 时间:2024/04/29 14:57

最近想做实验关于 如何调整scn ,看大崔华大牛写的blog 隐含参数_minimum_giga_scn被Oracle废弃后如何调SCN  就想也尝试一下,通过修改控制文件的checkpoint_scn 达到调整scn ,实验过程如下:

操作前切记备份控制文件和数据文件
BBED: Release 2.0.0.0.0 - Limited Production on Fri Feb 10 02:21:19 2017


Copyright (c) 1982, 2011, Oracle and/or its affiliates.  All rights reserved.


************* !!! For Oracle Internal Use only !!! ***************


BBED> set mode edit
        MODE            Edit


BBED> set blocksize 16384
        BLOCKSIZE       16384


BBED> set offset 104
        OFFSET          104


BBED> d count 100
 File: /opt/oracle/oradata/TESTDB/control01.ctl (0)
 Block: 1                Offsets:  104 to  203           Dba:0x00000000
------------------------------------------------------------------------
 a0722700 00000000 5852c337 00000000 00000000 00000000 00000000 00000000 
 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 
 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 
 00000000 


 <32 bytes per line>


BBED> m/x 0100 offset 108
 File: /opt/oracle/oradata/TESTDB/control01.ctl (0)
 Block: 1                Offsets:  108 to  207           Dba:0x00000000
------------------------------------------------------------------------
 01000000 5852c337 00000000 00000000 00000000 00000000 00000000 00000000 
 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 
 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 
 00000000 


 <32 bytes per line>


BBED> d offset 15
 File: /opt/oracle/oradata/TESTDB/control01.ctl (0)
 Block: 1                Offsets:   15 to  114           Dba:0x00000000
------------------------------------------------------------------------
 0439c900 00000000 00000420 0b29e758 9d544553 54444200 00551000 00520200 
 00004000 00000001 00000000 00000000 00000000 00000000 00000000 00000000 
 00000000 00000000 00000000 00000000 0084910e a2aa790d 33a07227 00010000 
 005852c3 


 <32 bytes per line>


BBED> m/x 000000
 File: /opt/oracle/oradata/TESTDB/control01.ctl (0)
 Block: 1                Offsets:   15 to  114           Dba:0x00000000
------------------------------------------------------------------------
 00000000 00000000 00000420 0b29e758 9d544553 54444200 00551000 00520200 
 00004000 00000001 00000000 00000000 00000000 00000000 00000000 00000000 
 00000000 00000000 00000000 00000000 0084910e a2aa790d 33a07227 00010000 
 005852c3 


 <32 bytes per line>


BBED> verify
DBVERIFY - Verification starting
FILE = /opt/oracle/oradata/TESTDB/control01.ctl
BLOCK = 1




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   : 0
Total Blocks Influx           : 0
Message 531 not found;  product=RDBMS; facility=BBED




BBED> sum apply
Check value for File 0, Block 1:
current = 0x0000, required = 0x0000




oracle@suse11sp2:~/product/11.2.0/dbhome_1/dbs> ls
02pgrh56_1_1   init.ora        lkTESTDB     snapcf_TESTDB.f   test.ora
hc_TESTDB.dat  initTESTDB.ora  orapwTESTDB  spfileTESTDB.ora  tmpTESTDB.ora
oracle@suse11sp2:~/product/11.2.0/dbhome_1/dbs> sqlplus / as sysdba


SQL*Plus: Release 11.2.0.4.0 Production on Fri Feb 10 02:30:02 2017


Copyright (c) 1982, 2013, Oracle.  All rights reserved.


Connected to an idle instance.


idle@0> startup mount pfile=test.ora
ORACLE instance started.


Total System Global Area  367439872 bytes
Fixed Size                  2253344 bytes
Variable Size             222301664 bytes
Database Buffers          138412032 bytes
Redo Buffers                4472832 bytes
Database mounted.
idle@0> oradebug dumpvar sga kcsgscn_
ORA-00074: no process has been specified
idle@0> oradebug setmypid
Statement processed.
idle@0> oradebug dumpvar sga kcsgscn_
kcslf kcsgscn_ [06001AE70, 06001AEA0) = 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 6001AB50 00000000
idle@0> alter database open;


Database altered.


idle@0> oradebug dumpvar sga kcsgscn_
kcslf kcsgscn_ [06001AE70, 06001AEA0) = 002773A8 00000001 00000000 00000000 00000015 00000000 00000000 00000000 00000000 00000000 6001AB50 00000000
idle@0> select current_scn from v$database;


CURRENT_SCN
-----------
 4297552831


idle@0> select 1*power(2,32) +to_number('2773A8','xxxxxxx')  from dual;


1*POWER(2,32)+TO_NUMBER('2773A8','XXXXXXX')
-------------------------------------------
                                 4297552808

从实验结果是调整成功了,后来觉得scn 调整太大了,想回退一下,可是我忘记备份了,生产系统切记要备份,很重要!

以下是回退过程,修改数据文件的checkpoint_change#

   BBED> d offset 488 count 20
 File: /opt/oracle/oradata/TESTDB/system01.dbf (1)
 Block: 1                Offsets:  488 to  507           Dba:0x00400001
------------------------------------------------------------------------
 01000000 6056c337 01000000 3d000000 ad5e0100 


 <32 bytes per line>


BBED> m/x 0000 offset 488
 File: /opt/oracle/oradata/TESTDB/system01.dbf (1)
 Block: 1                Offsets:  488 to  507           Dba:0x00400001
------------------------------------------------------------------------
 00000000 6056c337 01000000 3d000000 ad5e0100 


 <32 bytes per line>


BBED> verify
DBVERIFY - Verification starting
FILE = /opt/oracle/oradata/TESTDB/system01.dbf
BLOCK = 1


Block 1 is corrupt
Corrupt block relative dba: 0x00400001 (file 0, block 1)
Bad check value found during verification
Data in bad block:
 type: 11 format: 2 rdba: 0x00400001
 last change scn: 0x0000.00000000 seq: 0x1 flg: 0x04
 spare1: 0x0 spare2: 0x0 spare3: 0x0
 consistency value in tail: 0x00000b01
 check value in block header: 0xcf52
 computed block checksum: 0x1




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           : 0
Message 531 not found;  product=RDBMS; facility=BBED




BBED> d offset 15
 File: /opt/oracle/oradata/TESTDB/system01.dbf (1)
 Block: 1                Offsets:   15 to   34           Dba:0x00400001
------------------------------------------------------------------------
 0452cf00 00000000 00000420 0b29e758 9d544553 

详细过程如下:

 <32 bytes per line>BBED> verifyDBVERIFY - Verification startingFILE = /opt/oracle/oradata/TESTDB/users01.dbfBLOCK = 1DBVERIFY - Verification completeTotal Blocks Examined         : 1Total Blocks Processed (Data) : 0Total Blocks Failing   (Data) : 0Total Blocks Processed (Index): 0Total Blocks Failing   (Index): 0Total Blocks Empty            : 0Total Blocks Marked Corrupt   : 0Total Blocks Influx           : 0Message 531 not found;  product=RDBMS; facility=BBEDBBED> sum applyCheck value for File 4, Block 1:current = 0x0000, required = 0x0000BBED> info all File#  Name                                                        Size(blks) -----  ----                                                        ----------     1  /opt/oracle/oradata/TESTDB/system01.dbf                          96000     2  /opt/oracle/oradata/TESTDB/sysaux01.dbf                          70400     3  /opt/oracle/oradata/TESTDB/undotbs01.dbf                          9600     4  /opt/oracle/oradata/TESTDB/users01.dbf                             640BBED> set filename='/opt/oracle/oradata/TESTDB/test01.dbf'BBED-00202: invalid parameter (=)BBED> set filename '/opt/oracle/oradata/TESTDB/test01.dbf'        FILENAME        /opt/oracle/oradata/TESTDB/test01.dbfBBED> set block 1        BLOCK#          1BBED> p kcvfhckpstruct kcvfhckp, 36 bytes                   @484        struct kcvcpscn, 8 bytes                 @484           ub4 kscnbas                           @484      0x00277496      ub2 kscnwrp                           @488      0x0001   ub4 kcvcptim                             @492      0x37c35660   ub2 kcvcpthr                             @496      0x0001   union u, 12 bytes                        @500           struct kcvcprba, 12 bytes             @500              ub4 kcrbaseq                       @500      0x0000003d         ub4 kcrbabno                       @504      0x00015ead         ub2 kcrbabof                       @508      0x0010   ub1 kcvcpetb[0]                          @512      0x02   ub1 kcvcpetb[1]                          @513      0x00   ub1 kcvcpetb[2]                          @514      0x00   ub1 kcvcpetb[3]                          @515      0x00   ub1 kcvcpetb[4]                          @516      0x00   ub1 kcvcpetb[5]                          @517      0x00   ub1 kcvcpetb[6]                          @518      0x00   ub1 kcvcpetb[7]                          @519      0x00BBED> m/x 0000 offset 488 File: /opt/oracle/oradata/TESTDB/test01.dbf (0) Block: 1                Offsets:  488 to  507           Dba:0x00000000------------------------------------------------------------------------ 00000000 6056c337 01000000 3d000000 ad5e0100  <32 bytes per line>BBED> verifyDBVERIFY - Verification startingFILE = /opt/oracle/oradata/TESTDB/test01.dbfBLOCK = 1Block 1 is corruptCorrupt block relative dba: 0x01400001 (file 0, block 1)Bad check value found during verificationData in bad block: type: 11 format: 2 rdba: 0x01400001 last change scn: 0x0000.00000000 seq: 0x1 flg: 0x04 spare1: 0x0 spare2: 0x0 spare3: 0x0 consistency value in tail: 0x00000b01 check value in block header: 0x514e computed block checksum: 0x1DBVERIFY - Verification completeTotal Blocks Examined         : 1Total Blocks Processed (Data) : 0Total Blocks Failing   (Data) : 0Total Blocks Processed (Index): 0Total Blocks Failing   (Index): 0Total Blocks Empty            : 0Total Blocks Marked Corrupt   : 1Total Blocks Influx           : 0Message 531 not found;  product=RDBMS; facility=BBEDBBED> d offset 15 File: /opt/oracle/oradata/TESTDB/test01.dbf (0) Block: 1                Offsets:   15 to   34           Dba:0x00000000------------------------------------------------------------------------ 044e5100 00000000 00000420 0b29e758 9d544553  <32 bytes per line>BBED> m/x 000000 File: /opt/oracle/oradata/TESTDB/test01.dbf (0) Block: 1                Offsets:   15 to   34           Dba:0x00000000------------------------------------------------------------------------ 00000000 00000000 00000420 0b29e758 9d544553  <32 bytes per line>BBED> verifyDBVERIFY - Verification startingFILE = /opt/oracle/oradata/TESTDB/test01.dbfBLOCK = 1DBVERIFY - Verification completeTotal Blocks Examined         : 1Total Blocks Processed (Data) : 0Total Blocks Failing   (Data) : 0Total Blocks Processed (Index): 0Total Blocks Failing   (Index): 0Total Blocks Empty            : 0Total Blocks Marked Corrupt   : 0Total Blocks Influx           : 0Message 531 not found;  product=RDBMS; facility=BBEDBBED> sum applyCheck value for File 0, Block 1:current = 0x0000, required = 0x0000BBED> set file 1 block 1        FILE#           1        BLOCK#          1BBED> map File: /opt/oracle/oradata/TESTDB/system01.dbf (1) Block: 1                                     Dba:0x00400001------------------------------------------------------------ Data File Header struct kcvfh, 860 bytes                    @0        ub4 tailchk                                @8188    BBED> map /v File: /opt/oracle/oradata/TESTDB/system01.dbf (1) Block: 1                                     Dba:0x00400001------------------------------------------------------------ Data File Header struct kcvfh, 860 bytes                    @0           struct kcvfhbfh, 20 bytes               @0           struct kcvfhhdr, 76 bytes               @20          ub4 kcvfhrdb                            @96          struct kcvfhcrs, 8 bytes                @100         ub4 kcvfhcrt                            @108         ub4 kcvfhrlc                            @112         struct kcvfhrls, 8 bytes                @116         ub4 kcvfhbti                            @124         struct kcvfhbsc, 8 bytes                @128         ub2 kcvfhbth                            @136         ub2 kcvfhsta                            @138         struct kcvfhckp, 36 bytes               @484         ub4 kcvfhcpc                            @140         ub4 kcvfhrts                            @144         ub4 kcvfhccc                            @148         struct kcvfhbcp, 36 bytes               @152         ub4 kcvfhbhz                            @312         struct kcvfhxcd, 16 bytes               @316         sword kcvfhtsn                          @332         ub2 kcvfhtln                            @336         text kcvfhtnm[30]                       @338         ub4 kcvfhrfn                            @368         struct kcvfhrfs, 8 bytes                @372         ub4 kcvfhrft                            @380         struct kcvfhafs, 8 bytes                @384         ub4 kcvfhbbc                            @392         ub4 kcvfhncb                            @396         ub4 kcvfhmcb                            @400         ub4 kcvfhlcb                            @404         ub4 kcvfhbcs                            @408         ub2 kcvfhofb                            @412         ub2 kcvfhnfb                            @414         ub4 kcvfhprc                            @416         struct kcvfhprs, 8 bytes                @420         struct kcvfhprfs, 8 bytes               @428         ub4 kcvfhtrt                            @444      ub4 tailchk                                @8188    BBED> p kcvfhckpstruct kcvfhckp, 36 bytes                   @484        struct kcvcpscn, 8 bytes                 @484           ub4 kscnbas                           @484      0x00277496      ub2 kscnwrp                           @488      0x0000   ub4 kcvcptim                             @492      0x37c35660   ub2 kcvcpthr                             @496      0x0001   union u, 12 bytes                        @500           struct kcvcprba, 12 bytes             @500              ub4 kcrbaseq                       @500      0x0000003d         ub4 kcrbabno                       @504      0x00015ead         ub2 kcrbabof                       @508      0x0010   ub1 kcvcpetb[0]                          @512      0x02   ub1 kcvcpetb[1]                          @513      0x00   ub1 kcvcpetb[2]                          @514      0x00   ub1 kcvcpetb[3]                          @515      0x00   ub1 kcvcpetb[4]                          @516      0x00   ub1 kcvcpetb[5]                          @517      0x00   ub1 kcvcpetb[6]                          @518      0x00   ub1 kcvcpetb[7]                          @519      0x00BBED> d offset 492 File: /opt/oracle/oradata/TESTDB/system01.dbf (1) Block: 1                Offsets:  492 to  511           Dba:0x00400001------------------------------------------------------------------------ 6056c337 01000000 3d000000 ad5e0100 10001a74  <32 bytes per line>BBED> m/x 5852c337 File: /opt/oracle/oradata/TESTDB/system01.dbf (1) Block: 1                Offsets:  492 to  511           Dba:0x00400001------------------------------------------------------------------------ 5852c337 01000000 3d000000 ad5e0100 10001a74  <32 bytes per line>BBED> verifyDBVERIFY - Verification startingFILE = /opt/oracle/oradata/TESTDB/system01.dbfBLOCK = 1DBVERIFY - Verification completeTotal Blocks Examined         : 1Total Blocks Processed (Data) : 0Total Blocks Failing   (Data) : 0Total Blocks Processed (Index): 0Total Blocks Failing   (Index): 0Total Blocks Empty            : 0Total Blocks Marked Corrupt   : 0Total Blocks Influx           : 0Message 531 not found;  product=RDBMS; facility=BBEDBBED> sum applyCheck value for File 1, Block 1:current = 0x0000, required = 0x0000BBED> undoBBED> modify /x 6056C337 filename '/opt/oracle/oradata/TESTDB/system01.dbf' block 1. offset 492. File: /opt/oracle/oradata/TESTDB/system01.dbf (1) Block: 1                Offsets:  492 to  511           Dba:0x00400001------------------------------------------------------------------------ 6056c337 01000000 3d000000 ad5e0100 10001a74  <32 bytes per line>BBED> verifyDBVERIFY - Verification startingFILE = /opt/oracle/oradata/TESTDB/system01.dbfBLOCK = 1DBVERIFY - Verification completeTotal Blocks Examined         : 1Total Blocks Processed (Data) : 0Total Blocks Failing   (Data) : 0Total Blocks Processed (Index): 0Total Blocks Failing   (Index): 0Total Blocks Empty            : 0Total Blocks Marked Corrupt   : 0Total Blocks Influx           : 0Message 531 not found;  product=RDBMS; facility=BBEDBBED> sum applyCheck value for File 1, Block 1:current = 0x0000, required = 0x0000BBED> set block 1        BLOCK#          1BBED> set offset 484        OFFSET          484BBED> d File: /opt/oracle/oradata/TESTDB/system01.dbf (1) Block: 1                Offsets:  484 to  503           Dba:0x00400001------------------------------------------------------------------------ 96742700 00000000 6056c337 01000000 3d000000  <32 bytes per line>BBED> p kcvfhckpstruct kcvfhckp, 36 bytes                   @484        struct kcvcpscn, 8 bytes                 @484           ub4 kscnbas                           @484      0x00277496      ub2 kscnwrp                           @488      0x0000   ub4 kcvcptim                             @492      0x37c35660   ub2 kcvcpthr                             @496      0x0001   union u, 12 bytes                        @500           struct kcvcprba, 12 bytes             @500              ub4 kcrbaseq                       @500      0x0000003d         ub4 kcrbabno                       @504      0x00015ead         ub2 kcrbabof                       @508      0x0010   ub1 kcvcpetb[0]                          @512      0x02   ub1 kcvcpetb[1]                          @513      0x00   ub1 kcvcpetb[2]                          @514      0x00   ub1 kcvcpetb[3]                          @515      0x00   ub1 kcvcpetb[4]                          @516      0x00   ub1 kcvcpetb[5]                          @517      0x00   ub1 kcvcpetb[6]                          @518      0x00   ub1 kcvcpetb[7]                          @519      0x00BBED> m/x 0100 offset 488 File: /opt/oracle/oradata/TESTDB/system01.dbf (1) Block: 1                Offsets:  488 to  507           Dba:0x00400001------------------------------------------------------------------------ 01000000 6056c337 01000000 3d000000 ad5e0100  <32 bytes per line>BBED> verifyDBVERIFY - Verification startingFILE = /opt/oracle/oradata/TESTDB/system01.dbfBLOCK = 1DBVERIFY - Verification completeTotal Blocks Examined         : 1Total Blocks Processed (Data) : 0Total Blocks Failing   (Data) : 0Total Blocks Processed (Index): 0Total Blocks Failing   (Index): 0Total Blocks Empty            : 0Total Blocks Marked Corrupt   : 0Total Blocks Influx           : 0Message 531 not found;  product=RDBMS; facility=BBEDBBED> sum applyCheck value for File 1, Block 1:current = 0x0000, required = 0x0000BBED> set file 2 block 1        FILE#           2        BLOCK#          1BBED> d offset 488 File: /opt/oracle/oradata/TESTDB/sysaux01.dbf (2) Block: 1                Offsets:  488 to  507           Dba:0x00800001------------------------------------------------------------------------ 00000000 6056c337 01000000 3d000000 ad5e0100  <32 bytes per line>BBED> m/x 0100  File: /opt/oracle/oradata/TESTDB/sysaux01.dbf (2) Block: 1                Offsets:  488 to  507           Dba:0x00800001------------------------------------------------------------------------ 01000000 6056c337 01000000 3d000000 ad5e0100  <32 bytes per line>BBED> verifyDBVERIFY - Verification startingFILE = /opt/oracle/oradata/TESTDB/sysaux01.dbfBLOCK = 1DBVERIFY - Verification completeTotal Blocks Examined         : 1Total Blocks Processed (Data) : 0Total Blocks Failing   (Data) : 0Total Blocks Processed (Index): 0Total Blocks Failing   (Index): 0Total Blocks Empty            : 0Total Blocks Marked Corrupt   : 0Total Blocks Influx           : 0Message 531 not found;  product=RDBMS; facility=BBEDBBED> sum apply Check value for File 2, Block 1:current = 0x0000, required = 0x0000BBED> set file 3 block 1        FILE#           3        BLOCK#          1BBED> m/x 0100 offset 488 File: /opt/oracle/oradata/TESTDB/undotbs01.dbf (3) Block: 1                Offsets:  488 to  507           Dba:0x00c00001------------------------------------------------------------------------ 01000000 6056c337 01000000 3d000000 ad5e0100  <32 bytes per line>BBED> verifyDBVERIFY - Verification startingFILE = /opt/oracle/oradata/TESTDB/undotbs01.dbfBLOCK = 1DBVERIFY - Verification completeTotal Blocks Examined         : 1Total Blocks Processed (Data) : 0Total Blocks Failing   (Data) : 0Total Blocks Processed (Index): 0Total Blocks Failing   (Index): 0Total Blocks Empty            : 0Total Blocks Marked Corrupt   : 0Total Blocks Influx           : 0Message 531 not found;  product=RDBMS; facility=BBEDBBED> sum applyCheck value for File 3, Block 1:current = 0x0000, required = 0x0000BBED> set file 4 block 1        FILE#           4        BLOCK#          1BBED> m/x 0100 offset 488 File: /opt/oracle/oradata/TESTDB/users01.dbf (4) Block: 1                Offsets:  488 to  507           Dba:0x01000001------------------------------------------------------------------------ 01000000 6056c337 01000000 3d000000 ad5e0100  <32 bytes per line>BBED> verifyDBVERIFY - Verification startingFILE = /opt/oracle/oradata/TESTDB/users01.dbfBLOCK = 1DBVERIFY - Verification completeTotal Blocks Examined         : 1Total Blocks Processed (Data) : 0Total Blocks Failing   (Data) : 0Total Blocks Processed (Index): 0Total Blocks Failing   (Index): 0Total Blocks Empty            : 0Total Blocks Marked Corrupt   : 0Total Blocks Influx           : 0Message 531 not found;  product=RDBMS; facility=BBEDBBED> sum applyCheck value for File 4, Block 1:current = 0x0000, required = 0x0000BBED> set file 5BBED-00205: illegal or out of range DBA (File 5, Block 1)BBED> set filename '/opt/oracle/oradata/TESTDB/test01.dbf'        FILENAME        /opt/oracle/oradata/TESTDB/test01.dbfBBED> set block 1        BLOCK#          1BBED> m/x 0100 offset 488 File: /opt/oracle/oradata/TESTDB/test01.dbf (0) Block: 1                Offsets:  488 to  507           Dba:0x00000000------------------------------------------------------------------------ 01000000 6056c337 01000000 3d000000 ad5e0100  <32 bytes per line>BBED> verifyDBVERIFY - Verification startingFILE = /opt/oracle/oradata/TESTDB/test01.dbfBLOCK = 1DBVERIFY - Verification completeTotal Blocks Examined         : 1Total Blocks Processed (Data) : 0Total Blocks Failing   (Data) : 0Total Blocks Processed (Index): 0Total Blocks Failing   (Index): 0Total Blocks Empty            : 0Total Blocks Marked Corrupt   : 0Total Blocks Influx           : 0Message 531 not found;  product=RDBMS; facility=BBEDBBED> sum applyCheck value for File 0, Block 1:current = 0x0000, required = 0x0000

此时打开数据库肯定要报错误,提升要恢复,因为控制文件的checkpoint scn  大于数据文件头的checkpoint scn

想到了需要重建控制文件点击打开链接

1、重建控制文件no resetlogs 

2、重建控制文件 resetlogs 

  昨天使用了第一种方法,重建控制文件,没有resetlogs ,控制文件的checkpoint 从 online redo 读取的,scn 依然是第一次调整后的scn值,scn 没有和数据文件头的checkpoint 一致

今天尝试了使用第二种 重建控制文件 resetlogs 的方法

操作过程如下,结果是没有成功,出现了经典的2662 错误,以前也看到了,此类的文章,大概的思路是调整scn,

idle@0> CREATE CONTROLFILE REUSE DATABASE "TESTDB" RESETLOGS  NOARCHIVELOG  2      MAXLOGFILES 16  3      MAXLOGMEMBERS 3  4      MAXDATAFILES 100  5      MAXINSTANCES 8  6      MAXLOGHISTORY 292  7  LOGFILE  8    GROUP 1 '/opt/oracle/oradata/TESTDB/redo01.log'  SIZE 50M BLOCKSIZE 512,  9    GROUP 2 '/opt/oracle/oradata/TESTDB/redo02.log'  SIZE 50M BLOCKSIZE 512, 10    GROUP 3 '/opt/oracle/oradata/TESTDB/redo03.log'  SIZE 50M BLOCKSIZE 512 11  -- STANDBY LOGFILE 12  DATAFILE 13    '/opt/oracle/oradata/TESTDB/system01.dbf', 14    '/opt/oracle/oradata/TESTDB/sysaux01.dbf', 15    '/opt/oracle/oradata/TESTDB/undotbs01.dbf', 16    '/opt/oracle/oradata/TESTDB/users01.dbf', 17    '/opt/oracle/oradata/TESTDB/test01.dbf' 18  CHARACTER SET ZHS16GBK 19  ;Control file created.idle@0> recover database using backup controlfile until cancel;ORA-00279: change 2587627 generated at 02/15/2017 20:31:17 needed for thread 1ORA-00289: suggestion : /opt/oracle/product/11.2.0/dbhome_1/dbs/arch1_1_936045072.dbfORA-00280: change 2587627 for thread 1 is in sequence #1Specify log: {<RET>=suggested | filename | AUTO | CANCEL}/opt/oracle/oradata/TESTDB/redo01.logLog applied.Media recovery complete.idle@0> select checkpoint_change# from v$database;CHECKPOINT_CHANGE#------------------                 0idle@0> select checkpoint_change# from v$datafile;CHECKPOINT_CHANGE#------------------           2587629           2587629           2587629           2587629           2587629idle@0> select checkpoint_change# from v$datafile_header;CHECKPOINT_CHANGE#------------------           2587629           2587629           2587629           2587629           2587629idle@0> alter database open resetlogs;alter database open resetlogs*ERROR at line 1:ORA-01092: ORACLE instance terminated. Disconnection forcedORA-00600: internal error code, arguments: [2662], [0], [2587636], [1], [2587618], [4194432], [],[], [], [], [], []Process ID: 4219Session ID: 125 Serial number: 3


查看mos 文档关于此错误介绍:

ORA-600 [2662] "Block SCN is ahead of Current SCN" (Doc ID 28929.1)To BottomNote: For additional ORA-600 related information please read Note:146580.1PURPOSE:              This article discusses the internal error "ORA-600 [2662]", what   it means and possible actions. The information here is only applicable   to the versions listed and is provided only for guidance. ERROR:                Format: ORA-600 [2662] [a] [b] [c] [d] [e] VERSIONS:  versions 6.0 to 12.1 DESCRIPTION:  A data block SCN is ahead of the current SCN.  The ORA-600 [2662] occurs when an SCN is compared to the dependent SCN   stored in a UGA variable.  If the SCN is less than the dependent SCN then we signal the ORA-600 [2662]  internal error.ARGUMENTS:  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. FUNCTIONALITY:        File and IO buffer management for redo logs IMPACT:  INSTANCE FAILURE  POSSIBLE PHYSICAL CORRUPTION SUGGESTIONS:               There are different situations where ORA-600 [2662] can be raised.  It can be raised on startup or during database operation.  If not using Parallel Server, check that 2 instances have not mounted  the same database.  Check for SMON traces and have the alert.log and trace files ready  to send to support.  Check the SCN difference [argument d]-[argument b].  If the SCNs in the error are very close, then try to shutdown and startup  the instance several times.   In some situations, the SCN increment during startup may permit the   database to open. Keep track of the number of times you attempted a   startup.  If the Known Issues section below does not help in terms of identifying  a solution, please submit the trace files and alert.log to Oracle  Support Services for further analysis.   Known Issues:You can restrict the list below to issues likely to affect one of the following versions by clicking the relevant button:       The list below is restricted to show only bugs believed to affect version 11.2.0.4.Other bugs may affect this version but have not been confirmed as being relevant yet.There are 0 bugs listed.NBProbBugFixedDescription'*' indicates that an alert exists for that issue. '+' indicates a particularly notable issue / bug. See Note:1944526.1 for details of other symbols used 

查阅了大师blog eygle 关于2662 的案例后
点击打开链接

http://www.eygle.com/archives/2005/12/oracle_diagnostics_howto_deal_2662_error.html

如果调整scn变大和我的方法向矛盾,仔细看看错误 

ORA-00600: internal error code, arguments: [2662], [0], [2587636], [1], [2587618], [4194432], [],

ORA-00600: internal error code, arguments: [2662], [0], [2587642], [1], [2587618], [4194432], [],

                                                                        [2662],a, b,c,d,e

这里表红色的1 就是我最初在控制文件修改的scn wrap ,scn 有scn wrap +base 组成,wrap 占2个字节,base占4个字节,通常 wrap 都是0,当base 使用完后 wrap 会加1

查看trace 文件 

oracle@suse11sp2:~/oradata/TESTDB> cat /opt/oracle/diag/rdbms/testdb/TESTDB/incident/incdir_96189/TESTDB_ora_4411_i96189.trc|grep "scn: 0x0001" -b22436816-              where: kdswh02: kdsgrp, why: 02436861-            buffer tsn: 0 rdba: 0x004000e1 (1/225)2436912:            scn: 0x0001.00277be2 seq: 0x01 flg: 0x06 tail: 0x7be206012436982-            frmt: 0x02 chkval: 0x94fd type: 0x06=trans data2437042-Hex dump of block: st=0, typ_found=1--3240542-  LRBA: [0x0.0.0] LSCN: [0x0.0] HSCN: [0xffff.ffffffff] HSUB: [65535]3240612-  buffer tsn: 0 rdba: 0x00400080 (1/128)3240653:  scn: 0x0001.00277be2 seq: 0x01 flg: 0x04 tail: 0x7be20e013240713-  frmt: 0x02 chkval: 0x7bee type: 0x0e=KTU UNDO HEADER W/UNLIMITED EXTENTS3240788-Hex dump of block: st=0, typ_found=1--3277343-  LRBA: [0x0.0.0] LSCN: [0x0.0] HSCN: [0xffff.ffffffff] HSUB: [65535]3277413-  buffer tsn: 0 rdba: 0x004000e1 (1/225)3277454:  scn: 0x0001.00277be2 seq: 0x01 flg: 0x06 tail: 0x7be206013277514-  frmt: 0x02 chkval: 0x94fd type: 0x06=trans data3277564-Hex dump of block: st=0, typ_found=1--3316953-  flags:3316962-  buffer tsn: 0 rdba: 0x0040022b (1/555)3317003:  scn: 0x0001.00277be1 seq: 0x06 flg: 0x04 tail: 0x7be102063317063-  frmt: 0x02 chkval: 0xac7b type: 0x02=KTU UNDO BLOCK3317117-Hex dump of block: st=0, typ_found=1

这个3个块 128、225、555 scn wrap 是0x0001,猜想是应该这些的块的scn 大于系统的checkpoint_change# 值,导致错误 600 2662 错误,决定尝试通过bbed 修改块的scn值

BBED> p wrp_kcbhub2 wrp_kcbh                                @12       0x0001BBED> m/x 0000 offset 12Warning: contents of previous BIFILE will be lost. Proceed? (Y/N) y File: /opt/oracle/oradata/TESTDB/system01.dbf (1) Block: 225              Offsets:   12 to  523           Dba:0x004000e1------------------------------------------------------------------------ 00000106 fd940000 01000000 0f000000 e17b2700 01000000 01f80300 00000000  00002600 24000000 2b024000 23000500 0a200100 e27b2700 00011500 ffff3c00  4b05111a 121a0000 15008e1f 8f05d405 4b055e06 a306e706 2c077107 b507fa07  f516b616 74163216 f015ae15 6c152a15 e814a614 00000000 00000000 00000000  00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000  00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000  00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000  00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000  00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000  00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000  00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000  00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000  00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000  00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000  00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000  00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000  <32 bytes per line>BBED> verifyDBVERIFY - Verification startingFILE = /opt/oracle/oradata/TESTDB/system01.dbfBLOCK = 225Block 225 is corruptCorrupt block relative dba: 0x004000e1 (file 0, block 225)Bad check value found during verificationData in bad block: type: 6 format: 2 rdba: 0x004000e1 last change scn: 0x0000.00277be2 seq: 0x1 flg: 0x06 spare1: 0x0 spare2: 0x0 spare3: 0x0 consistency value in tail: 0x7be20601 check value in block header: 0x94fd computed block checksum: 0x1DBVERIFY - Verification completeTotal Blocks Examined         : 1Total Blocks Processed (Data) : 0Total Blocks Failing   (Data) : 0Total Blocks Processed (Index): 0Total Blocks Failing   (Index): 0Total Blocks Empty            : 0Total Blocks Marked Corrupt   : 1Total Blocks Influx           : 0Message 531 not found;  product=RDBMS; facility=BBEDBBED> d offset 15 File: /opt/oracle/oradata/TESTDB/system01.dbf (1) Block: 225              Offsets:   15 to  526           Dba:0x004000e1------------------------------------------------------------------------ 06fd9400 00010000 000f0000 00e17b27 00010000 0001f803 00000000 00000026  00240000 002b0240 00230005 000a2001 00e27b27 00000115 00ffff3c 004b0511  1a121a00 0015008e 1f8f05d4 054b055e 06a306e7 062c0771 07b507fa 07f516b6  16741632 16f015ae 156c152a 15e814a6 14000000 00000000 00000000 00000000  00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000  00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000  00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000  00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000  00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000  00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000  00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000  00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000  00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000  00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000  00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000  00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000  <32 bytes per line>BBED> m/x 000000 offset 15 File: /opt/oracle/oradata/TESTDB/system01.dbf (1) Block: 225              Offsets:   15 to  526           Dba:0x004000e1------------------------------------------------------------------------ 00000000 00010000 000f0000 00e17b27 00010000 0001f803 00000000 00000026  00240000 002b0240 00230005 000a2001 00e27b27 00000115 00ffff3c 004b0511  1a121a00 0015008e 1f8f05d4 054b055e 06a306e7 062c0771 07b507fa 07f516b6  16741632 16f015ae 156c152a 15e814a6 14000000 00000000 00000000 00000000  00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000  00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000  00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000  00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000  00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000  00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000  00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000  00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000  00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000  00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000  00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000  00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000  <32 bytes per line>BBED> verifyDBVERIFY - Verification startingFILE = /opt/oracle/oradata/TESTDB/system01.dbfBLOCK = 225DBVERIFY - Verification completeTotal Blocks Examined         : 1Total Blocks Processed (Data) : 1Total Blocks Failing   (Data) : 0Total Blocks Processed (Index): 0Total Blocks Failing   (Index): 0Total Blocks Empty            : 0Total Blocks Marked Corrupt   : 0Total Blocks Influx           : 0Message 531 not found;  product=RDBMS; facility=BBEDBBED> sum applyCheck value for File 1, Block 225:current = 0x0000, required = 0x0000BBED> set dba 1,306        DBA             0x00400132 (4194610 1,306)BBED> map File: /opt/oracle/oradata/TESTDB/system01.dbf (1) Block: 306                                   Dba:0x00400132------------------------------------------------------------ KTB Data Block (Index Leaf) struct kcbh, 20 bytes                      @0        struct ktbbh, 72 bytes                     @20       struct kdxle, 32 bytes                     @92       sb2 kd_off[502]                            @124      ub1 freespace[5]                           @1128     ub1 rowdata[6987]                          @1133     ub4 tailchk                                @8188    BBED> p kcbhstruct 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        0x00400132   ub4 bas_kcbh                             @8        0x00015f12   ub2 wrp_kcbh                             @12       0x0000   ub1 seq_kcbh                             @14       0x01   ub1 flg_kcbh                             @15       0x04 (KCBHFCKV)   ub2 chkval_kcbh                          @16       0xc628   ub2 spare3_kcbh                          @18       0x0000BBED> set block 3009        BLOCK#          3009BBED> 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        0x00400bc1   ub4 bas_kcbh                             @8        0x00002513   ub2 wrp_kcbh                             @12       0x0000   ub1 seq_kcbh                             @14       0x01   ub1 flg_kcbh                             @15       0x06 (KCBHFDLC, KCBHFCKV)   ub2 chkval_kcbh                          @16       0xe847   ub2 spare3_kcbh                          @18       0x0000BBED> set block 385        BLOCK#          385BBED> p kcbhstruct 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        0x00400181   ub4 bas_kcbh                             @8        0x000cfb9d   ub2 wrp_kcbh                             @12       0x0000   ub1 seq_kcbh                             @14       0x01   ub1 flg_kcbh                             @15       0x04 (KCBHFCKV)   ub2 chkval_kcbh                          @16       0x4991   ub2 spare3_kcbh                          @18       0x0000BBED> set block 386        BLOCK#          386BBED> p kcbhstruct 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        0x00400182   ub4 bas_kcbh                             @8        0x00003db6   ub2 wrp_kcbh                             @12       0x0000   ub1 seq_kcbh                             @14       0x01   ub1 flg_kcbh                             @15       0x04 (KCBHFCKV)   ub2 chkval_kcbh                          @16       0xd095   ub2 spare3_kcbh                          @18       0x0000BBED> set block 3341        BLOCK#          3341BBED> p kcbhstruct 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        0x00400d0d   ub4 bas_kcbh                             @8        0x00274fef   ub2 wrp_kcbh                             @12       0x0000   ub1 seq_kcbh                             @14       0x01   ub1 flg_kcbh                             @15       0x06 (KCBHFDLC, KCBHFCKV)   ub2 chkval_kcbh                          @16       0xd8d5   ub2 spare3_kcbh                          @18       0x0000BBED> set block 169        BLOCK#          169BBED> p kcbhstruct 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        0x004000a9   ub4 bas_kcbh                             @8        0x000cfbea   ub2 wrp_kcbh                             @12       0x0000   ub1 seq_kcbh                             @14       0x01   ub1 flg_kcbh                             @15       0x04 (KCBHFCKV)   ub2 chkval_kcbh                          @16       0x7ec2   ub2 spare3_kcbh                          @18       0x0000BBED> set block 170        BLOCK#          170BBED> p kcbhstruct 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        0x004000aa   ub4 bas_kcbh                             @8        0x000fd2d9   ub2 wrp_kcbh                             @12       0x0000   ub1 seq_kcbh                             @14       0x01   ub1 flg_kcbh                             @15       0x06 (KCBHFDLC, KCBHFCKV)   ub2 chkval_kcbh                          @16       0x918a   ub2 spare3_kcbh                          @18       0x0000BBED> set block 128        BLOCK#          128BBED> p kcbhstruct kcbh, 20 bytes                       @0          ub1 type_kcbh                            @0        0x0e   ub1 frmt_kcbh                            @1        0xa2   ub1 spare1_kcbh                          @2        0x00   ub1 spare2_kcbh                          @3        0x00   ub4 rdba_kcbh                            @4        0x00400080   ub4 bas_kcbh                             @8        0x00277be2   ub2 wrp_kcbh                             @12       0x0001   ub1 seq_kcbh                             @14       0x01   ub1 flg_kcbh                             @15       0x04 (KCBHFCKV)   ub2 chkval_kcbh                          @16       0x7bee   ub2 spare3_kcbh                          @18       0x0000BBED> m/x offset 0000 offset 12BBED-00209: invalid number (offset)BBED> m/x 0000 offset 12 File: /opt/oracle/oradata/TESTDB/system01.dbf (1) Block: 128              Offsets:   12 to  523           Dba:0x00400080------------------------------------------------------------------------ 00000104 ee7b0000 00000000 00000000 00000000 00000000 06000000 2f000000  20100000 05000000 03000000 08000000 2b024000 00000000 05000000 00000000  00000000 00000000 00000000 00000000 06000000 00000000 00000000 00000040  81004000 07000000 88004000 08000000 10024000 08000000 18024000 08000000  20024000 08000000 28024000 08000000 00000000 00000000 00000000 00000000  00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000  00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000  00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000  00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000  00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000  00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000  00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000  00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000  00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000  00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000  00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000  <32 bytes per line>BBED> verifyDBVERIFY - Verification startingFILE = /opt/oracle/oradata/TESTDB/system01.dbfBLOCK = 128Block 128 is corruptCorrupt block relative dba: 0x00400080 (file 0, block 128)Bad check value found during verificationData in bad block: type: 14 format: 2 rdba: 0x00400080 last change scn: 0x0000.00277be2 seq: 0x1 flg: 0x04 spare1: 0x0 spare2: 0x0 spare3: 0x0 consistency value in tail: 0x7be20e01 check value in block header: 0x7bee computed block checksum: 0x1DBVERIFY - Verification completeTotal Blocks Examined         : 1Total Blocks Processed (Data) : 0Total Blocks Failing   (Data) : 0Total Blocks Processed (Index): 0Total Blocks Failing   (Index): 0Total Blocks Empty            : 0Total Blocks Marked Corrupt   : 1Total Blocks Influx           : 0Message 531 not found;  product=RDBMS; facility=BBEDBBED> d offset 15 File: /opt/oracle/oradata/TESTDB/system01.dbf (1) Block: 128              Offsets:   15 to  526           Dba:0x00400080------------------------------------------------------------------------ 04ee7b00 00000000 00000000 00000000 00000000 00060000 002f0000 00201000  00050000 00030000 00080000 002b0240 00000000 00050000 00000000 00000000  00000000 00000000 00000000 00060000 00000000 00000000 00000000 40810040  00070000 00880040 00080000 00100240 00080000 00180240 00080000 00200240  00080000 00280240 00080000 00000000 00000000 00000000 00000000 00000000  00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000  00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000  00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000  00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000  00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000  00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000  00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000  00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000  00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000  00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000  00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000  <32 bytes per line>BBED> m/x 000000  File: /opt/oracle/oradata/TESTDB/system01.dbf (1) Block: 128              Offsets:   15 to  526           Dba:0x00400080------------------------------------------------------------------------ 00000000 00000000 00000000 00000000 00000000 00060000 002f0000 00201000  00050000 00030000 00080000 002b0240 00000000 00050000 00000000 00000000  00000000 00000000 00000000 00060000 00000000 00000000 00000000 40810040  00070000 00880040 00080000 00100240 00080000 00180240 00080000 00200240  00080000 00280240 00080000 00000000 00000000 00000000 00000000 00000000  00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000  00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000  00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000  00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000  00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000  00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000  00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000  00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000  00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000  00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000  00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000  <32 bytes per line>BBED> verifyDBVERIFY - Verification startingFILE = /opt/oracle/oradata/TESTDB/system01.dbfBLOCK = 128DBVERIFY - Verification completeTotal Blocks Examined         : 1Total Blocks Processed (Data) : 0Total Blocks Failing   (Data) : 0Total Blocks Processed (Index): 0Total Blocks Failing   (Index): 0Total Blocks Empty            : 0Total Blocks Marked Corrupt   : 0Total Blocks Influx           : 0Message 531 not found;  product=RDBMS; facility=BBEDBBED> sum applyCheck value for File 1, Block 128:current = 0x0000, required = 0x0000BBED> set block 225        BLOCK#          225BBED> p kcbhstruct 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        0x00277be2   ub2 wrp_kcbh                             @12       0x0000   ub1 seq_kcbh                             @14       0x01   ub1 flg_kcbh                             @15       0x00 (NONE)   ub2 chkval_kcbh                          @16       0x0000   ub2 spare3_kcbh                          @18       0x0000BBED> set block 555        BLOCK#          555BBED> p kcbhstruct kcbh, 20 bytes                       @0          ub1 type_kcbh                            @0        0x02   ub1 frmt_kcbh                            @1        0xa2   ub1 spare1_kcbh                          @2        0x00   ub1 spare2_kcbh                          @3        0x00   ub4 rdba_kcbh                            @4        0x0040022b   ub4 bas_kcbh                             @8        0x00277be1   ub2 wrp_kcbh                             @12       0x0001   ub1 seq_kcbh                             @14       0x06   ub1 flg_kcbh                             @15       0x04 (KCBHFCKV)   ub2 chkval_kcbh                          @16       0xac7b   ub2 spare3_kcbh                          @18       0x0000BBED> m/x 0000 offset 12 File: /opt/oracle/oradata/TESTDB/system01.dbf (1) Block: 555              Offsets:   12 to  523           Dba:0x0040022b------------------------------------------------------------------------ 00000604 7bac0000 00002600 24000000 23000505 0000e81f 201f581e 901dc81c  001c0000 00000000 00000000 00000000 00000000 00000000 00000000 00000000  00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000  00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000  00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000  00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000  00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000  00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000  00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000  00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000  00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000  00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000  00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000  00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000  00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000  00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000  <32 bytes per line>BBED> m/x 000000 offset 15 File: /opt/oracle/oradata/TESTDB/system01.dbf (1) Block: 555              Offsets:   15 to  526           Dba:0x0040022b------------------------------------------------------------------------ 00000000 00000026 00240000 00230005 050000e8 1f201f58 1e901dc8 1c001c00  00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000  00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000  00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000  00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000  00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000  00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000  00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000  00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000  00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000  00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000  00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000  00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000  00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000  00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000  00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000  <32 bytes per line>BBED> verifyDBVERIFY - Verification startingFILE = /opt/oracle/oradata/TESTDB/system01.dbfBLOCK = 555DBVERIFY - Verification completeTotal Blocks Examined         : 1Total Blocks Processed (Data) : 0Total Blocks Failing   (Data) : 0Total Blocks Processed (Index): 0Total Blocks Failing   (Index): 0Total Blocks Empty            : 0Total Blocks Marked Corrupt   : 0Total Blocks Influx           : 0Message 531 not found;  product=RDBMS; facility=BBEDBBED> sum applyCheck value for File 1, Block 555:current = 0x0000, required = 0x0000 

操作过程如上,就修改两个地方偏移量12,0001=>0000(linux 小端,需要反过来,高位低位 对调,这里都是0 就无所谓了) ,偏移量 15、16、17 全部清0,不然会变成corrupt

最后重新重建控制文件resetlogs 后成功打开数据库

idle@0> shutdown abortORACLE instance shut down.idle@0> startup nomountORACLE instance started.Total System Global Area  367439872 bytesFixed Size                  2253344 bytesVariable Size             234884576 bytesDatabase Buffers          125829120 bytesRedo Buffers                4472832 bytesidle@0> CREATE CONTROLFILE REUSE DATABASE "TESTDB" RESETLOGS  NOARCHIVELOG  2      MAXLOGFILES 16  3      MAXLOGMEMBERS 3  4      MAXDATAFILES 100  5      MAXINSTANCES 8  6      MAXLOGHISTORY 292  7  LOGFILE  8    GROUP 1 '/opt/oracle/oradata/TESTDB/redo01.log'  SIZE 50M BLOCKSIZE 512,  9    GROUP 2 '/opt/oracle/oradata/TESTDB/redo02.log'  SIZE 50M BLOCKSIZE 512, 10    GROUP 3 '/opt/oracle/oradata/TESTDB/redo03.log'  SIZE 50M BLOCKSIZE 512 11  -- STANDBY LOGFILE 12  DATAFILE 13    '/opt/oracle/oradata/TESTDB/system01.dbf', 14    '/opt/oracle/oradata/TESTDB/sysaux01.dbf', 15    '/opt/oracle/oradata/TESTDB/undotbs01.dbf', 16    '/opt/oracle/oradata/TESTDB/users01.dbf', 17    '/opt/oracle/oradata/TESTDB/test01.dbf' 18  CHARACTER SET ZHS16GBK 19  ;Control file created.idle@0> recover database using backup controlfile until cancel;ORA-00279: change 2587639 generated at 02/15/2017 20:54:18 needed for thread 1ORA-00289: suggestion : /opt/oracle/product/11.2.0/dbhome_1/dbs/arch1_1_936046457.dbfORA-00280: change 2587639 for thread 1 is in sequence #1Specify log: {<RET>=suggested | filename | AUTO | CANCEL}/opt/oracle/oradata/TESTDB/redo01.logLog applied.Media recovery complete.idle@0> select checkpoint_change# from v$database;CHECKPOINT_CHANGE#------------------                 0idle@0> alter database open resetlogs;Database altered.

以此记一下,今天过程处理也挺顺利了,哈哈,方法思路挺重要,要多思考



0 0
原创粉丝点击