1 2 Previous Next 25 Replies Latest reply on Jan 9, 2019 1:45 AM by Dude! Go to original post
      • 15. Re: Duplicate Database with additional incremental
        serandrzej

        Yes you are right I will be not able to apply subsequent incremental logs but at least I will be able to restore database for testing.

        For daily incremenatal I assume that following has to be done:

        1. Preparations:

        Rman catalog

        Startup nomount

        Rman> restore Control Files

        Rman> Restore Dartabase

        2. Every day

        Copy Incremental to destination

        # do I need archive logs as well ? I assume no.

        rman catalog

        recover database

        3. Final switch

        Copy last incremental

        backup archive logs on source

        copy last incremental and archive logs

        rman catalog

        recover database until cancel ?

        alter dataabse open restlogs

         

        Does it look good or I missed smth ? Maybe you know some sources where I can find more details about such process ?

        Thankls guys again for help.

        • 16. Re: Duplicate Database with additional incremental
          Dude!

          Yes you are right I will be not able to apply subsequent incremental logs but at least I will be able to restore database for testing.

          For daily incremenatal I assume that following has to be done:

          What are incremental logs? RMAN incremental level backups and archivelogs are both processed during the RMAN recovery phase. The later is always required to recover the database using an inconsistent backup. You cannot open an inconsistent database.

           

          1. Preparations:

          Rman catalog

          Startup nomount

          Rman> restore Control Files

          Rman> Restore Dartabase

          Restoring the controlfile is more complex depending on your configuration. And btw, you cannot restore the database in nomount mode.

           

          # do I need archive logs as well ? I assume no.

          Not unless you wish to open the database for testing, in which case you have to restore the database again to continue applying recovery data.

           

          3. Final switch

          Copy last incremental

          backup archive logs on source

          copy last incremental and archive logs

          rman catalog

          recover database until cancel ?

          alter dataabse open restlogs

          Recover database until cancel? Why switching to SQL to recovery the database?

          I suggest to stay in RMAN which is more user friendly.

           

          You can use RMAN duplicate, or otherwise restore and recover the database for testing. However, once you open the database you can no longer apply further recovery from the "original" database without restoring the original database again.

           

          Consider the following: After you recover the database using an inconsistent backup, you essentially have to open the database using resetlogs. And consequently, the database will become a new incarnation and have it's own time stamps and archivelogs, at which point incremental level backups from the "original" database will no longer match.

           

          If you need to restore and recover the database for testing and keep recovering the database using recovery data from the original database without restoring again, you need to look into "snapshot standby database" technology.

          • 17. Re: Duplicate Database with additional incremental
            Marshall Pyle

            Hi,

             

            You could add a line in your RMAN backups to switch the logfile and checkpoint, then add plus archivelog to backup database line.  This would contain everything you would need for the RMAN duplicate using both full and incremental backups.

             

            Thanks,

            Marshall

            • 18. Re: Duplicate Database with additional incremental
              serandrzej

              Hello,

              I was able to restore database, recover it and open with resetlogs. However both temp files jhave old location and when I try query DBA_TEMP_FILES I am getting error.

              In restore command I used:

              SET NEWNAME FOR TEMPFILE 1 TO '/new_location/temp.dbf';

              Any idea why temp files did not change old location to new one?

              • 19. Re: Duplicate Database with additional incremental
                Dude!

                RMAN does not backup tempfiles. You cannot restore tempfiles. Tempfiles are automatically recreated when you open the database using the location specified in the controlfile. You can however do the following, for example:

                 

                RUN

                  SET NEWNAME FOR TEMPFILE 1 TO '/newdisk/dbs/temp1.f'; 

                  SET NEWNAME FOR TEMPFILE 2 TO '/newdisk/dbs/temp2.f'; 

                  SET NEWNAME FOR TEMPFILE 3 TO NEW; #use OMF for this one

                  SWITCH TEMPFILE ALL; 

                  RESTORE DATABASE; 

                  RECOVER DATABASE; 

                  ALTER DATABASE OPEN; 

                }

                1 person found this helpful
                • 20. Re: Duplicate Database with additional incremental
                  Joerg.Sobottka

                  Dude! wrote:

                   

                  RMAN does not backup tempfiles. You cannot restore tempfiles. Tempfiles are automatically recreated when you open the database using the location specified in the controlfile. You can however do the following, for example:

                   

                  RUN

                  {

                  SET NEWNAME FOR TEMPFILE 1 TO '/newdisk/dbs/temp1.f';

                  SET NEWNAME FOR TEMPFILE 2 TO '/newdisk/dbs/temp2.f';

                  SET NEWNAME FOR TEMPFILE 3 TO NEW; #use OMF for this one

                  SWITCH TEMPFILE ALL;

                  RESTORE DATABASE;

                  RECOVER DATABASE;

                  ALTER DATABASE OPEN;

                  }

                  Or if the database is already opened: alter the temp tablespace(s) and add new tempfile(s) and drop the old ones (which are not existing). Another approach: Create a new default temporary tablespace and drop the old one.

                  • 21. Re: Duplicate Database with additional incremental
                    serandrzej

                    Thanks for this clarification. I tried to restore db yesterday and got following error:

                     

                    Oracle Error:

                    ORA-01547: warning: RECOVER succeeded but OPEN RESETLOGS would get error below

                    ORA-01194: file 1 needs more recovery to be consistent

                    ORA-01110: data file 1: '/opt/app/oracle/oradata/orcls/datafile/o1_mf_system_g2t9tnbs_.dbf'

                     

                    RMAN-06053: unable to perform media recovery because of missing log

                    RMAN-06025: no backup of archived log for thread 1 with sequence 771083 and starting SCN of 22313313957 found to restore

                    ...

                    RMAN-06025: no backup of archived log for thread 1 with sequence 771076 and starting SCN of 22313214790 found to restore

                     

                    I restored last ctrl file backup, mounted db and catalog all backups including full and all archivelogs.

                     

                    My script:

                     

                    run {

                    SET NEWNAME FOR DATAFILE 1 TO '/opt/app/oracle/oradata/orcl/datafile/o1_mf_system_g0m2r4hh_.dbf';

                    ...

                    SET NEWNAME FOR TEMPFILE 1 TO '/opt/app/oracle/oradata/orcl/temp.dbf';

                    SWITCH TEMPFILE ALL;

                     

                    SQL "ALTER DATABASE RENAME FILE ''/oradata/orcl/onlinelog/o1_mf_1_9qw6syyv_.log''

                          TO ''/opt/app/oracle/oradata/orcl/onlinelog/o1_mf_1_g0otrzsc_.log'' ";

                    ...

                     

                    RESTORE DATABASE;

                    SWITCH DATAFILE ALL;

                    RECOVER DATABASE;

                    }

                     

                    Any idea what could happen ?

                    I am currently copying new archivelogs from source, will try to catalog them and re-run recover db.

                    • 22. Re: Duplicate Database with additional incremental
                      serandrzej

                      Ok I was able to recover database every day until last saturday when another full backup triggered. Is it really the case that each full backup breaks archive logs chain and requires another initialization from full backup?

                      Last archiive log I was able to restore was last one before full backup even though I catalogged few archivelog files after new full backup.

                      • 23. Re: Duplicate Database with additional incremental
                        Joerg.Sobottka

                        No, this isn't a "normal" behavior, because my customers keep archivelogs for days or weeks, independently of any full/incremental backup, that happens. So this is something special in your backup setting. For me it sounds like the full backup maybe is doing something like an archivelog backup with "delete input"? Can you check that?

                        I don't have read all of the posts for this question, but if not, can you please add your rman configuration (Show all) and post the script you use for the full backup?

                        1 person found this helpful
                        • 24. Re: Duplicate Database with additional incremental
                          serandrzej

                          Yes this is true. I do following with full backup:

                               backup as compressed backupset incremental level=0 database;

                               delete noprompt obsolete;

                           

                          I understand now why they have been deleted. I have to replace above two commands with this one:

                          RMAN> backup as compressed backupset incremental level 0 database plus archivelog delete input;

                           

                          To be sure that I have archivelogs for continuous recover.

                          • 25. Re: Duplicate Database with additional incremental
                            Dude!

                            Please see your other thread - it's probably the same misunderstanding.

                             

                            Including the archivelogs will make it easier for you to determine what backups you have to make available on another server to restore and recover the database. Keep in mind that the metadata about archivelogs and RMAN backups are always stored in the controlfile. When you restore the controfile to restore a backup that did not include the archivelogs, RMAN may know know of archivelog backups that are required to recovery the restored database. Also keep in mind when you restore the control file from backup, RMAN will usually perform a crosscheck and remove RMAN metadata that is no longer physically available. So when you copy RMAN backups to a different location on the new server, you will have to re-catalog the information, unless you use a Fast Recovery Area (FRA).

                             

                            RMAN considers as obsolete all archived logs and backups that are not needed to recover the oldest datafile or control file backup that must be retained according to your RMAN retention policy. You can however also have an additional archivelog deletion policy that will be considered when evaluating the information.

                            1 2 Previous Next