SQL> exec  DBMS_STATS.GATHER_DATABASE_STATS;
BEGIN DBMS_STATS.GATHER_DATABASE_STATS; END; *
ERROR at line 1:
ORA-01578: ORACLE data block corrupted (file # 4, block # 870212)
ORA-01110: data file 4:
'/s01/oradata/G10R25/datafile/o1_mf_users_7ch7d4nx_.dbf'
ORA-06512: at "SYS.DBMS_STATS", line 15188
ORA-06512: at "SYS.DBMS_STATS", line 15530
ORA-06512: at "SYS.DBMS_STATS", line 15674
ORA-06512: at "SYS.DBMS_STATS", line 15638
ORA-06512: at line 1 使用RMAN blockreocver命令试图修改该物理坏块: RMAN> blockrecover datafile 4 block 870212; Starting blockrecover at 08-NOV-12 channel ORA_DISK_1: restored block(s) from backup piece 1
piece handle=/s01/flash_recovery_area/G10R25/backupset/2012_08_06/o1_mf_nnndf_TAG20120806T075500_81zd4njn_.bkp tag=TAG20120806T075500
channel ORA_DISK_1: block restore complete, elapsed time: 00:01:16 starting media recovery archive log thread 1 sequence 467 is already on disk as file /s01/flash_recovery_area/G10R25/archivelog/2012_10_31/o1_mf_1_467_893571cm_.arc
archive log thread 1 sequence 468 is already on disk as file /s01/flash_recovery_area/G10R25/archivelog/2012_10_31/o1_mf_1_468_893pc84l_.arc
archive log thread 1 sequence 469 is already on disk as file /s01/flash_recovery_area/G10R25/archivelog/2012_11_01/o1_mf_1_469_894zsbym_.arc
archive log thread 1 sequence 470 is already on disk as file /s01/flash_recovery_area/G10R25/archivelog/2012_11_01/o1_mf_1_470_896b944y_.arc
4_.arc
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of blockrecover command at 11/08/2012 06:19:40
RMAN-06053: unable to perform media recovery because of missing log
RMAN-06025: no backup of log thread 1 seq 466 lowscn 27762151 found to restore
RMAN-06025: no backup of log thread 1 seq 465 lowscn 27762145 found to restore
RMAN-06025: no backup of log thread 1 seq 464 lowscn 27762142 found to restore

由于缺少必要的归档日志导致blockrecover无法成功,需要另想办法。

首先确认该数据块属于哪个SEGMENT,如果是INDEX那么完全可以重建也不会丢失数据,但是如果是表数据则需要容忍丢失该坏块内的数据:

SQL> col tablespace_name for a20
SQL> col segment_type for a10
SQL> col segment_name for a20
SQL> col owner for a8
SQL> SELECT tablespace_name, segment_type, owner, segment_name
2 FROM dba_extents
3 WHERE file_id = &fileid
4 and &blockid between block_id AND block_id + blocks - 1;
Enter value for fileid: 4
old 3: WHERE file_id = &fileid
new 3: WHERE file_id = 4
Enter value for blockid: 870212
old 4: and &blockid between block_id AND block_id + blocks - 1
new 4: and 870212 between block_id AND block_id + blocks - 1 TABLESPACE_NAME SEGMENT_TY OWNER SEGMENT_NAME
-------------------- ---------- -------- --------------------
USERS TABLE SYS CORRUPT_ME SQL> select count(*) from CORRUPT_ME;
select count(*) from CORRUPT_ME
*
ERROR at line 1:
ORA-01578: ORACLE data block corrupted (file # 4, block # 870212)
ORA-01110: data file 4:
'/s01/oradata/G10R25/datafile/o1_mf_users_7ch7d4nx_.dbf' SQL> analyze table corrupt_me validate structure;
analyze table corrupt_me validate structure
*
ERROR at line 1:
ORA-01498: block check failure - see trace file SQL> oradebug setmypid
Statement processed.
SQL> oradebug tracefile_name
/s01/admin/G10R25/udump/g10r25_ora_19749.trc Corrupt block relative dba: 0x010d4744 (file 4, block 870212)
Bad header found during buffer read
Data in bad block:
type: 6 format: 2 rdba: 0x000d4744
last change scn: 0x0000.00000000 seq: 0xff flg: 0x04
spare1: 0x0 spare2: 0x0 spare3: 0x0
consistency value in tail: 0x000006ff
check value in block header: 0x6323
computed block checksum: 0x0
Reread of rdba: 0x010d4744 (file 4, block 870212) found same corrupted data
*** 2012-11-08 06:23:12.564
table scan: segment: file# 4 block# 870211
skipping corrupt block file# 4 block# 870212
*** 2012-11-08 06:23:36.955
table scan: segment: file# 4 block# 870211
skipping corrupt block file# 4 block# 870212
skipping corrupted block at rdba: 0x010d4744

下面使用10231 level 10事件来避免发生ORA-01578错误,并将原坏块表复制出来:

SQL> alter session set events '10231 trace name context forever,level 10';

Session altered.

SQL>  select count(*) from CORRUPT_ME;

  COUNT(*)
----------
50857 SQL> create table corrupt_me_copy tablespace users as select * from CORRUPT_ME; Table created. SQL> analyze table corrupt_me_copy validate structure; Table analyzed.

之后仅需要将新表rename为旧表,并重建索引即可:

SQL>  alter table corrupt_me rename to corrupt_me_copy1;

Table altered.

SQL> alter table corrupt_me_copy rename to corrupt_me;

Table altered.

SQL> rebuild indexs

ora-01578的更多相关文章

  1. [转] AIX lv 4k偏移量

    转自:http://www.aixchina.net/Question/29969 前几天在客户数据库做巡检的时候,在警告日志中发现有如下警告:引用WARNING: You are creating ...

  2. 对Oracle数据库坏块的理解

    1.物理坏块和逻辑坏块 在数据库中有一个概念叫做数据块的一致性,Oracle的数据块的一致性包括了两个层次:物理一致性和逻辑一致性,如果一个数据块在这两个层次上存在不一致性,那就对应到了我们今天要要说 ...

  3. ORA-12541:TNS:no listener 客户端tnsnames.ora配置,以及服务端listener.ora配置

    需求:客户端(192.168.25.1)需要访问服务端(192.168.7.215)的Oracle库ORCL. 步骤一:配置客户端tnsnames.ora 步骤二:配置服务端listener.ora ...

  4. Oracle的tnsnames.ora配置(PLSQL Developer)

    首先打开tnsnames.ora的存放目录,一般为D:\app\Administrator\product\11.2.0\client_1\network\admin,就看安装具体位置了. 步骤阅读 ...

  5. Oracle RAC客户端tnsnames.ora相关配置及测试

    1.Oracle RAC服务端/etc/hosts部分内容如下 2.查看服务端的local_listener和remote_listener参数 3.客户端tnsnames.ora配置参考 3.1 1 ...

  6. oracle的sqlnet.ora,tnsnames.ora,listener.ora三个配置文件

    总结: 1 .三个配置文件都是放在$ORACLE_HOME\network\admin目录下. 2 .sqlnet.ora确定解析方式 3 .listener.ora上设SID_NAME,通常用于JD ...

  7. oracle客户端安装配置 tnsnames.ora文件

    Oracle客户端tnsnames.ora连接配置 Oracle90的在C:\Oracle\ora90\network\ADMIN下面 Oracel10g的在D:\oracle\product\10. ...

  8. 修改tnsnames.ora文件中配置内容中的连接别名后,连接超时解决办法

    1.tnsnames.ora文件中配置内容中的连接别名:由upaydb修改为IP地址 2.连接超时 定位原因: PLSQL登录界面的数据库列表就是读的tnsname.ora中连接的别名,这个文件中连接 ...

  9. 安装了多个Oracle11g的客户端,哪个客户端的tnsnames.ora会起作用?

    如果我们由于需要安装了多个Oracle的client,哪个客户端的tnsnames.ora会起作用呢? 答案是: 在安装好clinent端后,安装程序会把client的bin目录放到path里面,pa ...

  10. PLSQL登录数据库 报ORA -12154的诡异问题

    https://q.cnblogs.com/q/89420/ 现象: 1.机器上先后安装了oracle两个版本的client.在装第一个client后,plsql可以顺利连接数据库a并登录. 2.安装 ...

随机推荐

  1. 修改小程序checkbox样式

    未选中时的样式 checkbox .wx-checkbox-input { border-radius: 50%; height: 30rpx; width: 30rpx; margin-top: - ...

  2. oracle wm_concat函数用法

    在Oracle中使用wm_concat(column)可以实现字段的分组合并,逗号分隔.

  3. android项目笔记整理(3)

    61.AlphabetIndexer字母索引辅助类       实现对链表类型的数据进行快速索引. 应用于类似联系人列表右侧的导航栏 注意:       1.链表里的元素必须是Object类型,并实现 ...

  4. opencv3.0中contrib模块的添加+实现SIFT/SURF算法

    平台:win10 x64 +VS 2015专业版 +opencv-3.x.+CMake+Anaconda3(python3.7.0) Issue说明:Opencv3.0版本已经发布了有一段时间,在这段 ...

  5. idea仿eclipse的export导出功能

    自从开发工具从eclipse切换到idea来之后,才知道什么叫做'真香'.idea强大的扩展功能极大的拓展了他的可用性,最近有个功能就是通过idea的扩展插件搞定的. 事情是这样的,朋友使用eclip ...

  6. CentOs Linux 对于 修改 yum源 为 阿里

    修改yum源为阿里 备份本地yum源 mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo_bak 2.获取阿里 ...

  7. 说说lock到底锁谁(II)?

    摘要 今天在园子里面有园友反馈关于[C#基础]说说lock到底锁谁?文章中lock(this)的问题.后来针对文章中的例子,仔细想了一下,确实不准确,才有了这篇文章的补充,已经对文章中的demo进行修 ...

  8. 【转载】网易极客战记官方攻略-地牢- 迷一般的 Kithmaze

    关卡连接: https://codecombat.163.com/play/level/riddling-kithmaze 如果你第一次走上歧途,改变你的循环来找到出路. 简介: 敬请期待! 默认代码 ...

  9. freemodbus收藏学习网址

    https://www.cnblogs.com/axinno1/p/8521481.html https://blog.csdn.net/xukai871105/article/details/216 ...

  10. django + ckeditor + 七牛云,图片上传到七牛云

    传送门 本人使用的是 Django 的自带的管理后台,安装 ckeditor 富文本编辑器后,上传图片的时候直接传到七牛云的.