This discussion is archived
9 Replies Latest reply: Mar 28, 2006 7:07 PM by 490221 RSS

logs are archived but not backed up

358284 Newbie
Currently Being Moderated
Hi there,
Thanks in advance for any help. I have two questions:

1. Is there anything wrong with the following sequence of RMAN commands for a nightly backup?

crosscheck archivelog all;
delete noprompt expired archivelog all;
delete noprompt expired backup;
backup database;
backup force (archivelog all);
delete noprompt archivelog all completed before 'sysdate-3';

I'm especially interested in the backup force line since I've only started using it recently.

2. By running the above script on a nightly basis, I discovered that I have some redo logs that were archived but not backed up. E.g. if I run the following:

select count(*) from v$archived_log where archived='YES' and BACKUP_COUNT<1;

On one of my servers, the backup of archive logs has stopped since some days ago. But the archive log mode is on and auto archiving is enabled.

Any help will be appreciated. Many thanks.
Gloria
  • 1. Re: logs are archived but not backed up
    475667 Newbie
    Currently Being Moderated
    Hi

    I will suggest you to don't use the command:
    - delete noprompt archivelog all completed before 'sysdate-3';

    Evaluate to use: DELETE OBSOLETE.
    RMAN> report obsolete;

    RMAN retention policy will be applied to the command
    RMAN retention policy is set to recovery window of 14 days
    Report of obsolete backups and copies
    Type                 Key    Completion Time    Filename/Handle
    -------------------- ------ ------------------ --------------------
    Backup Set           3700   14-02-2006 19:44:16
      Backup Piece       3701   14-02-2006 19:44:16 /db/ARON/BACKUP/RMAN/backup_ARON_582407055_264_1_88hbdksf_1_1.bck
      Backup Piece       3702   14-02-2006 19:44:16 /db/ARON/BACKUP/RMAN/backup_ARON_582407055_264_1_88hbdksf_1_2.bck
    Datafile Copy        3437   30-01-2006 20:13:55 /tmp/system_d01_0.cpy

    RMAN> delete obsolete;

    RMAN retention policy will be applied to the command
    RMAN retention policy is set to recovery window of 14 days
    using channel ORA_DISK_1
    using channel ORA_SBT_TAPE_1
    Deleting the following obsolete backups and copies:
    Type                 Key    Completion Time    Filename/Handle
    -------------------- ------ ------------------ --------------------
    Backup Set           3700   14-02-2006 19:44:16
      Backup Piece       3701   14-02-2006 19:44:16 /db/ARON/BACKUP/RMAN/backup_ARON_582407055_264_1_88hbdksf_1_1.bck
      Backup Piece       3702   14-02-2006 19:44:16 /db/ARON/BACKUP/RMAN/backup_ARON_582407055_264_1_88hbdksf_1_2.bck
    Datafile Copy        3437   30-01-2006 20:13:55 /tmp/system_d01_0.cpy

    Do you really want to delete the above objects (enter YES or NO)?
    Bye, Aron
  • 2. Re: logs are archived but not backed up
    KuljeetPalSingh Guru
    Currently Being Moderated
    Hi,

    set proper retension policy before using delete obsolete command.
  • 3. Re: logs are archived but not backed up
    475667 Newbie
    Currently Being Moderated
    You said:
    Solution: Check if the archivelog exist in the log archive destination. If the is moved to some other location then restore the file back to its original location and then do RMAN back.

    However, isn't that accomplished by the lines
    crosscheck archivelog all;
    delete noprompt expired archivelog all;
    ..
    backup force (archivelog all);

    Sorry I don't mean to defend myself. But I really would like to understand the actions of those two lines. I thought crosschecking and then deleting means deleting the files that are not found physically on the media. Is that right? And would those actions also update the v$archived_log view?


    Yes, you are right: "crosschecking and then deleting means deleting the files that are not found physically on the media"

    And would those actions also update the v$archived_log view?
    Yes, the v$archived_log will be updated and the archivelog will be marked as DELETED. More important for RMAN is that in the catalog's view RC_ARCHIVED_LOG the archived log will be removed.

    The solution I mentioned is to check if you maybe manually moved the archived log in another directory.

    Bye, Aron
  • 4. Re: logs are archived but not backed up
    358284 Newbie
    Currently Being Moderated
    Thanks for your explanation, Aron.

    One more comment... you mentioned the RMAN catalog. Will things be different if I use the control file only and no RMAN database?
  • 5. Re: logs are archived but not backed up
    Paul M. Oracle ACE
    Currently Being Moderated
    From functional point of view, no. See http://download-uk.oracle.com/docs/cd/B19306_01/backup.102/b14191/rcmarchi003.htm#sthref49

    In 10g the only RMAN feature that is not supported in NOCATALOG mode is stored scripts.

    In older versions it was not possible to manage INCARNATIONS without recovery catalog.
  • 6. Re: logs are archived but not backed up
    475667 Newbie
    Currently Being Moderated
    Hi Gloria

    Will things be different if I use the control file only and no RMAN database?

    In your case (problem) there isn't any difference. The RMAN catalog reads only the controlfile!
    However, I'm a fan of the usage of a RMAN catalog instead of the controlfile. "More secure"!

    Bye, Aron
  • 7. Re: logs are archived but not backed up
    358284 Newbie
    Currently Being Moderated
    Just to solve this mystery for anyone who mayb e following the thread. Turns out archive logs are indeed periodically removed from the archive location by one of our old monitoring scripts. Which means some logs that are needed by the backup have been removed in the time between crosscheck and backup.

    So there really is nothing wrong with my backup commands.

    Thank you all for your help.

    Gloria
  • 8. Re: logs are archived but not backed up
    475667 Newbie
    Currently Being Moderated
    The command will run. That is not the problem or a problem. However you will not be able to restore your database in a consistent status.


    In any case, remove this line from your backup strategy:
    delete noprompt archivelog all completed before 'sysdate-3';

    I think that it is to dangerous in your situation or if you really don't master the functionality of RMAN. I don't use this command myself. You must be really very careful to use this command. You can do very bad things.

    Bye, Aron
  • 9. Re: logs are archived but not backed up
    490221 Newbie
    Currently Being Moderated
    Just a comment on the control file vs. catalog database. If you prefer to use control file to keep backup information, suggest you mark down the DBID and backup control file together with every backup. When control file is lost and need to recover, you need the DBID.

    The major difference between catalog database and control file is the storage capacity, although catalog database make it more convenient.

    G.B.