Corrupted block will still be reported by RMAN and DBV until it is reused and reformatted.
A possible way to fix the problem is provided below. Note that it is not guaranteed to work, but it has been known to resolve the problem in several cases.Also if there are many blocks reported corrupt in a
particular datafile pass the highest block number reported corrupt for that datafile ,when prompted for blocknumber in Step 5
Check the ORA-19566 message to identify the corrupt datafile.
Example:
RMAN-03009: failure of backup command on nm4501 channel at 04/29/2005 09:44:41
ORA-19566: exceeded limit of 0 corrupt blocks for file E:\xxxx\test.ORA.
Corrupt block is present in file E:\xxxx\test.ORA.
Step 2 Run DBV on affected datafile and check for corrupt block
Run dbverify on the datafile which reports corrupt block.
Sample Output:
DBVERIFY: Release 9.2.0.3.0 - Production on Thu Aug 25 11:15:54 2005
Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.
DBVERIFY - Verification starting : FILE = E:\xxxx\test.ORA
Page 48740 is marked corrupt ***
Corrupt block relative dba: 0x01c0be64 (file 7, block 48740)
Bad check value found during dbv:
Data in bad block -
type: 0 format: 2 rdba: 0x0000be64
last change scn: 0x0000.00000000 seq: 0x1 flg: 0x05
consistency value in tail: 0x00000001
check value in block header: 0xb964, computed block checksum: 0x2a5a
spare1: 0x0, spare2: 0x0, spare3: 0x0
***
DBVERIFY - Verification complete
Total Pages Examined : 64000
Total Pages Processed (Data) : 0
Total Pages Failing (Data) : 0
Total Pages Processed (Index): 1751
Total Pages Failing (Index): 0
Total Pages Processed (Other): 45
Total Pages Processed (Seg) : 0
Total Pages Failing (Seg) : 0
Total Pages Empty : 62203
Total Pages Marked Corrupt : 1
Note that Block 48740 is reported as corrupt in datafile 7.
Step 3 - Check whether block is part of any object
Query dba_extents and cross check the block doesnot belong to any object.
Connect as sys and create the following trigger:
Please note when prompted for file number enter the relative file no(rfile# value from v$datafile)
Step 6- Allocate space to the table from the affected datafile .
First find the extent size by querying dba_free_space
SQL> Select BYTES from dba_free_space where file_id=
BYTES
---------------- ---------- ---------- ---------- ---------- ------------
65536
If its 64 K use
For example to allocate space from E:\xxxx\test.ORA:
For example to allocate space from E:\xxxx\test.ORA:
Note: It is advisable to ensure that AUTOEXTEND is OFF for the datafile, to prevent it from growing
Step 7 - Insert data into dummy table To format the block
Sample code (depending on the size of the tablespace it may vary):
Or
Or use the below code which includes 2 loops:
The trigger will be fired for every row inserted into the table and an exception with ORA-20000 will be produced as soon as it inserts the first row into the corrupt block.
Step 8 - Verify for any corruption in datafile by running DBV and Rman backup
Run dbverify on the corrupt datafile. It will not show the block as corrupted.
RMAN backup will not report any error on this block.
Step 9 - Drop the dummy table created in step 4
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/26634508/viewspace-721022/ ,如需转载,请注明出处,否则将追究法律责任。