dbms_repair(修复)

dbms_repair包:
检查,修复在表和索引上损坏的数据块;

–1,admin_tables

/*
该过程提供了管理 修复表 和 孤表 的功能
table_name –{加前缀ORPHAN,REPAIR }
table_type –{dbms_repair.ORPHAN_TABLE ,dbms_repair.REPAIR_TABLE}
action – {dbms_repair.CREATE_ACTION;
dbms_repair.PURGE_ACTION;
dbms_repair.DROP_ACTION;}
tablespace –表所在的空间
*/

dbms_repair.admin_tables(
table_name => ,
table_type => ,
action => ,
tablespace =>
);

–建立了REPAIR_TABLE表(修复表)
begin
dbms_repair.admin_tables(
‘REPAIR_TABLE’,
dbms_repair.REPAIR_TABLE,
dbms_repair.CREATE_ACTION,
‘SYSTEM’);
end;

select * from REPAIR_TABLE;

–2,check_object

/*
该过程检查特定的对象,并将损坏信息写到修复表中去;
*/

dbms_repair.check_object(
schema_name => ,
object_name => ,
partition_name => ,
object_type => ,
repair_table_name =>
);

–3,dump_orphan_keys

/*
该过程用于报告指南损坏数据块的 索引入口,
并会将相应的索引入口消息写到孤表中去;
key_count –返回索引入口的个数
*/

dbms_repair.dump_orphan_keys(

  schema_name => ,
  object_name => ,
  partition_name => ,
  object_type => ,
  orphan_table_name =>,
  key_count =>  out

);

–4,fix_corrupt_blocks

/*
该过程用于修复数据块;这些数据块是在 check_object之后生成的;
fix_count –修复数据块的个数
*/

dbms_repair.fix_corrupt_blocks(
schema_name => ,
object_name => ,
partition_name => ,
object_type => ,
repair_table_name => ,
fix_count => out
);

–5,rebuild_freelists

/*
用于重建指定对象的空闲空间
*/

dbms_repair.rebuild_freelists(
schema_name => ,
object_name => ,
partition_name => ,
object_type =>
);

–6,skip_corrupt_blocks

/*
用于指定在扫描对象时跳过损坏块
flag –{
dbms_repair.SKIP_FLAG;
dbms_repair.NOSKIP_FLAG;
}
*/

dbms_repair.skip_corrupt_blocks(
schema_name => ,
object_name => ,
object_type => ,
flags =>
);

–7,segment_fix_status

/*
修复 位图入口的损坏;
*/

dbms_repair.segment_fix_status(
,segment_owner => ,
segment_name => ,
segment_type => ,
file_number => ,
block_number => ,
partition_name => –指定分区名

);

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值