Oracle数据库出现ORA-01578错误,导致drop table 错误 (一)

教程发布:风哥 教程分类:ITPUX技术网 更新日期:2022-02-12 浏览学习:389

Oracle数据库出现ORA-01578错误,导致drop table 错误 (一)

在自己测试库上,删除一个表时,出现以下错误:
SQL> drop table test;
drop table test
*
ERROR 位于第 1 行:
ORA-00604: 递归 SQL 层 1 出现错误
ORA-01578: ORACLE 数据块损坏(文件号1,块号12936)
ORA-01110: 数据文件 1: 'D:\ORACLE\ORADATA\TEST\SYSTEM01.DBF'

出现ora-01578错误,查下错误代码解释
ORA-01578 ORACLE data block corrupted (file # string, block # string)

Cause:
The data block indicated was corrupted, probably due to program errors.

Action:
Determine which object was corrupted using a command like the following:

SELECT SEGMENT_TYPE,OWNER||'.'||SEGMENT_NAME FROM DBA_EXTENTS
WHERE file = FILE_ID AND block BETWEEN BLOCK_ID AND BLOCK_ID+BLOCKS -1;
where values for file and block are from the message.

Try to restore the segment containing the block indicated. This may involve dropping the segment and re-creating it. If there is a trace file, report the errors in it to Oracle Support Services.

执行解释中的sql,这里的块号和文件号就是上面出现错误的数字
select segment_type,owner||'.'||segment_name
from dba_extents
where 1 = file_id and 12936 between block_id and block_id+blocks -1;
segment_type owner||'.'||segment_name
index SYS.I_DEPENDENCY1

是索引,那就不怕了,重建索引就ok了,那要是segment_type为table了,那就麻烦点,要修复块
alter index SYS.I_DEPENDENCY1 rebuild online;

SQL> drop table test;

表已丢弃。 正常

本文标签:
网站声明:本文由风哥整理发布,转载请保留此段声明,本站所有内容将不对其使用后果做任何承诺,请读者谨慎使用!
【上一篇】
【下一篇】