Oracle RMAN Backup command

Making Whole Database Backups with RMAN

RMAN> BACKUP DATABASE; # Uses automatic channels to make backup

RMAN> SQL 'ALTER SYSTEM ARCHIVE LOG CURRENT'; # Switches logs and archives all logs

Backing up Individual Tablespaces with RMAN

RMAN> BACKUP DEVICE TYPE sbt MAXSETSIZE = 10M TABLESPACE users, tools;

Backing Up Individual Datafiles and Datafile Copies with RMAN

RMAN> BACKUP DEVICE TYPE sbt DATAFILE 1,2,3,4 DATAFILECOPY '/tmp/system01.dbf';

Backing Up Datafile Copies

RMAN> BACKUP DEVICE TYPE sbt DATAFILECOPY '/tmp/system01.dbf';

Including the Current Control File in a Backup of Other Files

RMAN> BACKUP DEVICE TYPE sbt TABLESPACE users INCLUDE CURRENT CONTROLFILE;

Backing Up the Current Control File Manually

RMAN> BACKUP CURRENT CONTROLFILE TAG = mondaypmbackup;

Backing Up a Control File Copy

RMAN> BACKUP AS COPY CURRENT CONTROLFILE FORMAT '/tmp/control01.ctl';
RMAN> BACKUP DEVICE TYPE sbt CONTROLFILECOPY '/tmp/control01.ctl';

Backing Up Server Parameter Files with RMAN

RMAN> BACKUP DEVICE TYPE sbt SPFILE;

Backing Up Archived Redo Logs with RMAN

RMAN> BACKUP ARCHIVELOG ALL;

RMAN> BACKUP ARCHIVELOG FROM TIME 'SYSDATE-30' UNTIL TIME 'SYSDATE-7';

RMAN> BACKUP ARCHIVELOG FROM TIME "to_date('20161121 124000','YYYYMMDD HH24MISS')" UNTIL TIME "to_date('20161121 140000','YYYYMMDD HH24MISS')" DELETE INPUT TAG 'ARCHIVELOG_LOG_BACKUP';

Leave a Reply

Your email address will not be published. Required fields are marked *