RMAN

Oracle Incremental Backup Level 0 or 1

A level 1 incremental backup can be either of the following types:

  • differential backup, which backs up all blocks changed after the most recent incremental backup at level 1 or 0
  • cumulative backup, which backs up all blocks changed after the most recent incremental backup at level 0

Incremental backups are differential by default.

Incremental Backup full, 0 or  1 :

Backup level Advantage Disadvantage
Full backup Recovery requires just one single read form the backup storage device.No dependency between the two full backup. If one is lost you may use another recent full backup to recover certain amount of data, not everything. The type of backup cause longest type of outage during the backup time.It is the most expensive type of backup because it takes maximum amount of storage space among all types of backup.It also takes  much longer time to run than its other counterparts.
incremental Less media storage is required since it back up only the files that changed since the last backup.It take much less time in comparison to other types of backup. Recover requires a full backup and all the incremental backup.A complete data recovery depends on the all the incremental backups and the last full backup.
differential since differential backup takes backup of a series of changes since the last full backup, it requires less of number of backup sets to restore.They provide efficient recovery when full backup is taken rarely( e.g. monthly)  The amount of storage required for a differential backup may exceed than that is required for incremental backup when significant amount of data changes regularly.

Incremental_backup

Incremental_backup._1JPG

The following commands performs a level 0 backup of the database:

RMAN> BACKUP INCREMENTAL LEVEL=0 DATABASE;
RMAN> BACKUP INCREMENTAL LEVEL 0 DATABASE PLUS ARCHIVELOG;

 

The following commands performs a level 1 backup of the database:

RMAN> BACKUP INCREMENTAL LEVEL=1 DATABASE;
RMAN> BACKUP INCREMENTAL LEVEL 1 DATABASE PLUS ARCHIVELOG;
br: erman.
Advertisements
Standard
RMAN

RMAN COMMANDS

Backup Command

1) If you want to take a backup of a datafile:

RMAN> backup datafile 4;

2) If you want to take backups of few datafile:

RMAN> backup datafile 1,3,4;

3) If you want to take backup of a tablespace:

RMAN> backup tablespace users;

4) If you want to take the backup of database:

RMAN> backup database;

List Command

1) The following command will show you all existing backups of database.

RMAN> list backup;

2) The following command will show you all existing backups of user tablespace.

RMAN> list backup of tablespace users;

3) The following command will show you all existing backups of datafile 4.

RMAN> list backup of datafile 4;

4) The following command will show you all existing image copy of datafile 4.

RMAN> list copy of datafile 4;

5) The following command will show you all existing backups of tablespace users or database or datafile.

RMAN> list backup of database;

6) The following command will show you all the archivelog files present in database

RMAN> list archivelog all;

7) The following command will show you all the backups of archivelog files

RMAN> list backup of archivelog all;
Standard
RMAN

RMAN > could not access datafile Error

This error is occur when RMAN is not able to access the desired datafile.

RMAN>  backup database skip inaccessible;
 Starting backup at 10-AUG-17
 using target database control file instead of recovery catalog
 allocated channel: ORA_DISK_1
 channel ORA_DISK_1: SID=7 device type=DISK
 could not access datafile 10
 skipping inaccessible file 10

Solutions :

RMAN> restore datafile 10;
Starting restore at 10-AUG-17
using channel ORA_DISK_1
creating datafile file number=10 name=/data/DB12CC/datafile/dummy.dbf
restore not done; all files read only, offline, or already restored
Finished restore at 10-AUG-17
Standard
RMAN

This tutorial gives you an introduction on how to perform Oracle DB backup using RMAN. For the impatient, here is the quick snippet, that takes RMAN backup of both database and archive logs.

We write ORACLE_SID and ORACLE_HOME in the Oracle user profile file.

.bash_profile

export ORACLE_SID=db12c

export ORACLE_HOME=/u01/app/oracle/product/12.2.0/db_home1

We create the dbscripts folder under the oracle user and create the “rman.sh” file under it.

[oracle@ermankara]# mkdir -p /home/oracle/dbscrips
[oracle@ermankara]# cd /home/oracle/dbscrips
[oracle@ermankara dbscrips]# vi rman.sh
#!/bin/bash

. /home/oracle/.bash_profile

rman target / nocatalog << EOF > /home/oracle/dbscripts/rman.log

run {

allocate channel c1 type disk;

allocate channel c2 type disk;

allocate channel c3 type disk;

allocate channel c4 type disk;

backup as compressed backupset archivelog all not backed up tag='ARCH';

backup as compressed backupset database tag='DATA';

backup current controlfile tag='CCF';

backup spfile tag='SPF';

release channel c1;

release channel c2;

release channel c3;

release channel c4;

}

exit

EOF

How to backup Oracle Database using RMAN

Aside