问题描述:数据库open时报错ORA-01210、ORA-01110、ORA-01122,如下所示:
数据库:oracle 11.2.0.4
1、异常重现
--定义文件,将数据文件查询出来,放到参数文件中.
[oracle@leo-oracle-11g ~]$ vi parameter.txt
blocksize=8192
listfile=dbfiles.txt
mode=edit
[oracle@leo-oracle-11g ~]$ vi dbfiles.txt
1 /u01/app/oracle/oradata/orcl/system01.dbf 817889280
2 /u01/app/oracle/oradata/orcl/sysaux01.dbf 534773760
3 /u01/app/oracle/oradata/orcl/undotbs01.dbf 529530880
4 /u01/app/oracle/oradata/orcl/users01.dbf 5242880
说明:如上内容为通过以下语句查询所得.
select file# || chr(9) || name || chr(9) || bytes from v$datafile;
[oracle@leo-oracle-11g ~]$ bbed parfile=parameter.txt
Password:
BBED: Release 2.0.0.0.0 - Limited Production on Tue Mar 7 23:56:13 2023
Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.
************* !!! For Oracle Internal Use only !!! ***************
BBED> dump /v dba 2,1 offset 40 count 30
File: /u01/app/oracle/oradata/orcl/sysaux01.dbf (2)
Block: 1 Offsets: 40 to 69 Dba:0x00800001
-------------------------------------------------------
fa060000 00090100 00200000 02000300 l ......... ......
00000000 00000000 00000000 0000 l ..............
<16 bytes per line>
--修改数据文件
BBED> modify /x fa07
File: /u01/app/oracle/oradata/orcl/sysaux01.dbf (2)
Block: 1 Offsets: 40 to 69 Dba:0x00800001
------------------------------------------------------------------------
fa070000 00090100 00200000 02000300 00000000 00000000 00000000 0000
<32 bytes per line>
BBED> dump /v dba 2,1 offset 40 count 30
File: /u01/app/oracle/oradata/orcl/sysaux01.dbf (2)
Block: 1 Offsets: 40 to 69 Dba:0x00800001
-------------------------------------------------------
fa070000 00090100 00200000 02000300 l ......... ......
00000000 00000000 00000000 0000 l ..............
<16 bytes per line>
--重启数据库,报错如下.
SYS@orcl> shutdown abort
ORACLE instance shut down.
SYS@orcl> startup
ORACLE instance started.
Total System Global Area 1653518336 bytes
Fixed Size 2253784 bytes
Variable Size 1241517096 bytes
Database Buffers 402653184 bytes
Redo Buffers 7094272 bytes
Database mounted.
ORA-01122: database file 2 failed verification check
ORA-01110: data file 2: '/u01/app/oracle/oradata/orcl/sysaux01.dbf'
ORA-01210: data file header is media corrupt
2、解决步骤
--将数据块修改回fa06.
BBED> modify /x fa06
File: /u01/app/oracle/oradata/orcl/sysaux01.dbf (2)
Block: 1 Offsets: 40 to 69 Dba:0x00800001
------------------------------------------------------------------------
fa060000 00090100 00200000 02000300 00000000 00000000 00000000 0000
<32 bytes per line>
--open数据库,无异常发生.
SYS@orcl> alter database open;
Database altered.
3、日志信息
Thu Mar 09 13:49:35 2023
alter database open
Beginning crash recovery of 1 threads
Started redo scan
Completed redo scan
read 6 KB redo, 12 data blocks need recovery
Started redo application at
Thread 1: logseq 2, block 2979
Recovery of Online Redo Log: Thread 1 Group 2 Seq 2 Reading mem 0
Mem# 0: /u01/app/oracle/oradata/orcl/redo02.log
Completed redo application of 0.00MB
Completed crash recovery at
Thread 1: logseq 2, block 2992, scn 2121121
12 data blocks read, 12 data blocks written, 6 redo k-bytes read
Thu Mar 09 13:49:35 2023
LGWR: STARTING ARCH PROCESSES
Thu Mar 09 13:49:35 2023
ARC0 started with pid=20, OS id=76611
ARC0: Archival started
LGWR: STARTING ARCH PROCESSES COMPLETE
ARC0: STARTING ARCH PROCESSES
Thu Mar 09 13:49:35 2023
ARC1 started with pid=21, OS id=76613
Thread 1 advanced to log sequence 3 (thread open)
Thu Mar 09 13:49:35 2023
ARC2 started with pid=22, OS id=76615
Thread 1 opened at log sequence 3
Current log# 3 seq# 3 mem# 0: /u01/app/oracle/oradata/orcl/redo03.log
Successful open of redo thread 1
MTTR advisory is disabled because FAST_START_MTTR_TARGET is not set
Thu Mar 09 13:49:35 2023
SMON: enabling cache recovery
Thu Mar 09 13:49:35 2023
ARC3 started with pid=23, OS id=76617
ARC1: Archival started
ARC2: Archival started
ARC1: Becoming the 'no FAL' ARCH
ARC1: Becoming the 'no SRL' ARCH
ARC2: Becoming the heartbeat ARCH
ARC3: Archival started
ARC0: STARTING ARCH PROCESSES COMPLETE
Archived Log entry 11 added for thread 1 sequence 2 ID 0x62df2782 dest 1:
[76544] Successfully onlined Undo Tablespace 2.
Undo initialization finished serial:0 start:147325904 end:147325934 diff:30 (0 seconds)
Verifying file header compatibility for 11g tablespace encryption..
Verifying 11g file header compatibility for tablespace encryption completed
SMON: enabling tx recovery
Database Characterset is AL32UTF8
No Resource Manager plan active
replication_dependency_tracking turned off (no async multimaster replication found)
Starting background process QMNC
Thu Mar 09 13:49:35 2023
QMNC started with pid=24, OS id=76621
Completed: alter database open
Thu Mar 09 13:49:36 2023
db_recovery_file_dest_size of 4182 MB is 5.98% used. This is a
user-specified limit on the amount of space that will be used by this
database for recovery-related files, and does not reflect the amount of
space available in the underlying filesystem or ASM diskgroup.
Thu Mar 09 13:49:36 2023
Starting background process CJQ0
Thu Mar 09 13:49:36 2023
CJQ0 started with pid=26, OS id=76636