5 Replies Latest reply: Dec 13, 2012 5:58 PM by 936975 RSS

    Archive logs are missing in hot backup

    936975
      Hi All,

      We are using the following commands to take hot backup of our database. Hot backup is fired by "backup" user on Linux system.

      =======================
      rman target / nocatalog <<EOF
      CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '$backup_dir/$date/%F';
      run {
      allocate channel oem_backup_disk1 type disk format '$backup_dir/$date/%U';
      #--Switch archive logs for all threads
      sql 'alter system archive log current';
      backup as COMPRESSED BACKUPSET database include current controlfile;
      #--Switch archive logs for all threads
      sql 'alter system archive log current';
      #--Backup Archive logs and delete what we've backedup
      backup as COMPRESSED BACKUPSET archivelog all not backed up delete all input;
      release channel oem_backup_disk1;
      }
      allocate channel for maintenance type disk;
      delete noprompt obsolete device type disk;
      release channel;
      exit
      EOF
      =======================


      Due to which after command (used 2 times) "sql 'alter system archive log current';" I see the following lines in alert log 2 times. Because of this all the online logs are not getting archived (Missing 2 logs per day), the backup taken is unusable when restoring. I am worried about this. I there any to avoid this situation.

      =======================
      Errors in file /u01/oracle/admin/rac/udump/rac1_ora_3546.trc:
      ORA-19504: failed to create file "+DATA/rac/1_32309_632680691.dbf"
      ORA-17502: ksfdcre:4 Failed to create file +DATA/rac/1_32309_632680691.dbf
      ORA-15055: unable to connect to ASM instance
      ORA-01031: insufficient privileges
      =======================


      Regards,
      Kunal.
        • 2. Re: Archive logs are missing in hot backup
          tychos
          Hi Kunal,
          Can you replace the backup commands:
          #--Switch archive logs for all threads
          sql 'alter system archive log current';
          backup as COMPRESSED BACKUPSET database include current controlfile;
          #--Switch archive logs for all threads
          sql 'alter system archive log current';
          #--Backup Archive logs and delete what we've backedup
          backup as COMPRESSED BACKUPSET archivelog all not backed up delete all input;
          to
          backup as COMPRESSED BACKUPSET database plus archivelog;
          And retry the backup lease post the result.
          This command should do the implict log switching from within rman.
          Regards,
          Tycho
          • 3. Re: Archive logs are missing in hot backup
            Victor Armbrust
            Have you try the same use the Oracle Owner Software user? It seems you have a permission Problem over ASM
            • 4. Re: Archive logs are missing in hot backup
              kuljeet singh -
              try to remove cmd "sql 'alter system archive log current';" from your script
              as

              4.3.7.1.1 Automatic Online Redo Log Switches During Backups of Archived Logs

              When taking a backup of archived redo logs that includes the most recent log (that is, a BACKUP ... ARCHIVELOG command is run without the UNTIL or SEQUENCE option) if the database is open, then before beginning the backup, RMAN will switch out of the current online redo log group, and all online redo logs that have not yet been archived, up to and including the redo log group that was current when the command was issued. This ensures that the backup contains all redo that was generated prior to the start of the command.

              http://docs.oracle.com/cd/B19306_01/backup.102/b14192/bkup003.htm#i1006454
              • 5. Re: Archive logs are missing in hot backup
                936975
                All thanks you for help, pleas find additional information. I goth the following error as log sequence was missing. Everyday during hotbackup, there are 2 missing archive logs, which makes our backup inconsistent and useless.

                archive log filename=/mnt/xtra-backup/ora_archivelogs/1_32531_632680691.dbf thread=1 sequence=32531
                archive log filename=/mnt/xtra-backup/ora_archivelogs/2_28768_632680691.dbf thread=2 sequence=28768
                archive log filename=/mnt/xtra-backup/ora_archivelogs/2_28769_632680691.dbf thread=2 sequence=28769
                archive log filename=/mnt/xtra-backup/ora_archivelogs/2_28770_632680691.dbf thread=2 sequence=28770
                archive log filename=/mnt/xtra-backup/ora_archivelogs/1_32532_632680691.dbf thread=1 sequence=32532
                archive log filename=/mnt/xtra-backup/ora_archivelogs/2_28771_632680691.dbf thread=2 sequence=28771
                archive log filename=/mnt/xtra-backup/ora_archivelogs/2_28772_632680691.dbf thread=2 sequence=28772
                archive log filename=/mnt/xtra-backup/ora_archivelogs/2_28772_632680691.dbf thread=2 sequence=28773
                RMAN-00571: ===========================================================
                RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
                RMAN-00571: ===========================================================
                RMAN-03002: failure of recover command at 12/13/2012 04:22:56
                RMAN-11003: failure during parse/execution of SQL statement: alter database recover logfile '/mnt/xtra-backup/ora_archivelogs/2_28772_632680691.dbf'
                ORA-00310: archived log contains sequence 28772; sequence 28773 required
                ORA-00334: archived log: '/mnt/xtra-backup/ora_archivelogs/2_28772_632680691.dbf'

                Let me try the susggestions provided above.