Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Use dbms_repair to mark and skip bad blocks

2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

SQL > select file_id, block_id, blocks from dba_extents where owner = 'LILC' and segment_name =' TEST';, 610624 1024 611648 102483 rows selected.

Destroy previous data:

SQL > select count (*) from test

COUNT (*)

-

783018

RMAN > recover datafile 6 block 11620 clear

RMAN > recover datafile 6 block 4467 clear

RMAN > backup check logical validate datafile 6

Starting backup at 23-SEP-15

Using channel ORA_DISK_1

Using channel ORA_DISK_2

Channel ORA_DISK_1: starting full datafile backup set

Channel ORA_DISK_1: specifying datafile (s) in backup set

Input datafile file number=00006 name=+DATA/phub/datafile/llc01.dbf

Channel ORA_DISK_1: backup set complete, elapsed time: 00:00:07

List of Datafiles

=

File Status Marked Corrupt Empty Blocks Blocks Examined High SCN

-

6 FAILED 0 20 12800 1991935

File Name: + DATA/phub/datafile/llc01.dbf

Block Type Blocks Failing Blocks Processed

Data 2 12140

Index 0 329

Other 1 311

Validate found one or more corrupt blocks

See trace file / u01/app/oracle/diag/rdbms/phub/PHUB/trace/PHUB_ora_29666.trc for details

Finished backup at 23-SEP-15

The data query must have reported an error:

SQL > select count (*) from test

Select count (*) from test

*

ERROR at line 1:

ORA-01578: ORACLE data block corrupted (file # 6, block # 4467)

ORA-01110: datafile 6:'+ DATA/phub/datafile/llc01.dbf'

Skip_corrupt_blocks to skip the bad blocks:

SQL > exec dbms_repair.skip_corrupt_blocks (schema_name = > 'LILC',object_name = >' TEST',flags = > 1)

PL/SQL procedure successfully completed.

SQL > conn lilc/lilc

Connected.

SQL > select count (*) from test

COUNT (*)

-

782884

There are 34 pieces of data missing.

Repair bad block

RMAN > recover datafile 6 block 11620

2 >

Starting recover at 23-SEP-15

Using channel ORA_DISK_1

Using channel ORA_DISK_2

Finished standby search, restored 1 blocks

Starting media recovery

Media recovery complete, elapsed time: 00:00:01

Finished recover at 23-SEP-15

RMAN > recover datafile 6 block 4467

Starting recover at 23-SEP-15

Using channel ORA_DISK_1

Using channel ORA_DISK_2

Finished standby search, restored 1 blocks

Starting media recovery

Media recovery complete, elapsed time: 00:00:01

Finished recover at 23-SEP-15

The data is normal:

SQL > select count (*) from test

COUNT (*)

-

783018

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report