ITPub博客

首页 > Linux操作系统 > Linux操作系统 > 模拟数据块损坏

模拟数据块损坏

原创 Linux操作系统 作者:lsq_008 时间:2010-08-03 09:35:23 0 删除 编辑

关闭数据库后,用ultraedit编辑数据文件,然后启动数据库。

SQL> select count(*) from a;
select count(*) from a
                     *
ERROR at line 1:
ORA-01578: ORACLE data block corrupted (file # 8, block # 418)
ORA-01110: data file 8: '/home/db/oracle/oradata/ebank/tools01.dbf'


SQL> exit

[oracle@primary ebank]$ dbv file=tools01.dbf blocksize=8192

DBVERIFY: Release 10.2.0.4.0 - Production on Fri Jul 30 09:27:06 2010

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

DBVERIFY - Verification starting : FILE = tools01.dbf
Page 418 is marked corrupt
Corrupt block relative dba: 0x020001a2 (file 8, block 418)
Bad check value found during dbv:
Data in bad block:
 type: 6 format: 2 rdba: 0x020001a2
 last change scn: 0x0000.001fb13a seq: 0x1 flg: 0x06
 spare1: 0x0 spare2: 0x0 spare3: 0x0
 consistency value in tail: 0xb13a0601
 check value in block header: 0x1389
 computed block checksum: 0x57dd

 

DBVERIFY - Verification complete

Total Pages Examined         : 640
Total Pages Processed (Data) : 495
Total Pages Failing   (Data) : 0
Total Pages Processed (Index): 0
Total Pages Failing   (Index): 0
Total Pages Processed (Other): 24
Total Pages Processed (Seg)  : 0
Total Pages Failing   (Seg)  : 0
Total Pages Empty            : 120
Total Pages Marked Corrupt   : 1
Total Pages Influx           : 0
Highest block SCN            : 2077028 (0.2077028)

此时进行exp导出,报错:

[oracle@primary ebank]$ exp "'/ as sysdba'" tables=a file=a.dmp

Export: Release 10.2.0.4.0 - Production on Fri Jul 30 09:34:09 2010

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


Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
Export done in US7ASCII character set and AL16UTF16 NCHAR character set

About to export specified tables via Conventional Path ...
. . exporting table                              A
EXP-00056: ORACLE error 1578 encountered
ORA-01578: ORACLE data block corrupted (file # 8, block # 418)
ORA-01110: data file 8: '/home/db/oracle/oradata/ebank/tools01.dbf'
Export terminated successfully with warnings.

需要设置内部事件,使exp跳过这些数据块:

SQL> ALTER SYSTEM SET EVENTS='10231 trace name context forever,level 10' ;

System altered.

SQL> exit
Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
[oracle@primary ebank]$ exp "'/ as sysdba'" tables=a file=a.dmp log=a.log

Export: Release 10.2.0.4.0 - Production on Fri Jul 30 09:50:40 2010

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


Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
Export done in US7ASCII character set and AL16UTF16 NCHAR character set

About to export specified tables via Conventional Path ...
. . exporting table                              A     322546 rows exported
Export terminated successfully without warnings.

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/10972173/viewspace-670048/ ,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论
十余年大型金融及电信系统数据库管理经验,曾服务于中国建设银行、中国移动。对oracle,mysql数据库有深入了解。 擅长python开发,独立开发了开源数据库自动化监控运维平台Power Monitor。

注册时间:2008-02-29

  • 博文量
    335
  • 访问量
    1369148