RMAN Overview



What is RMAN (Recovery manager):

I covered theoretical part of RMAN.the RMAN utility is performing backup, restore and recovery operation in oracle Database 

RMAN Features:

Backup the database, tablespace, datafiles, control files and archive logs 

Store the frequently executed backup and recovery operations

Its perform the incremental level backup

Skip the unused blocks

Types of connection in RMAN:

There are three types of connection available in RMAN

Target database:
It is connected to target database with in SYSDBA privilege.

Recovery catalog database:

This is optional database which is configured for the RMAN repository

Auxiliary database:

Auxiliary database provide the three types of connection

Duplicate database
TSPITR instance
Standby database

This connection is using RMAN duplicate command or it may be a temporary database that is used during Tablespace point-in-time recovery (TSPITR)
Standby db is a copy of your production database that can use for DR purpose.

RMAN Backup Types:

RMAN Basically perform the online backup

It’s perform the different types of backups

    FULL BACKUP
    INCREMENTAL BACKUP

FULL BACKUP:

Full backup contain whole database backup

INCREMENTAL BACKUP:

Incremental backup strategy:

Weekly level 0 backups

A level 1 cumulative backup in-between

Daily incremental level 1 differential backups

Archive log backup every 30 minutes

There are two types of incremental backups available

Differential incremental backup:


It’s contain only modified blocks from level n or lower




Cumulative incremental backup


n level backup which contains all blocks changed science previous backup  at a level n-1 or lower







RMAN Dynamic Views:

V$Archived_log:
Its shows which archives have been created,backed up, cleared in the database

V$Backup_curruption:
Its show which blocks have been founded corrupted during a backup of backupset

V$Copy_curruption:
Its shows which block have been found corrupt during an image copy

V$Database_Block_curruption:
Display the information about database blocks that were corrupted after the last backup.

V$Backup_Set:
Its show backup sets that have bee created.

V$Backup_piece:
Its show backup piece created of backup sets.  


RMAN USEFUL COMMANDS

Show all of the RMAN parameters for the database
RMAN> show all;

Backup the database using the standard RMAN parameters
RMAN> backup database;

List all of the current backups for the database
RMAN> list backup;

List Backup summary
RMAN> list summary;

Crosscheck backups to see if they still exist
RMAN> crosscheck backup;

Crosscheck archive logs to see if they still exist
RMAN> crosscheck archivelog all;

Remove any expired backup
RMAN> delete expired backup;

Remove any expired archivelog
RMAN> delete expired archivelog;

Configure the disk channel to the format /backup/ora_df%t_s%s_s%p`
RMAN> CONFIGURE CHANNEL DEVICE TYPE DISK FORMAT ‘/backup/ora_df%t_s%s_s%p’;

Configure the disk channel to the format +FLASHDG
RMAN> CONFIGURE CHANNEL DEVICE TYPE DISK FORMAT ‘+FLASHDG’;


Backup the database and archivelogs using the standard RMAN parameters and delete the archivelogs after the backup
RMAN> backup archivelog all delete input;
And


RMAN> run
2> {
3> backup database;
4> backup  archivelog all delete input;
5> }

Report of files that need backup due to unrecoverable operations
RMAN> report unrecoverable;

Report the obsolete backups and archivelogs
RMAN> report obsolete;

Delete the obsolete backups and archivelogs
RMAN> delete obsolete;

List all of the archivelogs
RMAN> list archivelog all;

Delete a specifed backupset
RMAN> delete backupset 1344

Sample backup command
RMAN> run
2> {
3> backup database;
4> sql “alter system switch logfile”;
5> backup archivelog all delete input;
6> sql “alter database backup controlfile to trace”;
7> }


Backup archive logs from scn 680
RMAN> run
2> {
3> ALLOCATE CHANNEL d1 DEVICE TYPE disk
4> FORMAT = ‘/app/oracle/admin/TEST/backup/df_%d_%s_%p.bak’;
5> backup as compressed backupset archivelog from sequence 680;
6> }

Backup archive logs and delete them up to scn 679
RMAN> run
2> {
3> ALLOCATE CHANNEL d1 DEVICE TYPE disk
4> FORMAT = ‘/app/oracle/admin/TEST/backup/df_%d_%s_%p.bak’;
5> backup as compressed backupset archivelog high sequence 679 delete input;
6> }

Point in time recovery
RMAN> run{
2> set until time “to_date(’05/07/11 09:00:00' , ‘dd/mm/yy hh24:mi:ss’)”;
3> restore database;
4> recover database;
5> alter database open resetlogs;
}

Delete archive logs up to scn 650
RMAN> delete archivelog high sequence 650;

List archivelogs from yesterday.
RMAN> list archivelog time between “sysdate -1? and “sysdate”

Delete archivelogs backed up 1 time to disk
RMAN> delete archive log all backed up 1 times to disk;

Delete backups older than 7 days
RMAN> delete backup completed before ‘sysdate -7';

Restore archivelog between to scn numbers
RMAN> restore archivelog scn between 547484587 and 547662805;

Check For Logical And Physical Block Corruption

RMAN> backup check logical validate database;


Comments

Popular posts from this blog

How to troubleshoot long running concurrent request in R12.2

How to run Gather Schema Statistics in R12.2

How to compile forms in R12.2