RMAN Backup script

Cyrille Modiano

OCP Oracle DBA in Montreal at DBSoft

Latest posts by Cyrille Modiano (see all)

This is a sample backup script I used, it has already a lot of options. Feel free to make any modification you want. If you add some good enhancements, let me know I can put them here so everybody can profit from them.

RMAN Backup script

22 thoughts on “RMAN Backup script

  1. Hi Cyrille

    Great script

    Maybe add some “mkdir -p” to create the required directories.

    I found these missing:

    $BACKUP_BASE/log
    $BACKUP_BASE/
    $BACKUP_BASE//autobackup

    sure I can create them, but nice if I didn’t have to 🙂

  2. Hi Cyrille, Nice script. Thank you for a such good job.
    Is there any similar for recovery?

    1. Hi Allan,

      Thank you for your feedback, I’m glad you found the script useful.
      I don’t have a similar one for restore operations, there are too many specificities.

      Cyrille

  3. Hi Cyrille,

    Script is very nice, Please let me know if you have done any updates to the script recently.

  4. Thanks. maybe email address can be set into variable declared early in the script (near BACKUP_BASE). Easy for new comer (most of newbies copy paste without reading through the whole script). And also easier to change it later 🙂

  5. Hi Cyrille,

    In these script you’re backup the database on the same filesystem the databse are, right ?

    Is it possible to backup to another filesystem (like /backup) ?

    Thanks and regards,

    Mitch

  6. Hi Cyrille,

    When I try to lauch the scripts, I’ve an error:

    oracle@server[]:/outils/scripts
    # ./backup_rman_mitch.bash PROD FULL COMPRESS 1
    ./backup_rman_mitch.bash: ./log/rman_backup_PROD_FULL_20181112140441.log: No such file or directory
    egrep: can’t open ./log/rman_backup_PROD_FULL_20181112140441.log
    cat: cannot open ./log/rman_backup_PROD_FULL_20181112140441.log

    Do you have an idea ?

    Regards,

    Mitch

  7. Hi Cyrille,

    Thanks for your help, but I always got an error:

    oracle@server[]:/outils/scripts
    # ./backup_rman_mitch.bash PROD FULL COMPRESS 1
    ./backup_rman_mitch.bash: /log/rman_backup_PROD_FULL_20181112150007.log: Permission denied
    egrep: can’t open /log/rman_backup_PROD_FULL_20181112150007.log
    cat: cannot open /log/rman_backup_PROD_FULL_20181112150007.log

    Regards,

    Mitch

  8. Hi Cyrille,

    Same error:

    oracle@server[]:/outils/scripts
    # ./backup_rman_mitch.bash PROD FULL COMPRESS 1
    ./backup_rman_mitch.bash: /log/rman_backup_PROD_FULL_20181112_151212.log: Permission denied
    egrep: can’t open /log/rman_backup_PROD_FULL_20181112_151212.log
    cat: cannot open /log/rman_backup_PROD_FULL_20181112_151212.log

    Regards,

    Mitch

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.