10 Replies Latest reply: Aug 22, 2010 5:07 AM by P.Forstmann RSS

    RMAN archive logs backup and restore in RAC environment.

    MAW
      Hello All,

      I have a 8 node RAC using ASM production database and a single node standby database using ASM. I have archive log gap on the standby database and the archive logs on the primary database is backed up and removed.

      I need to resync the standby database using RMAN backup/restore.

      Could you please help me on how to backup the specific archive logs file (all threads) from production and restore/recover the standby database. Any specific RMAN script or Metalink ID will help alot.

      Details:
      ---------
      Source: 8 node RAC, ASM, Linux,
      target: Non-RAC, ASM, Linux.

      Regards,
        • 1. Re: RMAN archive logs backup and restore in RAC environment.
          BelMan
          OK
          1- Use RMAN "copy" command to copy these to a cooked filesystem on the primary cluster
          2- Scp the restored (copied) archivelogs to the standby cluster
          3- Recover (automatic) standby database and supply the scp'ed archivelog under cooked FS


          see this post for step by step soultion :)
          http://ravigaur.blogspot.com/2007/11/resync-rac-standby-database-using-asm.html
          • 2. Re: RMAN archive logs backup and restore in RAC environment.
            466593
            hello

            you would first create a RMAN backup of your primary database.
            e.g
             backup database include current controlfile for standby plus archivelog 
            then copy the backup to your standby server, prepare the standby instance and then run RMAN DUPLICATE.

            But the very first step should be to familiraize yourself with the advanced backup/recovery docs on http://tahiti.oracle.com for more information on RMAN DUPLICATE.
            • 3. Re: RMAN archive logs backup and restore in RAC environment.
              MAW
              BelMan,

              Thanks for the response. Yes, I can do that and I have tested that procedure as well. But my question is that, for example if I have 200 archive logs generated on primary, its a pain to COPY each and every archive log file to file system, scp and recover.

              What I am looking for is that, Once I have identified all the archive logs missing, How can I backup the archive logs using RMAN from for specific sequence for all the threads in RAC.

              Also how should be restore/recovery works when I have the backup above archive logs.


              Regards,
              • 4. Re: RMAN archive logs backup and restore in RAC environment.
                466593
                if you have a backup of the missing archived logs, just restore them, and the standby database should automatically go pick them up and apply them.
                • 5. Re: RMAN archive logs backup and restore in RAC environment.
                  MAW
                  Looks like my question is not clear yet!!!

                  I dont want to rebuild the DB rentirely.
                  I dont want to use COPY archive log commands,

                  I want to backup the archivelogs from all the threads using RMAN for specific archive log sequence. then I want to restore this backup on standby ad recover it.

                  In order to meet the above requirement, what could me the solution I mean the RMAN backup script to backup archivelogs from all the threads for specific sequence.

                  Regards,
                  • 6. Re: RMAN archive logs backup and restore in RAC environment.
                    P.Forstmann
                    You can try LIKE clause of BACKUP ARCHIVELOG such as:
                    RMAN> backup archivelog like '%XE%2010%20%';
                    
                    Starting backup at 20-AUG-10
                    using channel ORA_DISK_1
                    channel ORA_DISK_1: starting archive log backupset
                    channel ORA_DISK_1: specifying archive log(s) in backup set
                    input archive log thread=1 sequence=58 recid=19 stamp=727519553
                    input archive log thread=1 sequence=59 recid=20 stamp=727544121
                    input archive log thread=1 sequence=60 recid=21 stamp=727544127
                    channel ORA_DISK_1: starting piece 1 at 20-AUG-10
                    channel ORA_DISK_1: finished piece 1 at 20-AUG-10
                    piece handle=C:\ORACLEXE\APP\ORACLE\FLASH_RECOVERY_AREA\XE\BACKUPSET\2010_08_20\
                    O1_MF_ANNNN_TAG20100820T154401_66X1O353_.BKP tag=TAG20100820T154401 comment=NONE
                    
                    channel ORA_DISK_1: backup set complete, elapsed time: 00:00:04
                    Finished backup at 20-AUG-10
                    or you can try SEQUENCE clause:
                    RMAN> backup archivelog sequence between 58 and 60 thread 1;
                    
                    Starting backup at 20-AUG-10
                    using channel ORA_DISK_1
                    channel ORA_DISK_1: starting archive log backupset
                    channel ORA_DISK_1: specifying archive log(s) in backup set
                    input archive log thread=1 sequence=58 recid=19 stamp=727519553
                    input archive log thread=1 sequence=59 recid=20 stamp=727544121
                    input archive log thread=1 sequence=60 recid=21 stamp=727544127
                    channel ORA_DISK_1: starting piece 1 at 20-AUG-10
                    channel ORA_DISK_1: finished piece 1 at 20-AUG-10
                    piece handle=C:\ORACLEXE\APP\ORACLE\FLASH_RECOVERY_AREA\XE\BACKUPSET\2010_08_20\
                    O1_MF_ANNNN_TAG20100820T154911_66X1YRJL_.BKP tag=TAG20100820T154911 comment=NONE
                    
                    channel ORA_DISK_1: backup set complete, elapsed time: 00:00:04
                    Finished backup at 20-AUG-10
                    or
                    RMAN> backup archivelog sequence between 58 and 60;
                    
                    Starting backup at 20-AUG-10
                    using channel ORA_DISK_1
                    channel ORA_DISK_1: starting archive log backupset
                    channel ORA_DISK_1: specifying archive log(s) in backup set
                    input archive log thread=1 sequence=58 recid=19 stamp=727519553
                    input archive log thread=1 sequence=59 recid=20 stamp=727544121
                    input archive log thread=1 sequence=60 recid=21 stamp=727544127
                    channel ORA_DISK_1: starting piece 1 at 20-AUG-10
                    channel ORA_DISK_1: finished piece 1 at 20-AUG-10
                    piece handle=C:\ORACLEXE\APP\ORACLE\FLASH_RECOVERY_AREA\XE\BACKUPSET\2010_08_20\
                    O1_MF_ANNNN_TAG20100820T154748_66X1W5Z0_.BKP tag=TAG20100820T154748 comment=NONE
                    
                    channel ORA_DISK_1: backup set complete, elapsed time: 00:00:04
                    Finished backup at 20-AUG-10
                    See http://download.oracle.com/docs/cd/B19306_01/backup.102/b14194/rcmsynta008.htm#i78730
                    • 7. Re: RMAN archive logs backup and restore in RAC environment.
                      MAW
                      Forstmann,

                      I like your second method in fact looking for something like that. but I have only more concern, I am wondering if there is a possibility to backup the archive logs from all the threads ( I have 8 threads)? In your example 2, it is backing u archive logs for a specific sequence in thread 1.

                      Also once I have the backup, how can I recover my standby database using the backup method 2 from your reply.

                      Thanks you so much Forstmann.

                      Regards,
                      • 8. Re: RMAN archive logs backup and restore in RAC environment.
                        P.Forstmann
                        But if your archived redo logs are no more on disk on primary database I think you need to restore them on disk and not to back them up.
                        You can try to restore them on primary server for each instance/thread:
                        RMAN> restore archivelog sequence between 34 and 47 thread 1;
                        
                        Starting restore at 20-AUG-10
                        using channel ORA_DISK_1
                        
                        archive log thread 1 sequence 42 is already on disk as file /u02/fra/RAC/archivelog/2010_08_20/o1_mf_1_42_66x9rzc9_.arc
                        archive log thread 1 sequence 43 is already on disk as file /u02/fra/RAC/archivelog/2010_08_20/o1_mf_1_43_66x9s189_.arc
                        archive log thread 1 sequence 44 is already on disk as file /u02/fra/RAC/archivelog/2010_08_20/o1_mf_1_44_66x9s35y_.arc
                        archive log thread 1 sequence 45 is already on disk as file /u02/fra/RAC/archivelog/2010_08_20/o1_mf_1_45_66x9s5jm_.arc
                        archive log thread 1 sequence 46 is already on disk as file /u02/fra/RAC/archivelog/2010_08_20/o1_mf_1_46_66x9ynlh_.arc
                        archive log thread 1 sequence 47 is already on disk as file /u02/fra/RAC/archivelog/2010_08_20/o1_mf_1_47_66xb4b8v_.arc
                        channel ORA_DISK_1: starting archive log restore to default destination
                        channel ORA_DISK_1: restoring archive log
                        archive log thread=1 sequence=34
                        channel ORA_DISK_1: restoring archive log
                        archive log thread=1 sequence=35
                        channel ORA_DISK_1: restoring archive log
                        archive log thread=1 sequence=36
                        channel ORA_DISK_1: restoring archive log
                        archive log thread=1 sequence=37
                        channel ORA_DISK_1: restoring archive log
                        archive log thread=1 sequence=38
                        channel ORA_DISK_1: restoring archive log
                        archive log thread=1 sequence=39
                        channel ORA_DISK_1: restoring archive log
                        archive log thread=1 sequence=40
                        channel ORA_DISK_1: restoring archive log
                        archive log thread=1 sequence=41
                        channel ORA_DISK_1: reading from backup piece /u02/fra/RAC/backupset/2010_08_07/o1_mf_annnn_TAG20100807T221626_65vhs3on_.bkp
                        channel ORA_DISK_1: restored backup piece 1
                        piece handle=/u02/fra/RAC/backupset/2010_08_07/o1_mf_annnn_TAG20100807T221626_65vhs3on_.bkp tag=TAG20100807T221626
                        channel ORA_DISK_1: restore complete, elapsed time: 00:00:16
                        Finished restore at 20-AUG-10
                        Then FAL should try to resolve the gap:
                        http://download.oracle.com/docs/cd/B19306_01/server.102/b14239/log_transport.htm#i1268316

                        Edited by: P. Forstmann on 20 août 2010 18:35
                        • 9. Re: RMAN archive logs backup and restore in RAC environment.
                          MAW
                          Correct I need to restore them on primary first. But I have set the log_archive_dest_state_2=defer as I am going to upgrade the standby database.

                          So for this I need to backup store the archive logs on primary, backup the archive logs on primary and restore/recover on standby database and finally upgrade it.

                          Also while restoring the archive logs can I specify other locations on disk to restore archive logs? Because I am using ASM and flash recovery area.

                          Thanks a lot Forstmann
                          • 10. Re: RMAN archive logs backup and restore in RAC environment.
                            P.Forstmann
                            You can try SET ARCHIVELOG DESTINATION in a RUN block:
                            RMAN> run {
                            2> set archivelog destination to '/tmp';
                            3> restore archivelog sequence between 20 and 30 thread 1;
                            4> }
                            
                            executing command: SET ARCHIVELOG DESTINATION
                            
                            Starting restore at 22-AUG-10
                            using channel ORA_DISK_1
                            
                            channel ORA_DISK_1: starting archive log restore to user-specified destination
                            archive log destination=/tmp
                            channel ORA_DISK_1: restoring archive log
                            archive log thread=1 sequence=21
                            channel ORA_DISK_1: restoring archive log
                            archive log thread=1 sequence=22
                            channel ORA_DISK_1: restoring archive log
                            archive log thread=1 sequence=23
                            channel ORA_DISK_1: restoring archive log
                            archive log thread=1 sequence=24
                            channel ORA_DISK_1: restoring archive log
                            archive log thread=1 sequence=25
                            channel ORA_DISK_1: restoring archive log
                            archive log thread=1 sequence=26
                            channel ORA_DISK_1: restoring archive log
                            archive log thread=1 sequence=27
                            channel ORA_DISK_1: restoring archive log
                            archive log thread=1 sequence=28
                            channel ORA_DISK_1: restoring archive log
                            archive log thread=1 sequence=29
                            channel ORA_DISK_1: restoring archive log
                            archive log thread=1 sequence=30
                            channel ORA_DISK_1: reading from backup piece /u02/fra/RAC/backupset/2010_08_07/o1_mf_annnn_TAG20100807T221626_65vhs3on_.bkp
                            channel ORA_DISK_1: restored backup piece 1
                            piece handle=/u02/fra/RAC/backupset/2010_08_07/o1_mf_annnn_TAG20100807T221626_65vhs3on_.bkp tag=TAG20100807T221626
                            channel ORA_DISK_1: restore complete, elapsed time: 00:00:16
                            Finished restore at 22-AUG-10
                            See http://download.oracle.com/docs/cd/B19306_01/backup.102/b14192/recov004.htm#sthref593