In Oracle : Oracle RMAN Maintenance

Oracle Applications EBS 11i, R12      Oracle Database      Data Warehouse & BI      Oracle Middleware      PL/SQL      Linux ...

Oracle DBA

Real Application Cluster (RAC) Maintenance tasks Backup and Recovery Database Architecture Replication Oracle Performance Tuning Oracle DBA - Other articles Oracle scripts/ Selects for DBA Oracle Errors (ORA-nnnnn)

The last articles in the site (HOT)

The most visited articles in the site

In-Oracle.com  -> Oracle DBA -> Oracle Database Backup and Recovery

-> Oracle RMAN Maintenance

 

 RMAN Maintenance

 

 

Here are the main topics for this article:

 

1. How to register a new database with the RMAN Catalog

2. Resynchronization of the Database

3. Resetting a Database

4. Generate Reports & Lists

5. Unregister a Database from the Catalog

6. Backup the Catalog

 

 

1. How to register a new database with the RMAN Catalog

 

To register a new database to the RMAN catalog we have to be connected to the RMAN catalog and to the new (target) database. After that we will use the REGISTER DATABASE; command. See below: 

RMAN maintenance

During the database registration a full resynchronization is done automatically. 

 

 

2. Resynchronization of the Database

 

RMAN catalog must keep all the metadata information about the target database up-to-date. And every time some RMAN commands (like BACKUP & COPY) are executed the RMAN catalog is synchronized with the database (controlfile). 

 

There are 2 types of synchronization:

  • FULL : all the controlfile information is synchronize with the catalog

  • PARTIAL: the physical schema information (data files, tablespaces, online files) is not synchronized; the information about the backups and new archive log is synchronized. 

  When you run RESYNC CATALOG, RMAN creates a snapshot control file in order to obtain a read-consistent view of the  

  control  file, then updates the recovery catalog with any new information from the snapshot. The RESYNC CATALOG command  

   updates the classes or records described in the following table.

 

Record Type Description

Log history

Records that are created whenever a log switch occurs. Note that log history records describe an online log switch, not a log archival.

Archived redo logs

Records associated with archived logs that were created by archiving an online redo log, copying an existing archived redo log, or restoring backups of archived redo logs.

Backups

Records associated with backup sets, backup pieces, proxy copies, and image copies.

Physical schema

(Only in FULL SYNC)

Records associated with datafiles and tablespaces. If the target database is open, then rollback segment information is also updated.

 

3. Resetting a Database

 

When ALTER DATABASE OPEN RESETLOG is run a new database incarnation is created. This could be see in the V$DATABASE_INCARNATION view of the target database. 

 

>>  If this is done using RMAN, the RMAN will recognize the new database as a new one and will use this new incarnation number for the following backups/ restore. 

>>  If this is NOT done using RMAN, the RMAN will NOT recognize the new database as a new one. To let RMAN know that this is a new incarnation we have to reset the database using the command: RESET DATABASE;

 

If we want to restore backups of a prior incarnation of the database, we can use 

RESET  DATABASE TO INCARNATION <incarnation_number>; command.

 

 

4. Generate Reports & Lists

 

RMAN> list backup;    -> To list all backup sets, backup pieces

RMAN> list expired backup;  -> To identify those backups that were not found during a

                                                   crosscheck

RMAN> list backup by file;     ->  List Backup by File 

RMAN> list archivelog all; -> List all archived log files

RMAN> list backup summary;  -> Backups summary

 

For more information about LIST command click here.

 

RMAN> crosscheck backup;  -> check if the backup files exist physically on the disk

 

Use the need backup option to identify which datafiles need a new backup:

RMAN> report need backup days = 9 database; # needs at least 9 days of logs to recover
RMAN> report need backup days = 23 tablespace system;
RMAN> report need backup days = 12 datafile '/oracle/oradata/data_file_15.dbf';

 

If complete recovery of a datafile requires more than the specified number of incremental backups, then RMAN considers it in need of a new backup.

 

RMAN>  report need backup incremental = 3 database; 
RMAN>  report need backup incremental = 6 tablespace system;
RMAN>  report need backup incremental = 8 datafile '/oracle/oradata/data_file_15.dbf';

 

Use the obsolete option to identify which backups are obsolete because they are no longer needed for recovery. The redundancy parameter specifies the minimum level of redundancy considered necessary for a backup or copy to be obsolete (if you do not specify the parameter, redundancy defaults to 1).

 

RMAN>   report obsolete redundancy = 2;   -> Lists backups or copies that have at least 2 more recent backups or copies

 

For more information about REPORT command click here.

For more information about RMAN maintenace click here.

 

 

5. Unregister a Database from the Catalog

 

To unregister a a database from a RMAN catalog we have to use the command UNREGISTER DATABASE;  We must be connected to the RMAN Catalog and also to the target database. See bellow:

 

RMAN maintenance

 

 

6. Backup the Catalog

 

To be sure that the RMAN Catalog is not lost, the RMAN database must be in ARCHIVELOG and maintained as an Oracle production database (must be backed up daily). Also, logical backups for RMAN schema could be taken with imp/exp utility.

 

 

In-Oracle.com  -> Oracle DBA -> Oracle Database Backup and Recovery

-> Oracle RMAN Maintenance

Oracle Applications EBS 11i, R12      Oracle Database      Data Warehouse & BI      Oracle Middleware      PL/SQL      Linux ...

 

     Copyright (c) 2011-2015  www.in-oracle.com  |  Disclaimer: The views expressed on this web site are my own and do not reflect the views of Oracle Corporation. You may use the information from this site only at your risk.