Overview
Overview about RMAN, purpose and usage. RMAN stands for Oracle Recovery Manager
General Information
- Backs up, restores and recovers Oracle Database
- Verifies data file, tablespace, database
- Can be used via Command-Line Client
- populates V$DATABASE_BLOCK_CORRUPTION Oracle View
- Use this only with combinations of ANALYZE (+ DBV is optional)
- If the results of DBV and RMAN differ, you must give priority to the RMAN results.
- Check result is written to an Oracle tracefile
What IS checked by RMAN
- Oracle Datafiles
- Archived Redo Logs
- Redo Logs
- Control File
- Parameter File (SPFILE)
- Oracle Wallet File
- LOB Data (within the datafile)
- UNDO Segment (within the datafile)
- Corruption in Free Space (within the datafile)
What IS NOT checked by RMAN
- Cross Reference between objects
Checking a single object
- Check a single block within data file:
OS> rman nocatalog
RMAN> connect target /
RMAN> validate datafile 1 block 10;
Check a single or some data file:
OS> rman nocatalog
RMAN> connect target /
RMAN> backup check logical validate ( datafile 1,23,34 );
OR
OS> rman nocatalog
RMAN> connect target /
RMAN> validate datafile 1,23,34;
Check a single tablespace:
OS> rman nocatalog
RMAN> connect target /
RMAN> backup check logical validate ( tablespace 'SYSAUX' );
OR
OS> rman nocatalog
RMAN> connect target /
RMAN> validate tablespace SYSAUX;
- Check a Redo Log File: (Note, set "db_block_checksum" to "TYPICAL" or "TRUE")
OS> rman nocatalog
RMAN> connect target /
RMAN> validate archivelog sequence 821;
Checking the entire database
- OS> brbackup -u / -m all -w only_rmv -e <degree of parallelization> -c
or in case BR*Tools SSFS is used
OS> brbackup -u // -m all -w only_rmv -e <degree of parallelization> -c
where:
'-e' specifies the degree of parallel processing for the action.
To restrict the check to specific tablespaces or data files, you must change the indicator to -m accordingly by, for example, inserting the tablespace name or number of the data file.
- Check database for physical corruption:
OS> rman nocatalog
RMAN> connect target /
RMAN> backup validate database;
- Check database for logical corruption:
OS> rman nocatalog
RMAN> connect target /
RMAN> backup validate check logical database;
Before Evaluating the output
RMAN stores the information about found block corruptions in the control file of the database. You can access this information via the database view V$DATABASE_BLOCK_CORRUPTION.
If you execute the check via brbackup, the system automatically prints out the found block corruption and saves it in the brbackup log file.
To evaluate the list of corrupted blocks use BRCONNECT as below specified:
OS> brconnect -u / -c -f lscorr
Furthermore, BR*TOOLS checks whether the corruption is above the upper limit of the segment. This is important for you to know because as a rule such block corruptions can be ignored or, at the very least, do not directly cause data losses.
Evaluating the output
RMAN> backup check logical validate ( datafile 19 );
Starting backup at 26-JAN-16
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=63 device type=DISK
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set input datafile file number=00019 name=D:\ORACLE\RIN\SAPDATA4\SR3CORRUPT_1\SR3COR RUPT.DATA1
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:03
List of Datafiles
=================
File Status Marked Corrupt Empty Blocks Blocks Examined High SCN
--------------------------------------------------------------------------------------------
19 FAILED 0 965 14080 205831109
File Name: D:\ORACLE\RIN\SAPDATA4\SR3CORRUPT_1\SR3CORRUPT.DATA1
Block Type Blocks Failing Blocks Processed
----------------------------------------------------------
Data 2 10514
Index 0 2240
Other 1 361
validate found one or more corrupt blocks
See trace file D:\ORACLE\RIN\SAPTRACE\diag\rdbms\rin\rin\trace\rin_ora_2120.trc for details
Finished backup at 26-JAN-16
Take a special note to entries "Status" and "Marked Corrupt" as this column will tell us the result in a compact way!
Here in the above example there are 3 corrupted Blocks in this datafile and they are listed below as well.
Navigating to other Chapters
Consistency Check with 'ANALYZE' command
Consistency Check with Data Pump
Which object is stored in the corrupted block(s)
Checks found corrupted blocks. What to do now