What are the tools for checking block corruption in Oracle
This article focuses on "what are the tools for checking data block corruption in Oracle". Interested friends may wish to have a look. The method introduced in this paper is simple, fast and practical. Let's let the editor take you to learn what are the tools for checking data block corruption in Oracle.
1.1DBVERIFY tool
Physical errors in data blocks can be detected by the DBV command.
[oracle@pxboracle ~] $dbv file=/u01/app/oracle/oradata/orcl/test01.dbf blocksize=8192
Backup command for 1.2RMAN
The backup command of RMAN can check for physical errors in data blocks during backup.
RMAN > backup datafile / u01/app/oracle/oradata/orcl/test01.dbf
Backup validate command for 1.3RMAN
RMAN > backup validate database;-verify all files, including data files, control files, parameter files
RMAN > backup validate datafile 4;-verify data file no. 4
1.4 DBMSHM package
The RUN_CHECK of the DBMS_HM package can check for block physical errors. It can detect only one extents.
SYS@devdb >
1 begin
2 dbms_hm.run_check (
3 check_name = > 'Data Block Integrity Check'
4 run_name = > 'df4test',-- check the test table in file 4
5 input_params = > 'BLC_DF_NUM=4;BLC_BL_NUM=128'); -' BLC_DF_NUM=4 indicates file number 4, BLC_BL_NUM=128-- block number
6 end
7 /
-check the inspection report to find the damage to the block in the No. 4 data file.
SYS@devdb > select dbms_hm.get_run_report ('df4test') from dual
-delete all tested reports
SYS@devdb >
1. Begin
2.dbms_hm.drop_schema ()
3.end
/
1.5 exp/expdp command
When the exp/expdp command exports the database, each block is scanned completely, so the physical error of the block is also checked.
[oracle@devdb ~] $exp scott/oracle owner=scott 1.6Use DBMS_REPAIR package
The DBMS_REPAIR package can check for block corruption of table and index objects.
Begin
Dbms_repair.admin_tables (table_name = > 'REPAIR_1'
Table_type = > dbms_repair.REPAIR_TABLE
Action = > dbms_repair.CREATE_ACTION)
End
Declare
Cor number
Begin
Dbms_repair.check_object (schema_name = > 'SYS'
Object_name = > 'BIG'
Repair_table_name = > 'REPAIR_1'
Corrupt_count = > cor)
Dbms_output.put_line (cor)
End
Select * from REPAIR_1
At this point, I believe you have a deeper understanding of "what are the tools for checking block corruption in Oracle?" you might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!