Pessoal,
Segue uma dica sobre como identificar blocos corrompidos no Database…
Passo 1: Identificar os Blocos Corrompidos
Primeiramente devemos atualizar a view v$database_block_corruption com as informações de blocos corrompidos no banco de dados usando o seguinte comando via RMAN:
RMAN> backup validate check logical database;
To make it faster, itt can be configured to use PARALLELISM with multiple channels:
RMAN> configure device type disk parallelism 4; RMAN> backup validate check logical database;
OU
RMAN> run { allocate channel d1 type disk; allocate channel d2 type disk; allocate channel d3 type disk; allocate channel d4 type disk; backup validate check logical database; }
Agora os blocos corrompidos aparecerão na view v$database_block_corruption:
SQL> select * from v$database_block_corruption; FILE# BLOCK# BLOCKS CORRUPTION_CHANGE# CORRUPTIO ————— ————— ————— —————— ——— 6 10 1 8183236781662 LOGICAL 6 42 1 0 FRACTURED 6 34 2 0 CHECKSUM 6 50 1 8183236781952 LOGICAL 6 26 4 0 FRACTURED 5 rows selected.
Passo 2: Identificar os Segmentos Corrompidos
A query a seguir faz um mapa de cada bloco corrompido em um determinado segmento. Cada bloco será mapeado na view v$database_block_corruption :
SELECT e.owner, e.segment_type, e.segment_name, e.partition_name, c.file# , greatest(e.block_id, c.block#) corr_start_block# , least(e.block_id+e.blocks-1, c.block#+c.blocks-1) corr_end_block# , least(e.block_id+e.blocks-1, c.block#+c.blocks-1) - greatest(e.block_id, c.block#) + 1 blocks_corrupted , null description FROM dba_extents e, v$database_block_corruption c WHERE e.file_id = c.file# AND e.block_id = c.block# UNION SELECT s.owner, s.segment_type, s.segment_name, s.partition_name, c.file# , header_block corr_start_block# , header_block corr_end_block# , 1 blocks_corrupted , 'Segment Header' description FROM dba_segments s, v$database_block_corruption c WHERE s.header_file = c.file# AND s.header_block between c.block# and c.block# + c.blocks - 1 UNION SELECT null owner, null segment_type, null segment_name, null partition_name, c.file# , greatest(f.block_id, c.block#) corr_start_block# , least(f.block_id+f.blocks-1, c.block#+c.blocks-1) corr_end_block# , least(f.block_id+f.blocks-1, c.block#+c.blocks-1) - greatest(f.block_id, c.block#) + 1 blocks_corrupted , 'Free Block' description FROM dba_free_space f, v$database_block_corruption c WHERE f.file_id = c.file# AND f.block_id = c.block# order by file#, corr_start_block#;
Exemplo de Output:
OWNER SEGMENT_TYPE SEGMENT_NAME PARTITION_ FILE# CORR_START_BLOCK# CORR_END_BLOCK# BLOCKS_CORRUPTED DESCRIPTION ----- ------------------ ------------ ---------- ----- ----------------- ---------- ----- ---------------- ------------- SCOTT TABLE EMP 6 10 10 1 SCOTT TABLE PARTITION ORDER ORDER_JAN 6 26 28 3 6 29 29 1 Free Block SCOTT TABLE BONUS 6 34 34 1 6 35 35 1 Free Block SCOTT TABLE DEPT 6 42 42 1 Segment Header SCOTT TABLE INVOICE 6 50 50 1
Notes:
Se um bloco corrompido estiver em tablespaces gerenciadas pelo dicionario (dictionary managed tablespace)
e um segmento no header do bloco estiver corrompido, esse bloco irá aparecer 2x na query acima;
Se um segmento estiver corrompido em um banco usando ASSM, a query acima irá mostrar
somente o bloco corrompido do header e os subsequentes não aparecerão;
Olá.
Você esqueceu de citar a fonte: http://easyoracleapps.wordpress.com/2011/04/11/how-to-identify-all-the-corrupted-objects-in-the-database-reported-by-rman/
Valew Proni!