首页 > 数据库 > Oracle > 检查数据块损坏(Block Corruption)
---查看检查报告可以发现4号数据文件中块的损坏。
SYS@devdb>select dbms_hm.get_run_report('df4test') from dual;
---删除检测的所有的报告
SYS@devdb>
1. begin
2.dbms_hm.drop_schema();
3.end;
/
1.5 exp/expdp命令
exp/expdp命令导出数据库时会完全扫描每个数据块,所以也会检查出数据块的物理错误。
[oracle@devdb ~]$ exp scott/oracle owner=scott
1.6 使用DBMS_REPAIR包
DBMS_REPAIR包可以检查表和索引对象的数据块损坏情况。
begin
dbms_repair.admin_tables(table_name => 'REPAIR_1',
table_type => dbms_repair.REPAIR_TABLE,
action => dbms_repair.CREATE_ACTION);
end;
declare
cor number;
begin
dbms_repair.check_object(schema_name => 'SYS',
object_name => 'BIG',
repair_table_name => 'REPAIR_1',
corrupt_count => cor);
dbms_output.put_line(cor);
end;
select * from REPAIR_1;
本次只是给大家介绍了如何检测损坏的数据块,我们能找到损坏的数据块,下次的内容再给大家介绍如何修复我们检测到的损坏数据块。
pxboracle@live.com
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/14710393/viewspace-1146640/ ,如需转载,请注明出处,否则将追究法律责任。