Tuesday, 27 November 2012

RMAN Online Backup - (using configured defaults)
This example performs an online (hot) backup of the Oracle database using RMAN. Before performing an online backup, the Oracle database must be in archive log mode. You can use the command "archive log list" to confirm that the database is in archive log mode:
SQL> archive log list

Database log mode              Archive Mode
Automatic archival             Enabled
Archive destination            /u06/app/oradata/TARGDB/archive
Oldest online log sequence     16
Next log sequence to archive   17
Current log sequence           17
Oracle9i introduced the ability to perform an RMAN backup of the database along with all archived redo logs in one command. The details of what will happen from the command below have been already talked about. The only thing in this example is that all of the commands are put into one line.
% rman target /

RMAN> backup database plus archivelog delete input;

Starting backup at 23-DEC-04
current log archived
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=17 devtype=DISK
channel ORA_DISK_1: starting archive log backupset
channel ORA_DISK_1: specifying archive log(s) in backup set
input archive log thread=1 sequence=16 recid=6 stamp=545696327
channel ORA_DISK_1: starting piece 1 at 23-DEC-04
channel ORA_DISK_1: finished piece 1 at 23-DEC-04
piece handle=/orabackup/rman/TARGDB/backup_db_TARGDB_S_38_P_1_T_545696328 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
channel ORA_DISK_1: deleting archive log(s)
archive log filename=/u06/app/oradata/TARGDB/archive/arch_t1_s16.dbf recid=6 stamp=545696327
Finished backup at 23-DEC-04

Starting backup at 23-DEC-04
using channel ORA_DISK_1
channel ORA_DISK_1: starting full datafile backupset
channel ORA_DISK_1: specifying datafile(s) in backupset
input datafile fno=00001 name=/u06/app/oradata/TARGDB/system01.dbf
input datafile fno=00002 name=/u06/app/oradata/TARGDB/undotbs01.dbf
input datafile fno=00011 name=/u06/app/oradata/TARGDB/perfstat01.dbf
input datafile fno=00007 name=/u06/app/oradata/TARGDB/example01.dbf
input datafile fno=00003 name=/u06/app/oradata/TARGDB/cwmlite01.dbf
input datafile fno=00004 name=/u06/app/oradata/TARGDB/drsys01.dbf
input datafile fno=00005 name=/u06/app/oradata/TARGDB/odm01.dbf
input datafile fno=00006 name=/u06/app/oradata/TARGDB/xdb01.dbf
input datafile fno=00008 name=/u06/app/oradata/TARGDB/indx01.dbf
input datafile fno=00009 name=/u06/app/oradata/TARGDB/tools01.dbf
input datafile fno=00010 name=/u06/app/oradata/TARGDB/users01.dbf
channel ORA_DISK_1: starting piece 1 at 23-DEC-04
channel ORA_DISK_1: finished piece 1 at 23-DEC-04
piece handle=/orabackup/rman/TARGDB/backup_db_TARGDB_S_39_P_1_T_545696330 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:04:15
Finished backup at 23-DEC-04

Starting backup at 23-DEC-04
current log archived
using channel ORA_DISK_1
channel ORA_DISK_1: starting archive log backupset
channel ORA_DISK_1: specifying archive log(s) in backup set
input archive log thread=1 sequence=17 recid=7 stamp=545696585
channel ORA_DISK_1: starting piece 1 at 23-DEC-04
channel ORA_DISK_1: finished piece 1 at 23-DEC-04
piece handle=/orabackup/rman/TARGDB/backup_db_TARGDB_S_40_P_1_T_545696585 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
channel ORA_DISK_1: deleting archive log(s)
archive log filename=/u06/app/oradata/TARGDB/archive/arch_t1_s17.dbf recid=7 stamp=545696585
Finished backup at 23-DEC-04

Starting Control File and SPFILE Autobackup at 23-DEC-04
piece handle=/orabackup/rman/TARGDB/c-2528050866-20041223-06 comment=NONE
Finished Control File and SPFILE Autobackup at 23-DEC-04
Observations
  • The key thing to mention here is that we needed to drop the keyword "all" that appeared after the "archivelog" token used in the example of backing up archived redo logs.
  • Notice that RMAN performs a log switch since we included the "... plus archivelog" clause.
  • After performing the log switch, RMAN first creates a backup set of any archived redo logs (including the on that was just created from the log switch). This is backup set "backup_db_TARGDB_S_38_P_1_T_545696328" in the example above.
  • After created the backup set for all archived redo logs, RMAN then creates a backup set for the actual backup of all Oracle database files. In the example above, this is done in backup set "backup_db_TARGDB_S_39_P_1_T_545696330".
  • During the backup of the Oracle database files, changes were being made to the data contained in those files. This information is being made to the online redo logs during that time. It is for this reason that RMAN performs another log switch and creates an archived redo log backup set. This is backup set "backup_db_TARGDB_S_40_P_1_T_545696585" in this example.
  • Finally, since the RMAN configuration parameter "CONTROLFILE AUTOBACKUP" was set to ON, RMAN creates a backup set for the control file (and SPFILE).

No comments:

Post a Comment