Archive

Posts Tagged ‘backup plus archivelog’

Oracle – RMAN backup example


RMAN can be used to backup a database. You can perform a hot backup if the database is in archivelog mode, or a cold backup if it is not. You can either perform a full backup or an incremental backup. RMAN is particularly useful because it only backs up used space.

An RMAN backup will backup the datafiles, controlfile, server parameter file, and archivelogs (where applicable).

To backup a database using RMAN with a level 0 backup you can perform the following:

$ ORACLE_SID = <oracle_sid>
$ORACLE_HOME = <oracle_home>
$ rman
RMAN> CONNECT TARGET /
RMAN> BACKUP DATABASE; # Cold backup without archivelogs
RMAN> BACKUP DATABASE PLUS ARCHIVELOG; # Cold backup with archivelogs

Incremental backups save time, bandwidth and reduce backup sizes. Incremental backups abck up all the blocks changed since the last level 0 incremental backup. If no level 0 backup has been run when you try to run a level 1 backup, then RMAN automatically makes a level 0 incremental backup.

To backup a database using RMAN with a level 1 incremental backup, and skipping inaccessible files, you can perform the following:

RMAN> BACKUP
INCREMENTAL LEVEL 1 CUMULATIVE
SKIP INACCESSIBLE
DATABASE;

Further Reading

http://download.oracle.com/docs/cd/B28359_01/backup.111/b28273/rcmsynta007.htm#RCMRF107