This discussion is archived
7 Replies Latest reply: Dec 7, 2012 4:47 AM by rarain RSS

Need to schedule backups, Need assistance

787789 Newbie
Currently Being Moderated
I want to schedule the backups for my new oracle window server. Can some one help me how to write the proper scripts.

Following are the requirements.

1. Weekly Full DB Backup at every Friday (Retention Period: 1 Month)

2. Daily Incremental DB Backup (Retention Period: 1 Week)

3. Daily Archive Logs Backup (Retention Period: 1 Week), though I know their is nothing like retention period for archivelogs backups, however I want to keep 1 week backups in my disk alike backupsets for one weeks).


Thanks,
  • 1. Re: Need to schedule backups, Need assistance
    Aman.... Oracle ACE
    Currently Being Moderated
    What's the db version in 4 digits? Use EM, it can do it all with just few button clicks and also can give a script that you can use if you want to run it all in CLI.

    Aman....
  • 2. Re: Need to schedule backups, Need assistance
    EdStevens Guru
    Currently Being Moderated
    784786 wrote:
    I want to schedule the backups for my new oracle window server. Can some one help me how to write the proper scripts.

    Following are the requirements.

    1. Weekly Full DB Backup at every Friday (Retention Period: 1 Month)

    2. Daily Incremental DB Backup (Retention Period: 1 Week)

    3. Daily Archive Logs Backup (Retention Period: 1 Week), though I know their is nothing like retention period for archivelogs backups, however I want to keep 1 week backups in my disk alike backupsets for one weeks).


    Thanks,
    First off, your concept of how long to keep the various backups is all wrong. You configure rman to specify either a recovery window or a level of redundancy. By far the most common is a recovery window. So say you specify a recovery window of 30 days. Whenever you run rman to take a backup, include a step to 'delete obsolete'. Then you are letting rman decide how long it needs to keep a backup.

    Also, be sure to backup -- and delete - your archivelogs regularly
    rman> backup archivelog all delete all input;
    Or some variation of that. Do yourself a favor and read the backup and recovery manual about the variations and what they mean.

    Personally, I've never liked setting up my backups in OEM. I far prefer the control I get by writing my own scripts.
  • 3. Re: Need to schedule backups, Need assistance
    Osama_Mustafa Oracle ACE
    Currently Being Moderated
    OS Version + Db Version
  • 4. Re: Need to schedule backups, Need assistance
    BSalesRashid Explorer
    Currently Being Moderated
    Hi,
    Do you really want to keep about 4 / 5 full backups ? for a month ?
  • 5. Re: Need to schedule backups, Need assistance
    787789 Newbie
    Currently Being Moderated
    My DB version is 11.2.0.1
    And platform : windows 98

    =============

    I asked my boss, it is not a good strategy to keep 4 to 5 full backups in a month, however he says, it is the requirement. Im only confused about Incremental level1 backup, how will i keep retention period for that, and How will my script removes the 1 week archive backup, I know how to deal with removing archives, but how can i put it in script to delete the 7 days archive backups.

    THanks

    Edited by: 784786 on Dec 6, 2012 10:15 PM
  • 6. Re: Need to schedule backups, Need assistance
    EdStevens Guru
    Currently Being Moderated
    784786 wrote:
    My DB version is 11.2.0.1
    And platform : windows 98

    =============

    I asked my boss, it is not a good strategy to keep 4 to 5 full backups in a month, however he says, it is the requirement. Im only confused about Incremental level1 backup, how will i keep retention period for that, and How will my script removes the 1 week archive backup, I know how to deal with removing archives, but how can i put it in script to delete the 7 days archive backups.

    THanks

    Edited by: 784786 on Dec 6, 2012 10:15 PM
    As I said ealier, you let rman handle it. Yous specify in your rman configuration what you want the recovery window to be. Let's say you set it at 30 days. That means you want rman to retain any and all backups (full, incremental 0, incremental 1, archivelog) that could be needed to restore the database to any point within that 30 day period. When a particular backup set is no longer needed to recover to a date within that period, it is considered 'obsolete' and will be deleted when you issue the rman 'DELETE OBSOLETE' command.

    The last thing you want to be doing is managing your backupsets outside of rman. rman is keeping his own record of what backups have been made, what is needed, etc. etc. If you try to manage backup retention outside of rman you simply create a huge mess and when you try to recover your database, rman won't know fact from fiction.

    The 'bad strategy' is not in how long you keep your backups, it's how you are managing them, and it looks very much like you want to manage them in the worst way possible.
  • 7. Re: Need to schedule backups, Need assistance
    rarain Explorer
    Currently Being Moderated
    In RMAN we have two types of backup retention policy. One is Redundancy and another is recovery window. In case of redundancy RMAN retains specified number of backup copies for each data files irrespective of time and in case of recovery window it retains sufficient backup which will allow you to restore the database to any point in time withing specified number of days in recovery window.

    Edited by: 963750 on Dec 7, 2012 4:47 AM

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points