Home >Database >Mysql Tutorial >Oracle中修复数据块的损坏

Oracle中修复数据块的损坏

WBOY
WBOYOriginal
2016-06-07 16:55:531065browse

1、先创建一个用于实验的表空间 create tablespace block datafile size 1M extent management local; ndash;因为是11g

  1、先创建一个用于实验的表空间

  create tablespace block datafile size 1M extent management local;  –因为是11g所以使用了AMS

  alter user ff default tablespace block;

  alter user ff quota unlimited on block;

  2、损坏数据文件

  关闭database后用编辑器随便修改几个字符,然后启动database

  当访问相关被损坏的block时,将会遇到错误

  3、对此使用dbv检查数据文件

  dbv file=block.dbf blocksize=8192

  假设获得第35块被损坏了

  4、恢复步骤

  ①select tablespace_name, segment_type, owner, segment_name from dba_extents where file_id=4 and 35 between block_id and block_id+blocks-1;

  如果确定损失的是数据,就ok

  设置内部事件,,设置在全表扫描时跳过损坏的数据块

  alter system set events=’10231 trace name context forever,level 10′;

  随后,可以用exp和imp进行导入导出,进行恢复。但这毕竟导致相依blocks中数据的丢失。

linux

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn