DBAsupport.com Forums - Powered by vBulletin
Results 1 to 10 of 10

Thread: Overriding an RMAN backup set/piece

  1. #1
    Join Date
    Nov 2006
    Posts
    158

    Overriding an RMAN backup set/piece

    Hi DBA's,

    I do take cold backups of my database (96G) using RMAN (to disk). My configuration parameter for disk storage is as follows:

    CONFIGURE DEFAULT DEVICE TYPE TO DISK; # default
    CONFIGURE CHANNEL DEVICE TYPE DISK FORMAT $ORACLE_BASE/backup/db_name/%U';

    This configuration creates a backup set with 3 pieces. Now, i need to set the configuration such that every time a backup is taken, it should override the present set/pieces & replace them with a new set/pieces, such that the old set/pieces would be automatically deleted.

    Is there the possibility of doing this?

    Please help...
    Regards,

    divroro12

  2. #2
    Join Date
    Mar 2002
    Location
    Mesa, Arizona
    Posts
    1,204
    I take it you're putting the old pieces of this backup on another device (tape), right?

    rm before the script, or "host rm" inside the script
    "I do not fear computers. I fear the lack of them." Isaac Asimov
    Oracle Scirpts DBA's need

  3. #3
    Join Date
    Nov 2006
    Posts
    158
    Yes, Ken i do move the old pieces to tape...
    Regards,

    divroro12

  4. #4
    Join Date
    Mar 2002
    Location
    Mesa, Arizona
    Posts
    1,204
    Cool. If my memory serves me right, the %U is manditory. So you'll end up with an unpredictable file name.

    Some kind of hand-off between the tape backup routine and the disk backup script will need to be worked out. You don't want to delete the old backup unless your sure it's on tape. We have the sys admin's write a file when they're done. I check for the file before proceeding with the disk backup (which includes removing the old backup pieces first).

    #! /bin/bash
    if [ -f /rman/tape_done ]; then
    rm /rman/*
    else
    echo "No tape_done file present, backup terminated"|mailx -s "Backup Error - Missing /rman/tape_done File" sysadmin@yourdomain.com,dba@yourdomain.com
    exit
    fi
    ... proceed with backup script here...
    "I do not fear computers. I fear the lack of them." Isaac Asimov
    Oracle Scirpts DBA's need

  5. #5
    Join Date
    Nov 2006
    Posts
    158
    Thanks Ken, i could definitely use this script...
    Regards,

    divroro12

  6. #6
    Join Date
    Jan 2001
    Posts
    2,828
    Hi

    I think you would be better of with using something like this

    rman> run {
    DELETE NOPROMPT BACKUP OF DATABASE
    your backup script
    }

    rather then using the unix shell script way of doing it

    see the train diagram here
    http://download-uk.oracle.com/docs/c...rcmsynta23.htm

    regards
    Hrishy

  7. #7
    Join Date
    Mar 2002
    Location
    Mesa, Arizona
    Posts
    1,204
    Just curious, why is it better?
    "I do not fear computers. I fear the lack of them." Isaac Asimov
    Oracle Scirpts DBA's need

  8. #8
    Join Date
    Jan 2001
    Posts
    2,828
    Hi

    If i understand the OP's requirement correctly then he wants to just keep only one backup .

    with rm RMAN would never know what happened to the backup with delete RMAN knows that the backup has been deleted.with rm the OP has to to run crosscheck command sometime later to inform RMAN that the backup has been deleted and the catalog records have to be synced.

    regards
    Hrishy

  9. #9
    Join Date
    Mar 2002
    Location
    Mesa, Arizona
    Posts
    1,204
    Good point. Keeping the ctl file(s) and catalog sync'd is a good idea.
    "I do not fear computers. I fear the lack of them." Isaac Asimov
    Oracle Scirpts DBA's need

  10. #10
    Join Date
    Nov 2006
    Posts
    158
    Thanks for your input guys...
    Regards,

    divroro12

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Click Here to Expand Forum to Full Width