5 Replies Latest reply: Mar 15, 2011 9:17 AM by emre baransel RSS

    RMAN BACKUP SCRIPTS

    822661
      Hi Experts,


      I have to configure RMAN for PROD Instance without catalog db.
      DB: 11.2.0.1
      OS: HP-UX 11.31
      Backup will be :
      Weekly Base-level 0 Backup.
      Daily Incremental Backup
      After 2days Commulative Backup.
      DB size is 60GB.
      Backup Mount point is : 420GB where RMAN Backup wil be placed.

      RMAN Configuration Parameters :

      using target database control file instead of recovery catalog
      RMAN configuration parameters for database with db_unique_name CRPDEV are:

      CONFIGURE RETENTION POLICY TO RECOVERY WINDOW OF 14 DAYS;
      CONFIGURE BACKUP OPTIMIZATION ON;
      CONFIGURE DEFAULT DEVICE TYPE TO DISK;
      CONFIGURE CONTROLFILE AUTOBACKUP ON;
      CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '/u02/rmanbackup/CRPDEV_controlfile_%F';
      CONFIGURE DEVICE TYPE DISK PARALLELISM 2 BACKUP TYPE TO BACKUPSET;
      CONFIGURE DATAFILE BACKUP COPIES FOR DEVICE TYPE DISK TO 1;
      CONFIGURE ARCHIVELOG BACKUP COPIES FOR DEVICE TYPE DISK TO 1;
      CONFIGURE MAXSETSIZE TO UNLIMITED;
      CONFIGURE ENCRYPTION FOR DATABASE OFF;
      CONFIGURE ENCRYPTION ALGORITHM 'AES128';
      CONFIGURE COMPRESSION ALGORITHM 'BASIC' AS OF RELEASE 'DEFAULT' OPTIMIZE FOR LOAD TRUE;
      CONFIGURE ARCHIVELOG DELETION POLICY TO NONE;
      CONFIGURE SNAPSHOT CONTROLFILE NAME TO '/u02/rmanbackup/CRPDEV_snapcf_CRPDEV.f';

      these parameters I will register in rman.

      Kindly let me know whether the retention policy and parallelism is correct.

      I need now Backup level 0, level 1 and Level 2 scripts with TAG, Date ..

      Thanks in Advance.


      regard,
      Waseem.
        • 1. Re: RMAN BACKUP SCRIPTS
          emre baransel
          Hi, nothing seems to be wrong, but
          1- how did you decide to set parallelism to 2? (It may be better to use higher values depending your disk architecture.)
          2- did you think about using incrementally updated backups (image copy which you can switch to)

          * Periodically, level 1 differential backups are created with the same tag as the level 0 datafile copy. The BACKUP FOR RECOVER OF COPY command specifies that an incremental backup should contain only blocks changed since the most recent incremental backup with the same tag.
          * Periodically, the incremental backups are applied to the level 0 datafile copy. Because the datafile copy has been updated with more recent changes, it now requires less media recovery.
          * The following script, run on a regular basis, is all that is required to implement a strategy based on incrementally updated backups.
          RMAN> RECOVER COPY OF DATABASE WITH TAG 'incr_update';
          RMAN> BACKUP INCREMENTAL LEVEL 1 FOR RECOVER OF COPY WITH TAG 'incr_update' DATABASE;
          • 2. Re: RMAN BACKUP SCRIPTS
            822661
            Thanks for your response,
            But I do have some doubts.

            Hi, nothing seems to be wrong, but
            1- how did you decide to set parallelism to 2? (It may be better to use higher values depending your disk architecture.)
            What do you mean by higher values i.e I hve 8 core processors + 32GB RAM.

            2- did you think about using incrementally updated backups (image copy which you can switch to) -- didnt get this point pls explain.

            * Periodically, level 1 differential backups are created with the same tag as the level 0 datafile copy.
            The BACKUP FOR RECOVER OF COPY command specifies that an incremental backup should contain only blocks changed since the most recent incremental backup with the same tag.
            My understading : if we use the BACKUP FOR RECOVER OF COPY then our incrementakl backups will have tag 'incr_update', other the tag of level 0 will be used.
            corrct me if my understanding is wrong.

            **Why we use ALLOCATE CHANNEL FOR MAINTENANCE DEVICE TYPE DISK and when we use.

            Based on Parallelism 2,the RMAN script should be :

            run{
            allocate channel backup_c1 device type disk format '/u02/rmanbkp/SIDNAME_%d_%U.bak';
            allocate channel backup_c2 device type disk format '/u02/rmanbkp/SIDNAME_%d_%U.bak';
            crosscheck archivelog all;
            Backup database plus archive log all;
            backup current control file;
            backup spfile;
            release backup_c1
            release backup_c2
            }

            Incremental Backup Script:

            run{
            allocate channel backup_c1 device type disk format '/u02/rmanbkp/SIDNAME_%d_%U.bak';
            allocate channel backup_c2 device type disk format '/u02/rmanbkp/SIDNAME_%d_%U.bak';
            RECOVER COPY OF DATABASE WITH TAG 'incr_update';
            BACKUP INCREMENTAL LEVEL 1 FOR RECOVER OF COPY WITH TAG 'incr_update' DATABASE;
            Backup archivelog SINCE TIME 'SYSDATE-1'; I want new archive log backups will this command work.
            release backup_c1;
            release backup_c2;
            }


            Kindly correct me and make chnges in the above script if I am wrong.

            Regards,
            Waseem
            • 3. Re: RMAN BACKUP SCRIPTS
              19426
              I think you misunderstand the concept of incrementally updated backups. There's only ONE script, no need to mix it with 'normal' incremental backups. Fortunately documentation shows how to build such a script:

              http://download.oracle.com/docs/cd/E11882_01/backup.112/e10642/rcmbckba.htm#CHDEHBFF


              Werner
              • 4. Re: RMAN BACKUP SCRIPTS
                822661
                Hi Werner,

                What I understood from the link provided by you.

                First will be taking backup as copy of database that will be image copy of the database.

                Then on Daily basis.
                We will go for

                RUN
                {
                RECOVER COPY OF DATABASE -- if no chges in db it will create image copy of the db and the tag will be incr_update
                WITH TAG 'incr_update';
                BACKUP
                INCREMENTAL LEVEL 1
                FOR RECOVER OF COPY WITH TAG 'incr_update' --
                DATABASE;
                }

                if on Sunday we took Backup as copy database
                Monday we run the above sript If there are not chnges in the db then the script will creates an image copy of the database and mark it as incr_update.


                What abt Archivelogs:

                here we are not taking any control file or archive log backup. these have to be added in the script.

                If I go with the above approach,then no need of Commulative backups ..
                Daily Basis above script will work...

                Kinldy correct me if my understanding is wrong.


                regards,
                Waseem.
                • 5. Re: RMAN BACKUP SCRIPTS
                  emre baransel
                  Hi again,
                  With that script, last incremental backup will be applied to your image copy, so as you said you won't need cumulative incremental backups. Also you should add archivelog backup command to your script and set controlfile autobackup on.
                  Regards