Thứ Năm, 30 tháng 8, 2018

Khắc phục corrupt block Oracle Database

CHECK

--Results of the LIST FAILURE, VALIDATE, or BACKUP ... VALIDATE command
RMAN> backup validate check logical database;


--The V$DATABASE_BLOCK_CORRUPTION view
select distinct corruption_change# from v$database_block_corruption order by 1;

select * from dba_data_files where file_id in (576,4314,4840);

select * from dba_extents where file_id=576;

select 
   relative_fno, 
   owner, 
   segment_name, 
   segment_type
from 
   dba_extents
where 
   file_id = 6
and 
   437 between block_id and block_id + blocks - 1;


--Error messages in standard output
--The alert log
--User trace files
--Results of the SQL commands ANALYZE TABLE and ANALYZE INDEX
--Results of the DBVERIFY utility
--Third-party media management output

For example, you may discover the following messages in a user trace file:
ORA-01578: ORACLE data block corrupted (file # 7, block # 3)
ORA-01110: data file 7: '/oracle/oradata/trgt/tools01.dbf'
ORA-01578: ORACLE data block corrupted (file # 2, block # 235)
ORA-01110: data file 2: '/oracle/oradata/trgt/undotbs01.dbf'
FIX
--Recover all blocks marked corrupt in V$DATABASE_BLOCK_CORRUPTION

RMAN> RECOVER CORRUPTION LIST;


-- Cach 1: Recovery block cu the
SELECT NAME, VALUE
FROM   V$DIAG_INFO;
Start RMAN and connect to the target database, which must be mounted or open.

Run the SHOW ALL command to confirm that the appropriate channels are preconfigured.

Run the RECOVER ... BLOCK command at the RMAN prompt, specifying the file and block numbers for the corrupted blocks.

The following example recovers two blocks.

 RECOVER
  DATAFILE 8 BLOCK 13
  DATAFILE 2 BLOCK 19;
You can also specify various options to control RMAN behavior. The following example indicates that only backups with the tag mondayam will be used when searching for blocks. You could use the FROM BACKUPSET option to restrict the type of backup that RMAN searches, or the EXCLUDE FLASHBACK LOG option to restrict RMAN from searching the flashback logs.

 RECOVER
  DATAFILE 8 BLOCK 13
  DATAFILE 2 BLOCK 199
  FROM TAG mondayam;
 
-- Cach 2
RMAN> backup validate check logical database;
RMAN> LIST FAILURE
RMAN> advise failure
RMAN> CHANGE FAILURE
RMAN> repair failure;

=====================
Hãy kết nối với tôi để được hỗ trợ tốt nhất về Oracle Database, RAC, ASM, Security, Tunning, Troubleshooting, DataGuard, GoldenGate, Solaris, Linux, AIX và WebLogic:

👨‍👩‍👧‍👦  KHUYẾN MẠI 50% khóa học online "Quản trị CSDL Oracle 12c cơ bản" tại Unica, sở hữu  trọn đời, học mọi lúc mọi nơi, ƯU ĐÃI ĐẶC BIỆT CHO 100 bạn đầu tiên với giá  399K (giá gốc 1tr2http://Bit.ly/2pq9Pxx

📧 Mail: tranbinh48ca@gmail.com
☎️ Mobile: 090.29.12.888
⚡️ Skype: tranbinh48ca
👨‍ Messenger: https://m.me/101036604657441
👨‍👩‍👧‍👦 Group FB: https://www.facebook.com/groups/413698089218929
Hãy comment những nội dung mà bạn quan tâm xuống bên dưới✏️✏️✏️, tôi sẽ ở bên cạnh và hỗ trợ cho bạn trên con đường trở thành DBA Oracle Expert 👨‍🏫👨‍🏫👨‍🏫
Cảm ơn các bạn 😎😎😎 

ĐỌC NHIỀU

Trần Văn Bình - Oracle Database Master