Measure the test taker's knowledge about Oracle Database Bad blocks.
How to check Bad blocks of Oracle databases:
1. Use the DBV (DB File Verify) tool;
2. Use the RMAN (Recovery Manager) tool;
DBV (DB File Verify) tool:
External commands, physical media data structure integrity check;
It can only be used for offline or online data files. Block checks for control files and redo log files are not supported;
You can also verify the backup file (copy command backup of rman or CP command backup of the operating system );
Enter the drive letter and execute the following script:
D: \ app \ Administrator \ oradata \ orcl> dbv file = ZL9MTLBASE. DBF blocksize = 8192;
RMAN (Recovery Manager) tool:
Checks the integrity of logical data structures;
When you use the Recovery Manager online to scan Bad blocks and backups, you need to run the database in archive log. Otherwise, the database can only be started without being mounted;
RMAN> backup check logical validate datafile n;
The preceding command can check whether the data file contains bad blocks without generating actual backup output.
In addition, when the Recovery Manager is used for actual database backup, a bad block check is also performed.
Run the RMAN command: backup validate check logical database;
It is more convenient to combine the V $ DATABASE_BLOCK_CORRUPTION view.
1). rman target/nocatalog
2) RMAN> spool log to 'd:/dbbak/rmanlog. log '; --- specify to output the rman log File
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;
};
3) select * from V $ DATABASE_BLOCK_CORRUPTION;
4) -- If V $ database_block_partition uption contains rows please run this query to find the objects that contains the specified upted blocks:
SELECT e. owner,
E. segment_type,
E. segment_name,
E. partition_name,
C. file #,
Greatest (e. block_id, c. block #) pai_start_block #,
Least (e. block_id + e. blocks-1, c. block # + c. blocks-1) pai_end_block #,
Least (e. block_id + e. blocks-1, c. block # + c. blocks-1 )-
Greatest (e. block_id, c. block #) + 1 blocks_upted,
Null description
FROM dba_extents e, v $ database_block_corruption c
WHERE e. file_id = c. file #
AND e. block_id <= c. block # + c. blocks-1
AND e. block_id + e. blocks-1> = c. block #
UNION
SELECT s. owner,
S. segment_type,
S. segment_name,
S. partition_name,
C. file #,
Header_block pai_start_block #,
Header_block pai_end_block #,
1 blocks_upted,
'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 #) pai_start_block #,
Least (f. block_id + f. blocks-1, c. block # + c. blocks-1) pai_end_block #,
Least (f. block_id + f. blocks-1, c. block # + c. blocks-1 )-
Greatest (f. block_id, c. block #) + 1 blocks_upted,
'Free Block' description
FROM dba_free_space f, v $ database_block_uption c
WHERE f. file_id = c. file #
AND f. block_id <= c. block # + c. blocks-1
AND f. block_id + f. blocks-1> = c. block #
Order by file #, pai_start_block #;
5 ),
SELECT tablespace_name, segment_type, owner, segment_name
FROM dba_extents
WHERE file_id = & fileid
And & blockid between block_id AND block_id + blocks-1;
Quick identification in alarm logs:
When a bad block problem occurs, the abnormal performance of the database is usually as follows:
Reports ORA-01578 errors.
Reports ORA-1110 errors.
Reports ORA-00600 errors. The first parameter is 2000-8000, Cache layer 2000-4000, Transaction layer 4000-6000, and Data layer 6000-8000.
The Corrupt block dba: 0x160c5958. found is displayed in the Trace file. Failed to analyze the object.
Background processes, such as DBWR and LGWR, have long abnormal waits, such as LGWR wait for redo copy.