I am an IT professional with 10 years of professional experience,I have good proficiency on Oracle technologies, and at last 2 years of my career to study Real Application Clusters,data guard and participate actively on Oracle community ,If you want to hire me on Contract or to quote on project basis contact me at khurrampc@hotmail.com.

Tuesday, September 29, 2009

Backup Plus Archivleog

Question :

RMAN will do backup of current redolog by moving the log to archivelog if we did 'backup database plus archivelog'. Do RMAN will backup the redolog if the backup command is without archivelog?

Answer :

Whenever you backup archivelog log ,log switch occur for the current log.
SQL> select group#,status
  2    from v$log
  3  /

    GROUP# STATUS
---------- ----------------
         1 INACTIVE
         2 INACTIVE
         3 CURRENT

RMAN> backup archivelog all;

Starting backup at 29-SEP-09
current log archived
using channel ORA_DISK_1
channel ORA_DISK_1: starting archived log backup set
channel ORA_DISK_1: specifying archived log(s) in backup set
input archived log thread=1 sequence=366 RECID=396 STAMP=698845462
channel ORA_DISK_1: starting piece 1 at 29-SEP-09
channel ORA_DISK_1: finished piece 1 at 29-SEP-09
piece handle=/u01/app/oracle/flash_recovery_area/MMI/backupset/2009_09_29/o1_mf_annnn_TAG20090929T114422_5d3c69j7_.bkp tag=TAG20090929T114422 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 29-SEP-09

SQL> select group#,status
  2    from v$log
  3  /


    GROUP# STATUS
---------- ----------------
         1 CURRENT
         2 INACTIVE
         3 ACTIVE
You can see above that during archivelog backup process log switch occur.
SQL> select group#,status
  2    from v$log
  3  /

    GROUP# STATUS
---------- ----------------
         1 CURRENT
         2 INACTIVE
         3 ACTIVE

RMAN> backup database plus archivelog;


Starting backup at 29-SEP-09
current log archived
using channel ORA_DISK_1
channel ORA_DISK_1: starting archived log backup set
channel ORA_DISK_1: specifying archived log(s) in backup set
input archived log thread=1 sequence=367 RECID=398 STAMP=698845610
channel ORA_DISK_1: starting piece 1 at 29-SEP-09
channel ORA_DISK_1: finished piece 1 at 29-SEP-09
piece handle=/u01/app/oracle/flash_recovery_area/MMI/backupset/2009_09_29/o1_mf_annnn_TAG20090929T114650_5d3cbxg3_.bkp tag=TAG20090929T114650 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 29-SEP-09

Starting backup at 29-SEP-09
using channel ORA_DISK_1
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00001 name=/u01/app/oracle/oradata/mmi/system01.dbf
input datafile file number=00002 name=/u01/app/oracle/oradata/mmi/sysaux01.dbf
input datafile file number=00003 name=/u01/app/oracle/oradata/mmi/undotbs03.dbf
input datafile file number=00004 name=/u01/app/oracle/oradata/mmi/users01.dbf
channel ORA_DISK_1: starting piece 1 at 29-SEP-09
channel ORA_DISK_1: finished piece 1 at 29-SEP-09
piece handle=/u01/app/oracle/flash_recovery_area/MMI/backupset/2009_09_29/o1_mf_nnndf_TAG20090929T114654_5d3cc1yz_.bkp tag=TAG20090929T114654 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:45
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
including current control file in backup set
including current SPFILE in backup set
channel ORA_DISK_1: starting piece 1 at 29-SEP-09
channel ORA_DISK_1: finished piece 1 at 29-SEP-09
piece handle=/u01/app/oracle/flash_recovery_area/MMI/backupset/2009_09_29/o1_mf_ncsnf_TAG20090929T114654_5d3cdm4z_.bkp tag=TAG20090929T114654 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 29-SEP-09

Starting backup at 29-SEP-09
current log archived
using channel ORA_DISK_1
channel ORA_DISK_1: starting archived log backup set
channel ORA_DISK_1: specifying archived log(s) in backup set
input archived log thread=1 sequence=368 RECID=400 STAMP=698845668
channel ORA_DISK_1: starting piece 1 at 29-SEP-09
channel ORA_DISK_1: finished piece 1 at 29-SEP-09
piece handle=/u01/app/oracle/flash_recovery_area/MMI/backupset/2009_09_29/o1_mf_annnn_TAG20090929T114748_5d3cdqpv_.bkp tag=TAG20090929T114748 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 29-SEP-09

SQL> select group#,status
  2    from v$log
  3  /


    GROUP# STATUS
---------- ----------------
         1 INACTIVE
         2 ACTIVE
         3 CURRENT
As you can see "backup database plus archivelog" comes up with archivelog backup which inherit the log switch occurrence of archivelog backup.
SQL> select group#,status
  2    from v$log
  3  /

    GROUP# STATUS
---------- ----------------
         1 INACTIVE
         2 ACTIVE
         3 CURRENT


RMAN> backup database;

Starting backup at 29-SEP-09
using channel ORA_DISK_1
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00001 name=/u01/app/oracle/oradata/mmi/system01.dbf
input datafile file number=00002 name=/u01/app/oracle/oradata/mmi/sysaux01.dbf
input datafile file number=00003 name=/u01/app/oracle/oradata/mmi/undotbs03.dbf
input datafile file number=00004 name=/u01/app/oracle/oradata/mmi/users01.dbf
channel ORA_DISK_1: starting piece 1 at 29-SEP-09
channel ORA_DISK_1: finished piece 1 at 29-SEP-09
piece handle=/u01/app/oracle/flash_recovery_area/MMI/backupset/2009_09_29/o1_mf_nnndf_TAG20090929T115013_5d3ck8jy_.bkp tag=TAG20090929T115013 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:45
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
including current control file in backup set
including current SPFILE in backup set
channel ORA_DISK_1: starting piece 1 at 29-SEP-09
channel ORA_DISK_1: finished piece 1 at 29-SEP-09
piece handle=/u01/app/oracle/flash_recovery_area/MMI/backupset/2009_09_29/o1_mf_ncsnf_TAG20090929T115013_5d3clstc_.bkp tag=TAG20090929T115013 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 29-SEP-09


SQL> select group#,status
  2    from v$log
  3  /

    GROUP# STATUS
---------- ----------------
         1 INACTIVE
         2 INACTIVE
         3 CURRENT
As you can only just backup database will not trigger a log switch. But keep in mind during online backup there may be some background process or some online users production activity cause massive redo which filled the redo within the span of backup process time and then trigger a log switch does not mean that "backup database" cause a log switch.

2 comments:

Yogi said...

Hi,

I 'd appreciate, if you write something on db_writer_processes vs dbwr_io_slaves. These always confuse me.

Regards
Yogesh Tiwari

Khurram Siddiqui said...

yes sure i will , but after some days, now a days i am buzy with my office project :)

Followers

About Me

My photo
Melbourne, Victoria, Australia