數據庫啓動時遇到ORA-01578錯誤

數據庫啓動的時候遇到壞塊,特別是SYSTEM表空間中的一些底層表,如UNDO$,OBJ$等一些表,會致使數據庫不能正常open,固然咱們能夠經過增長一些隱藏參數來達到跳過壞塊來啓動數據庫,也能夠經過bbed工具來手動修復塊來。下面是本身的一個測試環境遇到這樣的錯誤,經過bbed工具來修復sql

 數據庫


歡迎你們加入ORACLE超級羣:17115662 免費解決各類ORACLE問題,之後BLOG將遷移到http://www.htz.pworacle


1,數據庫版本app

SQL> select * from v$version;ide

 工具

BANNER測試

--------------------------------------------------------------------------------ui

Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Productionspa

PL/SQL Release 11.2.0.3.0 - Productioncode

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

 

&#160;<32 bytes per line>

&#160;

&#160;

BBED> set offset 8188

&#160;&#160;&#160;&#160;&#160;&#160;&#160; OFFSET&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; 8188

&#160;

BBED> dump

&#160;File: /oracle/app/oracle/oradata/orcl1123/system01.dbf (0)

&#160;Block: 225&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; Offsets: 8188 to 8191&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; Dba:0x00000000

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

&#160;ff06aabe

&#160;

&#160;<32 bytes per line>

&#160;

BBED> modify /x 00 offset 8188

&#160;File: /oracle/app/oracle/oradata/orcl1123/system01.dbf (0)

&#160;Block: 225&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; Offsets: 8188 to 8191&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; Dba:0x00000000

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

&#160;0006aabe

&#160;

&#160;<32 bytes per line>

&#160;

BBED> p tailchk

ub4 tailchk&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; @8188&#160;&#160;&#160;&#160; 0xbeaa0600

&#160;

&#160;

BBED> sum apply

Check value for File 0, Block 225:

current = 0x4cba, required = 0x4cba

&#160;

BBED> verify

DBVERIFY - Verification starting

FILE = /oracle/app/oracle/oradata/orcl1123/system01.dbf

BLOCK = 225

&#160;

Block Checking: DBA = 4194529, Block Type = KTB-managed data block

data header at 0x2a98b8725c

kdbchk: row locked by non-existent transaction

&#160;&#160;&#160;&#160;&#160;&#160;&#160; table=0&#160;&#160; slot=20

&#160;&#160;&#160;&#160;&#160;&#160;&#160; lockid=1&#160;&#160; ktbbhitc=2

Block 225 failed with check code 6101

&#160;

DBVERIFY - Verification complete

&#160;

Total Blocks Examined&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; : 1

Total Blocks Processed (Data) : 1

Total Blocks Failing&#160;&#160; (Data) : 1

Total Blocks Processed (Index): 0

Total Blocks Failing&#160;&#160; (Index): 0

Total Blocks Empty&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; : 0

Total Blocks Marked Corrupt&#160;&#160; : 0

Total Blocks Influx&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; : 0

Message 531 not found;&#160; product=RDBMS; facility=BBED

這裏看到報了ITL至關的一些東西,緣由是因爲原來作實驗的時候,手動提交了數據。

報錯代碼的意思是,slot=20的行被鎖住,佔用了itl2.

&#160;

下面是dump數據庫看一下第21號的lb標記符

tl: 58 fb: --H-FL-- lb: 0x1&#160; cc: 17

col&#160; 0: [ 2]&#160; c1 15

col&#160; 1: [10]&#160; 5f 53 59 53 53 4d 55 32 30 24

col&#160; 2: [ 2]&#160; c1 02

col&#160; 3: [ 2]&#160; c1 06

col&#160; 4: [ 3]&#160; c2 03 49

col&#160; 5: [ 5]&#160; c4 02 62 0a 09

col&#160; 6: [ 1]&#160; 80

col&#160; 7: [ 3]&#160; c2 03 2a

col&#160; 8: [ 3]&#160; c2 02 3e

col&#160; 9: [ 1]&#160; 80

col 10: [ 2]&#160; c1 04

col 11: [ 2]&#160; c1 06

col 12: *NULL*

col 13: *NULL*

col 14: *NULL*

col 15: *NULL*

col 16: [ 2]&#160; c1 0

&#160;

BBED> p *kdbr[20]

rowdata[634]

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

ub1 rowdata[634]&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; @1823&#160;&#160;&#160;&#160; 0x2c

&#160;

BBED> set offset 1823

&#160;&#160;&#160;&#160;&#160;&#160;&#160; OFFSET&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; 1823

&#160;

BBED> dump

&#160;File: /oracle/app/oracle/oradata/orcl1123/system01.dbf (0)

&#160;Block: 225&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; Offsets: 1823 to 1838&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; Dba:0x00000000

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

&#160;2c011102 c1150a5f 53595353 4d553230

BBED> modify /x 2c00

&#160;File: /oracle/app/oracle/oradata/orcl1123/system01.dbf (0)

&#160;Block: 225&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; Offsets: 1823 to 1838&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; Dba:0x00000000

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

&#160;2c001102 c1150a5f 53595353 4d553230

&#160;

&#160;<32 bytes per line>

&#160;

&#160;

&#160;

BBED> sum apply

Check value for File 0, Block 225:

current = 0x6ec1, required = 0x6ec1

&#160;

BBED> verify

DBVERIFY - Verification starting

FILE = /oracle/app/oracle/oradata/orcl1123/system01.dbf

BLOCK = 225

&#160;

&#160;

DBVERIFY - Verification complete

&#160;

Total Blocks Examined&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; : 1

Total Blocks Processed (Data) : 1

Total Blocks Failing&#160;&#160; (Data) : 0

Total Blocks Processed (Index): 0

Total Blocks Failing&#160;&#160; (Index): 0

Total Blocks Empty&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; : 0

Total Blocks Marked Corrupt&#160;&#160; : 0

Total Blocks Influx&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; : 0

Message 531 not found;&#160; product=RDBMS; facility=BBED

&#160;

塊不在報錯。驗證經過

4,數據庫正常打開

SQL> alter database open;

&#160;

Database altered.

&#160;

undo塊能正常訪問

SQL> select name from undo$;

&#160;

NAME

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

SYSTEM

_SYSSMU1$

_SYSSMU10$

_SYSSMU11$

_SYSSMU12$

_SYSSMU13$

_SYSSMU14$

_SYSSMU15$

_SYSSMU16$

_SYSSMU17$

_SYSSMU18$

&#160;

NAME

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

_SYSSMU19$

_SYSSMU2$

_SYSSMU20$

_SYSSMU3$

_SYSSMU4$

_SYSSMU5$

_SYSSMU6$

_SYSSMU7$

_SYSSMU8$

_SYSSMU9$

&#160;

21 rows selected.

相關文章
相關標籤/搜索