RMAN Basic Backup Commands

Applies to: Database Management Software Oracle Std and Enterprise Edition to

Whole database backup:

RMAN> backup database;
RMAN> backup database format '/backups/RMAN/df_t%t_s%s_p%p';

Whole database backup + Archivelog:

RMAN> backup database plus archivelog delete input;
RMAN> backup database plus archivelog delete input format '/backups/PROD/df_t%t_s%s_p%p';

Tablespace backup with RMAN:

RMAN> backup tablespace  TBS1, USERS;

Datafile Backup with RMAN:

RMAN> backup datafile 29,30,31;
RMAN> backup datafile 29 format '/RMAN/df_t%t_s%s_p%p';
RMAN> backup datafile '/oradata/tbs01.dbf';

Backup current control file and Spfile with RMAN:

RMAN> backup current controlfile;
RMAN> backup current controlfile format '/RMAN/df_t%t_s%s_p%p';
RMAN> backup spfile;

Backup Archivelog with RMAN:

RMAN> backup archivelog all;

Backup archivelog generated between yesterday and 60th day.

RMAN> backup archivelog from time 'sysdate-60' until time 'sysdate-1';

Backup logfiles between two log seqeunces.

RMAN> backup archivelog from logseq=XXX until logseq=YYY delete input format '/backups/PROD/%d_archive_%T_%u_s%s_p%p';

Note: No backup location means backups will automatically be placed in the Flash Recovery Area (FRA). If the FRA is not setup then all backups will go to default $ORACLE_HOME/dbs. See http://www.dbas-oracle.com/2011/07/how-to-change-dbrecoveryfiledest-and.html for FRA configuration.

No comments:

Post a Comment