RMAN Backup Scripts

RMAN Backup Scripts

Whole Database backup

RMAN> backup database;
Default backup location is Flash Recovery Area (FRA) - $ORACLE_HOME/dbs

Check  RFA setup
SQL> show parameter recovery_file_dest;

NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
db_recovery_file_dest string /recovery_area
db_recovery_file_dest_size big integer 20G

MOS - 305648.1 What is a Flash Recovery Area and how to configure it ?
 

Set  backup other than Flash Recovery Area

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

 

Backup Individual Tablespace

RMAN> backup tablespace SYSTEM, UNDOTBS, USERS; 


Backup Individual Datafile
RMAN> backup datafile 6;

RMAN> backup datafile 6 format '/backups/TEST/df_t%t_s%s_p%p';

RMAN> backup datafile 2,4,6,8,10;

RMAN> backup datafile '/Data1/proddata/system01.dbf'; 


Backup Controlfile & Spfile

RMAN> backup current controlfile;

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

RMAN> backup spfile; 


Backup Archivelogs
RMAN> backup archivelog all;
 

>> Time based

RMAN> backup archivelog from time 'sysdate-30' until time 'sysdate-7';
>> With delete input option

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


Backup whole database including archivelogs
RMAN> backup database plus archivelog;
 

>> With delete input option

RMAN> backup database plus archivelog delete input;

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




----------

No comments:

Post a Comment