1 2 Previous Next 18 Replies Latest reply: Oct 22, 2013 5:36 AM by Rizwan Shaukat RSS

    RMAN backup scripts .....

    Rizwan Shaukat

      I have write the following scripts with respective frequencies: pls suggest about the scripts if any enhancement required.

       

      Thnx

       

      weekly

      ------

      Run

      {

      Allocate channel ch01 type disk maxpiecesize = 2g;

      Backup incremental level=0 format 'D:\rmanbK\Fullbackup\bk_u%u_s%s_p%p_t%t' database;

      sql 'alter system archive log current';

      backup archivelog all delete input format 'D:\rmanbK\Archive\arch-s%s-p%p-t%t';

      backup spfile format 'D:\rmanbK\Fullbackup\spfile_%d_%s_%T_dbid%I';

      Backup current controlfile format 'D:\rmanbK\Fullbackup\Ctrl_u%u_s%s_p%p_t%t';

      release channel ch01;

      }

       

       

       

       

       

       

       

       

      Daily

      -------

      Run

      {

      Allocate channel ch01 type disk maxpiecesize = 2g;

      sql 'alter system archive log current';

      Backup incremental level 1 cumulative database format 'D:\rmanbK\Incremental\Bk_%d_%s_%p_%T.bkp';

      backup spfile format 'D:\rmanbK\Fullbackup\spfile_%d_%s_%T_dbid%I';

      Backup current controlfile format 'D:\rmanbK\Fullbackup\Ctrl_u%u_s%s_p%p_t%t';

      release channel ch01;

      }

       

       

       

       

      1 hour

      ---------

      run {

      allocate channel c1 type disk format 'D:\rmanbK\Archive\ARCH_%d_%s_%p_%T.bkp' maxpiecesize 2g;

      backup ARCHIVELOG ALL DELETE INPUT;

      backup current controlfile;

      release channel c1;

      }

        • 1. Re: RMAN backup schedule .....
          DK2010

          Hi,

           

          increase the no. of channel for level 0 and Level 1 backup. if your machine support. 

          • 2. Re: RMAN backup schedule .....
            Rizwan Shaukat

            thnx for suggestion

             

            Run

            {

            Allocate channel ch01 type disk maxpiecesize = 2g;

            Allocate channel ch02 type disk maxpiecesize = 2g;

            Allocate channel ch03 type disk maxpiecesize = 2g;

            Backup incremental level=0 format 'D:\rmanbK\Fullbackup\bk_u%u_s%s_p%p_t%t' database;

            sql 'alter system archive log current';

            backup archivelog all delete input format 'D:\rmanbK\Archive\arch-s%s-p%p-t%t';

            backup spfile format 'D:\rmanbK\Fullbackup\spfile_%d_%s_%T_dbid%I';

            Backup current controlfile format 'D:\rmanbK\Fullbackup\Ctrl_u%u_s%s_p%p_t%t';

            release channel ch01;

            release channel ch02;

            release channel ch03;

             

             

            }

            • 3. Re: RMAN backup scripts .....
              Rajesh.Rathod

              Hi,

               

              Script looks ok. also if need to improve performance of backup i think add multiple channel equal to number of

              processor to your system and test.

              • 4. Re: RMAN backup scripts .....
                Rizwan Shaukat

                cumulative backup scripts take backup successfully... but when i recover data, it didn't include change block  ! ! !

                • 5. Re: RMAN backup schedule .....
                  nagulan.selvakumar

                  Consider enabling block change tracking feature to increase performance when going for incremental backups.

                   

                  Thank you!!

                  • 6. Re: RMAN backup scripts .....
                    Rajesh.Rathod

                    Hi,

                     

                    i think ...database can  be recovered till your incremental backup time and further you can also use cancel based recovery i.e. using "recover database using backup controlfile until cancel " to recover database till latest.

                    • 7. Re: RMAN backup scripts .....
                      nagulan.selvakumar
                      but when i recover data, it didn't include change block  ! ! !


                      Could you be more precise?


                      Thank you!!

                      • 8. Re: RMAN backup scripts .....
                        EdStevens

                        RizwanShaukat wrote:

                         

                        cumulative backup scripts take backup successfully... but when i recover data, it didn't include change block  ! ! !

                         

                        Are we to assume from this statement that you have a problem with recovering your database?

                        And are we to further assume that you need some help with said recovery?

                        If the answer to the above two questions is "yes", then you need to provide some useful information.  No one knows what condition prompted you to recover the database. No one knows what commands you issued to effect said recovery. No one knows the output of said commands. No one knows what you mean by "it didn't include change block".

                        • 9. Re: RMAN backup scripts .....
                          Rizwan Shaukat

                          Dear all,

                          I have enabled block tracking in database. the command which i used to backup is mention above as

                           

                          Full backup command:

                          Run

                          {

                          Allocate channel ch01 type disk maxpiecesize = 2g;

                          Backup incremental level=0 format 'D:\rmanbK\Fullbackup\bk_u%u_s%s_p%p_t%t' database;

                          sql 'alter system archive log current';

                          backup archivelog all delete input format 'D:\rmanbK\Archive\arch-s%s-p%p-t%t';

                          backup spfile format 'D:\rmanbK\Fullbackup\spfile_%d_%s_%T_dbid%I';

                          Backup current controlfile format 'D:\rmanbK\Fullbackup\Ctrl_u%u_s%s_p%p_t%t';

                          release channel ch01;

                          }

                           

                          create new user and new tables, insert data in tables.

                           

                          take cumulative backup

                           

                          Run

                          {

                          Allocate channel ch01 type disk maxpiecesize = 2g;

                          sql 'alter system archive log current';

                          Backup incremental level 1 cumulative database format 'D:\rmanbK\Incremental\Bk_%d_%s_%p_%T.bkp';

                          backup spfile format 'D:\rmanbK\Fullbackup\spfile_%d_%s_%T_dbid%I';

                          Backup current controlfile format 'D:\rmanbK\Fullbackup\Ctrl_u%u_s%s_p%p_t%t';

                          release channel ch01;

                          }

                           

                          database disaster occur:

                           

                          Recovery command:

                           

                          get archive log list from control file;

                           

                          e.g 98

                          run

                          {

                          allocate channel ch01 type disk;

                          set until logseq = 98 thread 1;

                          restore database;

                          recover database;

                          release channel ch01;

                          }

                           

                          but, i cant find data after level 0 backup or cumulative backup not applied.

                           

                          Regards,

                          • 10. Re: RMAN backup scripts .....
                            nagulan.selvakumar

                            Why do you specify set until clause?

                            Just do a restore and recover and check whether the changes are restored.

                             

                            Thank you!!

                            • 11. Re: RMAN backup scripts .....
                              Rizwan Shaukat

                              i just check if any archive file generated than apply on cumulative backup ............... that's why i set until

                              • 12. Re: RMAN backup scripts .....
                                Rajesh.Rathod

                                hi ,

                                 

                                - once you execute recover database comand in RMAN to apply incremenatl backup and archive log.

                                 

                                -connect database using sqlplus and execute " recover database using backup controlfile until cancel"

                                 

                                here provide required archivelog from target database and i think recovery will be done till latest i.e. User managed cancel recovery

                                 

                                Try this.

                                 

                                 

                                correct if i am wrong.

                                • 13. Re: RMAN backup scripts .....
                                  nagulan.selvakumar

                                  Did you try without until clause? What's the result?

                                  • 14. Re: RMAN backup scripts .....
                                    Rizwan Shaukat

                                    yes, i have tried without until clause .......... it works, cumulative backup applied

                                    1 2 Previous Next