1 2 Previous Next 16 Replies Latest reply: Sep 15, 2009 9:59 AM by hemant k chitale-2034252 RSS

    Duplicating database - archivelogs

    jdi
      Hi
      Version 10.2.0.3

      I am trying to duplicate an existing database running on archivelog mode.I copied the control file from the source server at 11am to the destination server(backupset and archivelogs as well) and started restoring the database. There have been archivelogs after 11am . If I need to restore the duplicated database till the time the recovery ended say at 3:00pm, what do I need to do? If I copy the archivelogs which are created after 11am to the duplicate server will the rman apply those logs or do I need to catalog those? Please help.

      thanks
        • 1. Re: Duplicating database - archivelogs
          Hemant K Chitale
          It depends on how you are doing the duplication.

          If you've used RMAN's DUPLICATE DATABASE command, it has started with the SEQ#/SCN already known as the Recovery Point.


          If you are manually doing a RECOVER DATABASE with RMAN, a default RECOVER DATABASE would halt and open resetlogs at the last available archivelog.

          If you are using the SQL command RECOVER DATABASE USING BACKUP CONTROLFILE UNTIL CANCEL; then you can "pause" (even CANCEL) the recovery while you copy over the new archivelogs and then resume the recovery with the same command.

          Hemant K Chitale
          http://hemantoracledba.blogspot.com
          • 2. Re: Duplicating database - archivelogs
            jdi
            Thanks hemath. Actually I need to migrate the server to a new one. So if I do a recover database (control file is from 11am) then the archivelogs until 11am will be applied or oracle will check all the archivelogs in the archive directory and apply them all say if I copied. Please let me know.

            Thanks
            • 3. Re: Duplicating database - archivelogs
              orawarebyte
              If I copy the archivelogs which are created after 11am to the duplicate server will the rman apply those logs or do I need to catalog those? Please help.

              If you are using FRA (Flash recovery area) then RMAN itself catalog the archivelogs whcih created after 11 am ,provided you moved that archivelog from source server to target server FRA (Flash recovery area).If you are not using FRA then controlfile will not aware it by this archivelog which RMAN do it with FRA (i.e cataloged) if you are at non FRA then you will have to catalog it explicitly.

              Read that link where is demo specified using FRA for the question
              but control file is older it doesnt store the info of new archivelogs.How can I add?
              http://oraware.blogspot.com/2008/05/recovery-with-old-controlfilerecover.html
              Khurram
              • 4. Re: Duplicating database - archivelogs
                Hemant K Chitale
                As Khurram has pointed out, if your're using an FRA and the archivelogs have been copied into the FRA on the new server, RMAN will automatically catalog them when doing the RESTORE DATABASE itself. Therefore RECOVER will use them (interesting question : what happens if you copy in new archivelogs after the RESTORE DATABASE has begun, does RMAN re-discover them during the RECOVER ?)


                However, if you are not using an FRA but are using log_archive_dest_1, RMAN still reads the archivelogs from this destination directory during the RECOVER command ! It just doesn't know when to stop. You will have to manually OPEN RESETLOGS after RMAN errors after after reading the last available archivelog.

                If you are using SQLPlus, it can read on the basis of log_archive_dest_1 OR even with the FROM syntax in the RECOVER DATABASE command. IF you do this in Interactive mode, you can CANCEL at any time, go away for tea or dinner and return and restart with another RECOVER DATABASE USING BACKUP CONTROLFILE UNTIL CANCEL; Similarly, you can copy in new archivelogs and restart the recovery.


                Hemant K Chitale
                http://hemantoracledba.blogspot.com
                • 5. Re: Duplicating database - archivelogs
                  jdi
                  Thanks for all your replies. I shutdown the source database at 11am copied the controlfiles over to new server and copied the backupset which I took two days before and all the archivelogs for past 4 days to current archivelog. I restored the db and trying to recover it shows that it's going to recover till 11am and not till current archivelogs. It is in the process of recovery so not sure it will read the archivelog files created after 11am. I am not using FRA. I am not clear about this. could you please explain me this. I want to make the db apply all the archive logs till now and open the db.

                  thanks
                  • 6. Re: Duplicating database - archivelogs
                    orawarebyte
                    If you are not using FRA (Flash recovery area) then RMAN will not catalog itself archivelog files created after 11am during recovery process, in this case when you are not using FRA then you will have to catalog those archivelog created after 11 am e.g
                    RMAN>catalog archivelog '/disk1/arch_logs/archive1_731.dbf','/disk1/arch_logs/archive1_732.dbf';
                    After cataloging those archivelog start recovery.

                    If you are using FRA then during recovery process RMAN will itself does catalog for you which you do as above by using catalog command.

                    Khurram
                    • 7. Re: Duplicating database - archivelogs
                      jdi
                      Thanks, I cataloged the archivelogs and did recover database and it recovered till a point of archive log and it was giving error that it could not recover the online redo log files. Then I tried to open the database with alter database open resetlogs option and got the following error. I tried to open the database and I got an error that systemdb1.dbf file needs recovery. I could not use recover database until cancel in the rman prompt as it could not recognised the command.

                      Error during end of the recover database command:

                      Errors in file /opt/oracle/admin/hoday/udump/hoday_ora_6162.trc:
                      ORA-00313: open failed for members of log group 1 of thread 1
                      ORA-00312: online log 1 thread 1: '/opt/oracle/oradata/hoday/redo_b/redo_01.log'
                      ORA-27037: unable to obtain file status
                      Linux-x86_64 Error: 2: No such file or directory
                      Additional information: 3
                      ORA-00312: online log 1 thread 1: '/opt/oracle/oradata/hoday/redo_a/redo_01.log'
                      ORA-27037: unable to obtain file status
                      Linux-x86_64 Error: 2: No such file or directory
                      Additional information: 3
                      Fri Sep 11 13:15:52 2009
                      Media Recovery failed with error 313

                      Error while opening the database with resetlogs
                      ORA-01139: RESETLOGS option only valid after an incomplete database recovery

                      Edited by: APV on Sep 11, 2009 12:46 PM
                      • 8. Re: Duplicating database - archivelogs
                        19426
                        recover database until cancel ...
                        But it works in sqlplus. Leave RMAN and start sqlplus.


                        Werner
                        • 9. Re: Duplicating database - archivelogs
                          jdi
                          Thanks for the input. Will I be able to issue recover database until cancel after I tried recover database and applied all the redologs and got to a point where the rman could not find the online redo logs in the new server.
                          • 10. Re: Duplicating database - archivelogs
                            19426
                            Assuming the database is consistent after applying the last available archivelog (i.e. nothing in the online logs is needed for recovery), a 'fake' incomplete recovery is needed to generate a new set of online redologs. I guess you also use a backup controlfile, so this fake recovery is done by
                            'recover database using backup controlfile until cancel;' Since the requested online is neither needed nor available, 'cancel' will immediately stop the recovery and 'alter database open resetlogs;' will succeed.

                            Werner
                            • 11. Re: Duplicating database - archivelogs
                              Hemant K Chitale
                              As you will see in this example below :

                              1. At the RESTORE DATABASE command, RMAN automatically catalogs all files it finds in the FRA. In this case, I had only a controlfile autobackup , but had I had ArchiveLogs in the FRA, they would have been cataloged.

                              2. At the RECOVER DATABASE command, RMAN identifies ArchiveLogs -- it identified Log Sequence#8 from the available BackupSet whle it identifies Sequence#9 to #15 from /tmp {Just before the Restore, I switched my log_archive_dest_1 to /tmp).  This is the second case I was describing -- where you don't use FRA and your ArchiveLogs are not in the backup -- e.g. copied in from the source server to the new server *after* the backup and restore of Backupsets

                              3. I use SQLPLUS to OPEN RESETLOGS.

                              [code]
                              ora10204>pwd
                              /oracle_fs/Databases/ORT24FS
                              ora10204>rm
                              ora10204>ls
                              control01.ctl control03.ctl redo01.dbf redo03.dbf system01.dbf undotbs01.dbf
                              control02.ctl example01.dbf redo02.dbf sysaux01.dbf temp01.dbf users01.dbf
                              ora10204>rm *
                              ora10204>rman target /

                              Recovery Manager: Release 10.2.0.4.0 - Production on Fri Sep 11 23:55:28 2009

                              Copyright (c) 1982, 2007, Oracle. All rights reserved.

                              connected to target database (not started)

                              RMAN> startup nomount;

                              Oracle instance started

                              Total System Global Area 880803840 bytes

                              Fixed Size 2087992 bytes
                              Variable Size 197133256 bytes
                              Database Buffers 675282944 bytes
                              Redo Buffers 6299648 bytes

                              RMAN> restore controlfile from autobackup;

                              Starting restore at 11-SEP-09
                              using target database control file instead of recovery catalog
                              allocated channel: ORA_DISK_1
                              channel ORA_DISK_1: sid=156 devtype=DISK

                              recovery area destination: /oracle_fs/FRAs/ORT24FS
                              database name (or database unique name) used for search: ORT24FS
                              channel ORA_DISK_1: autobackup found in the recovery area
                              channel ORA_DISK_1: autobackup found: /oracle_fs/FRAs/ORT24FS/ORT24FS/autobackup/2009_09_11/o1_mf_s_697333824_5bnwg0x5_.bkp
                              channel ORA_DISK_1: control file restore from autobackup complete
                              output filename=/oracle_fs/Databases/ORT24FS/control01.ctl
                              output filename=/oracle_fs/Databases/ORT24FS/control02.ctl
                              output filename=/oracle_fs/Databases/ORT24FS/control03.ctl
                              Finished restore at 11-SEP-09

                              RMAN> sql 'alter database mount';

                              sql statement: alter database mount
                              released channel: ORA_DISK_1

                              RMAN>
                              RMAN> restore database;

                              Starting restore at 11-SEP-09
                              Starting implicit crosscheck backup at 11-SEP-09
                              allocated channel: ORA_DISK_1
                              channel ORA_DISK_1: sid=156 devtype=DISK
                              allocated channel: ORA_DISK_2
                              channel ORA_DISK_2: sid=155 devtype=DISK
                              Crosschecked 43 objects
                              Finished implicit crosscheck backup at 11-SEP-09

                              Starting implicit crosscheck copy at 11-SEP-09
                              using channel ORA_DISK_1
                              using channel ORA_DISK_2
                              Crosschecked 5 objects
                              Finished implicit crosscheck copy at 11-SEP-09

                              searching for all files in the recovery area
                              cataloging files...
                              cataloging done

                              List of Cataloged Files
                              =======================
                              File Name: /oracle_fs/FRAs/ORT24FS/ORT24FS/autobackup/2009_09_11/o1_mf_s_697333824_5bnwg0x5_.bkp

                              using channel ORA_DISK_1
                              using channel ORA_DISK_2

                              channel ORA_DISK_1: starting datafile backupset restore
                              channel ORA_DISK_1: specifying datafile(s) to restore from backup set
                              restoring datafile 00001 to /oracle_fs/Databases/ORT24FS/system01.dbf
                              restoring datafile 00005 to /oracle_fs/Databases/ORT24FS/example01.dbf
                              channel ORA_DISK_1: reading from backup piece /oracle_fs/FRAs/ORT24FS/ORT24FS/backupset/2009_09_11/o1_mf_nnndf_TAG20090911T234851_5bnwc559_.bkp
                              channel ORA_DISK_2: starting datafile backupset restore
                              channel ORA_DISK_2: specifying datafile(s) to restore from backup set
                              restoring datafile 00002 to /oracle_fs/Databases/ORT24FS/undotbs01.dbf
                              restoring datafile 00003 to /oracle_fs/Databases/ORT24FS/sysaux01.dbf
                              restoring datafile 00004 to /oracle_fs/Databases/ORT24FS/users01.dbf
                              channel ORA_DISK_2: reading from backup piece /oracle_fs/FRAs/ORT24FS/ORT24FS/backupset/2009_09_11/o1_mf_nnndf_TAG20090911T234851_5bnwcl7o_.bkp
                              channel ORA_DISK_2: restored backup piece 1
                              piece handle=/oracle_fs/FRAs/ORT24FS/ORT24FS/backupset/2009_09_11/o1_mf_nnndf_TAG20090911T234851_5bnwcl7o_.bkp tag=TAG20090911T234851
                              channel ORA_DISK_2: restore complete, elapsed time: 00:00:45
                              channel ORA_DISK_1: restored backup piece 1
                              piece handle=/oracle_fs/FRAs/ORT24FS/ORT24FS/backupset/2009_09_11/o1_mf_nnndf_TAG20090911T234851_5bnwc559_.bkp tag=TAG20090911T234851
                              channel ORA_DISK_1: restore complete, elapsed time: 00:00:52
                              Finished restore at 11-SEP-09

                              RMAN>
                              RMAN> recover database;

                              Starting recover at 11-SEP-09
                              using channel ORA_DISK_1
                              using channel ORA_DISK_2

                              starting media recovery

                              channel ORA_DISK_1: starting archive log restore to default destination
                              channel ORA_DISK_1: restoring archive log
                              archive log thread=1 sequence=8
                              channel ORA_DISK_1: reading from backup piece /oracle_fs/FRAs/ORT24FS/ORT24FS/backupset/2009_09_11/o1_mf_annnn_TAG20090911T235022_5bnwfz8t_.bkp
                              channel ORA_DISK_1: restored backup piece 1
                              piece handle=/oracle_fs/FRAs/ORT24FS/ORT24FS/backupset/2009_09_11/o1_mf_annnn_TAG20090911T235022_5bnwfz8t_.bkp tag=TAG20090911T235022
                              channel ORA_DISK_1: restore complete, elapsed time: 00:00:01
                              archive log filename=/tmp/1_8_697248881.dbf thread=1 sequence=8
                              archive log filename=/tmp/1_9_697248881.dbf thread=1 sequence=9
                              archive log filename=/tmp/1_10_697248881.dbf thread=1 sequence=10
                              archive log filename=/tmp/1_11_697248881.dbf thread=1 sequence=11
                              archive log filename=/tmp/1_12_697248881.dbf thread=1 sequence=12
                              archive log filename=/tmp/1_13_697248881.dbf thread=1 sequence=13
                              archive log filename=/tmp/1_14_697248881.dbf thread=1 sequence=14
                              archive log filename=/tmp/1_15_697248881.dbf thread=1 sequence=15
                              archive log filename=/tmp/1_15_697248881.dbf thread=1 sequence=16
                              RMAN-00571: ===========================================================
                              RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
                              RMAN-00571: ===========================================================
                              RMAN-03002: failure of recover command at 09/11/2009 23:58:40
                              RMAN-11003: failure during parse/execution of SQL statement: alter database recover logfile '/tmp/1_15_697248881.dbf'
                              ORA-00310: archived log contains sequence 15; sequence 16 required
                              ORA-00334: archived log: '/tmp/1_15_697248881.dbf'

                              RMAN>
                              RMAN> exit


                              Recovery Manager complete.
                              ora10204>sqlplus '/ as sysdba'

                              SQL*Plus: Release 10.2.0.4.0 - Production on Fri Sep 11 23:59:20 2009

                              Copyright (c) 1982, 2007, Oracle. All Rights Reserved.


                              Connected to:
                              Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit Production
                              With the Partitioning, OLAP, Data Mining and Real Application Testing options

                              SQL> alter database open resetlogs;

                              Database altered.

                              SQL>


                              (Note the bug in how RMAN attempts to identifiy the log sequence#15 file in /tmp twice, once as Seq#15 and again as Seq#16 -- this happens with the last file present.)


                              The RECOVER writes these messages in the alert.log : (Note how it automatically decided to use "until cancel using backup controlfile")
                              Fri Sep 11 23:58:07 2009
                              alter database recover datafile list clear
                              Fri Sep 11 23:58:07 2009
                              Completed: alter database recover datafile list clear
                              Fri Sep 11 23:58:07 2009
                              alter database recover datafile list
                               1 , 2 , 3 , 4 , 5
                              Completed: alter database recover datafile list
                               1 , 2 , 3 , 4 , 5
                              Fri Sep 11 23:58:07 2009
                              alter database recover if needed
                               start until cancel using backup controlfile
                              Media Recovery Start
                               parallel recovery started with 2 processes
                              ORA-279 signalled during: alter database recover if needed
                               start until cancel using backup controlfile
                              ...
                              Fri Sep 11 23:58:08 2009
                              Archivelog restore complete. Elapsed time: 0:00:00
                              Fri Sep 11 23:58:09 2009
                              alter database recover logfile '/tmp/1_8_697248881.dbf'
                              Fri Sep 11 23:58:09 2009
                              Media Recovery Log /tmp/1_8_697248881.dbf
                              ORA-279 signalled during: alter database recover logfile '/tmp/1_8_697248881.dbf'...
                              Fri Sep 11 23:58:09 2009
                              alter database recover logfile '/tmp/1_9_697248881.dbf'
                              Fri Sep 11 23:58:09 2009
                              Media Recovery Log /tmp/1_9_697248881.dbf
                              ORA-279 signalled during: alter database recover logfile '/tmp/1_9_697248881.dbf'...
                              Fri Sep 11 23:58:09 2009
                              alter database recover logfile '/tmp/1_10_697248881.dbf'
                              Fri Sep 11 23:58:09 2009
                              Media Recovery Log /tmp/1_10_697248881.dbf
                              ...... until .....
                              Fri Sep 11 23:58:39 2009
                              alter database recover logfile '/tmp/1_15_697248881.dbf'
                              Fri Sep 11 23:58:39 2009
                              Media Recovery Log /tmp/1_15_697248881.dbf
                              ORA-279 signalled during: alter database recover logfile '/tmp/1_15_697248881.dbf'...
                              Fri Sep 11 23:58:40 2009
                              alter database recover logfile '/tmp/1_15_697248881.dbf'
                              Fri Sep 11 23:58:40 2009
                              Media Recovery Log /tmp/1_15_697248881.dbf
                              Errors with log /tmp/1_15_697248881.dbf
                              ORA-310 signalled during: alter database recover logfile '/tmp/1_15_697248881.dbf'...
                              Fri Sep 11 23:58:40 2009
                              alter database recover cancel
                              Fri Sep 11 23:58:40 2009
                              Media Recovery Canceled
                              Completed: alter database recover cancel
                              while the OPEN RESETLOGS wrote :
                              Fri Sep 11 23:59:27 2009
                              alter database open resetlogs
                              Fri Sep 11 23:59:27 2009
                              Errors in file /oracle_fs/ora10204/admin/ORT24FS/udump/ort24fs_ora_4450.trc:
                              ORA-00313: open failed for members of log group 1 of thread 1
                              ORA-00312: online log 1 thread 1: '/oracle_fs/Databases/ORT24FS/redo01.dbf'
                              ORA-27037: unable to obtain file status
                              Linux-x86_64 Error: 2: No such file or directory
                              Additional information: 3
                              Fri Sep 11 23:59:27 2009
                              Errors in file /oracle_fs/ora10204/admin/ORT24FS/udump/ort24fs_ora_4450.trc:
                              ORA-00313: open failed for members of log group 1 of thread 1
                              ORA-00312: online log 1 thread 1: '/oracle_fs/Databases/ORT24FS/redo01.dbf'
                              ORA-27037: unable to obtain file status
                              Linux-x86_64 Error: 2: No such file or directory
                              .... until ....
                              RESETLOGS after incomplete recovery UNTIL CHANGE 2223560
                              Resetting resetlogs activation ID 4177063366 (0xf8f8edc6)
                              Fri Sep 11 23:59:27 2009
                              Errors in file /oracle_fs/ora10204/admin/ORT24FS/udump/ort24fs_ora_4450.trc:
                              ORA-00313: open failed for members of log group 1 of thread 1
                              ORA-00312: online log 1 thread 1: '/oracle_fs/Databases/ORT24FS/redo01.dbf'
                              ORA-27037: unable to obtain file status
                              Linux-x86_64 Error: 2: No such file or directory
                              Additional information: 3
                              Fri Sep 11 23:59:30 2009
                              Errors in file /oracle_fs/ora10204/admin/ORT24FS/udump/ort24fs_ora_4450.trc:
                              ORA-00313: open failed for members of log group 2 of thread 1
                              ORA-00312: online log 2 thread 1: '/oracle_fs/Databases/ORT24FS/redo02.dbf'
                              ORA-27037: unable to obtain file status
                              Linux-x86_64 Error: 2: No such file or directory
                              Additional information: 3
                              Fri Sep 11 23:59:32 2009
                              Errors in file /oracle_fs/ora10204/admin/ORT24FS/udump/ort24fs_ora_4450.trc:
                              ORA-00313: open failed for members of log group 3 of thread 1
                              ORA-00312: online log 3 thread 1: '/oracle_fs/Databases/ORT24FS/redo03.dbf'
                              ORA-27037: unable to obtain file status
                              Linux-x86_64 Error: 2: No such file or directory
                              Additional information: 3
                              Fri Sep 11 23:59:34 2009
                              Setting recovery target incarnation to 13
                              Fri Sep 11 23:59:34 2009
                              Assigning activation ID 4177154000 (0xf8fa4fd0)
                              LGWR: STARTING ARCH PROCESSES
                              ARC0 started with pid=16, OS id=4452
                              Fri Sep 11 23:59:34 2009
                              ARC0: Archival started
                              ARC1: Archival started
                              LGWR: STARTING ARCH PROCESSES COMPLETE
                              ... and so on ....
                              Hemant K Chitale
                              http://hemantoracledba.blogspot.com
                              • 12. Re: Duplicating database - archivelogs
                                ebrian
                                The whole process can actually be performed in RMAN. With 10.2.01, you'll have to CATALOG the archive logs, whereas with 10.2.0.4, RMAN will do it automatically with the first RECOVER DATABASE command.
                                RMAN> backup database plus archivelog;
                                
                                Starting backup at 14-SEP-09
                                current log archived
                                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=19 recid=710 stamp=697591813
                                channel ORA_DISK_1: starting piece 1 at 14-SEP-09
                                channel ORA_DISK_1: finished piece 1 at 14-SEP-09
                                piece handle=/oracle/flash_recovery_area/ORA10G/backupset/2009_09_14/o1_mf_annnn_TAG20090914T233013_5by2l74s_.bkp tag=TAG20090914T233013 comment=NONE
                                channel ORA_DISK_1: backup set complete, elapsed time: 00:00:02
                                Finished backup at 14-SEP-09
                                
                                Starting backup at 14-SEP-09
                                using channel ORA_DISK_1
                                channel ORA_DISK_1: starting full datafile backupset
                                channel ORA_DISK_1: specifying datafile(s) in backupset
                                input datafile fno=00001 name=/oracle/oradata/ora10g/system01.dbf
                                input datafile fno=00002 name=/oracle/oradata/ora10g/undotbs01.dbf
                                input datafile fno=00003 name=/oracle/oradata/ora10g/sysaux01.dbf
                                input datafile fno=00004 name=/oracle/oradata/ora10g/users01.dbf
                                channel ORA_DISK_1: starting piece 1 at 14-SEP-09
                                channel ORA_DISK_1: finished piece 1 at 14-SEP-09
                                piece handle=/oracle/flash_recovery_area/ORA10G/backupset/2009_09_14/o1_mf_nnndf_TAG20090914T233016_5by2l8z6_.bkp tag=TAG20090914T233016 comment=NONE
                                channel ORA_DISK_1: backup set complete, elapsed time: 00:01:25
                                Finished backup at 14-SEP-09
                                
                                Starting backup at 14-SEP-09
                                current log archived
                                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=20 recid=711 stamp=697591901
                                channel ORA_DISK_1: starting piece 1 at 14-SEP-09
                                channel ORA_DISK_1: finished piece 1 at 14-SEP-09
                                piece handle=/oracle/flash_recovery_area/ORA10G/backupset/2009_09_14/o1_mf_annnn_TAG20090914T233141_5by2nyy4_.bkp tag=TAG20090914T233141 comment=NONE
                                channel ORA_DISK_1: backup set complete, elapsed time: 00:00:02
                                Finished backup at 14-SEP-09
                                
                                Starting Control File and SPFILE Autobackup at 14-SEP-09
                                piece handle=/oracle/flash_recovery_area/ORA10G/autobackup/2009_09_14/o1_mf_s_697591904_5by2o0m1_.bkp comment=NONE
                                Finished Control File and SPFILE Autobackup at 14-SEP-09
                                
                                RMAN> sql 'alter system archive log current';
                                
                                sql statement: alter system archive log current
                                
                                RMAN> sql 'alter system archive log current';
                                
                                sql statement: alter system archive log current
                                
                                RMAN> sql 'alter system archive log current';
                                
                                sql statement: alter system archive log current
                                
                                RMAN> shutdown abort
                                
                                Oracle instance shut down
                                
                                RMAN> exit
                                
                                
                                Recovery Manager complete.
                                [oracle@delllinux2 ~]$ rm /oracle/oradata/ora10g/*
                                [oracle@delllinux2 ~]$ mv /oracle/archive/* /tmp
                                [oracle@delllinux2 ~]$ rman target /
                                
                                Recovery Manager: Release 10.2.0.4.0 - Production on Mon Sep 14 23:34:06 2009
                                
                                Copyright (c) 1982, 2007, Oracle.  All rights reserved.
                                
                                connected to target database (not started)
                                
                                RMAN> startup nomount
                                
                                Oracle instance started
                                
                                Total System Global Area     167772160 bytes
                                
                                Fixed Size                     1266392 bytes
                                Variable Size                109055272 bytes
                                Database Buffers              54525952 bytes
                                Redo Buffers                   2924544 bytes
                                
                                RMAN> restore controlfile from autobackup;
                                
                                Starting restore at 14-SEP-09
                                using target database control file instead of recovery catalog
                                allocated channel: ORA_DISK_1
                                channel ORA_DISK_1: sid=156 devtype=DISK
                                
                                recovery area destination: /oracle/flash_recovery_area
                                database name (or database unique name) used for search: ORA10G
                                channel ORA_DISK_1: autobackup found in the recovery area
                                channel ORA_DISK_1: autobackup found: /oracle/flash_recovery_area/ORA10G/autobackup/2009_09_14/o1_mf_s_697591904_5by2o0m1_.bkp
                                channel ORA_DISK_1: control file restore from autobackup complete
                                output filename=/oracle/oradata/ora10g/control01.ctl
                                output filename=/oracle/oradata/ora10g/control02.ctl
                                output filename=/oracle/oradata/ora10g/control03.ctl
                                Finished restore at 14-SEP-09
                                
                                RMAN> alter database mount;
                                
                                database mounted
                                released channel: ORA_DISK_1
                                
                                RMAN> sql "alter system set log_archive_dest_1=''location=/tmp''";
                                
                                sql statement: alter system set log_archive_dest_1=''location=/tmp''
                                
                                RMAN> restore database;
                                
                                Starting restore at 14-SEP-09
                                Starting implicit crosscheck backup at 14-SEP-09
                                allocated channel: ORA_DISK_1
                                channel ORA_DISK_1: sid=156 devtype=DISK
                                Crosschecked 3 objects
                                Finished implicit crosscheck backup at 14-SEP-09
                                
                                Starting implicit crosscheck copy at 14-SEP-09
                                using channel ORA_DISK_1
                                Finished implicit crosscheck copy at 14-SEP-09
                                
                                searching for all files in the recovery area
                                cataloging files...
                                cataloging done
                                
                                List of Cataloged Files
                                =======================
                                File Name: /oracle/flash_recovery_area/ORA10G/autobackup/2009_09_14/o1_mf_s_697591904_5by2o0m1_.bkp
                                
                                using channel ORA_DISK_1
                                
                                channel ORA_DISK_1: starting datafile backupset restore
                                channel ORA_DISK_1: specifying datafile(s) to restore from backup set
                                restoring datafile 00001 to /oracle/oradata/ora10g/system01.dbf
                                restoring datafile 00002 to /oracle/oradata/ora10g/undotbs01.dbf
                                restoring datafile 00003 to /oracle/oradata/ora10g/sysaux01.dbf
                                restoring datafile 00004 to /oracle/oradata/ora10g/users01.dbf
                                channel ORA_DISK_1: reading from backup piece /oracle/flash_recovery_area/ORA10G/backupset/2009_09_14/o1_mf_nnndf_TAG20090914T233016_5by2l8z6_.bkp
                                channel ORA_DISK_1: restored backup piece 1
                                piece handle=/oracle/flash_recovery_area/ORA10G/backupset/2009_09_14/o1_mf_nnndf_TAG20090914T233016_5by2l8z6_.bkp tag=TAG20090914T233016
                                channel ORA_DISK_1: restore complete, elapsed time: 00:01:15
                                Finished restore at 14-SEP-09
                                
                                RMAN> recover database;
                                
                                Starting recover at 14-SEP-09
                                using channel ORA_DISK_1
                                
                                starting media recovery
                                
                                channel ORA_DISK_1: starting archive log restore to default destination
                                channel ORA_DISK_1: restoring archive log
                                archive log thread=1 sequence=20
                                channel ORA_DISK_1: reading from backup piece /oracle/flash_recovery_area/ORA10G/backupset/2009_09_14/o1_mf_annnn_TAG20090914T233141_5by2nyy4_.bkp
                                channel ORA_DISK_1: restored backup piece 1
                                piece handle=/oracle/flash_recovery_area/ORA10G/backupset/2009_09_14/o1_mf_annnn_TAG20090914T233141_5by2nyy4_.bkp tag=TAG20090914T233141
                                channel ORA_DISK_1: restore complete, elapsed time: 00:00:02
                                archive log filename=/tmp/1_20_697585829.dbf thread=1 sequence=20
                                archive log filename=/tmp/1_21_697585829.dbf thread=1 sequence=21
                                archive log filename=/tmp/1_22_697585829.dbf thread=1 sequence=22
                                archive log filename=/tmp/1_23_697585829.dbf thread=1 sequence=23
                                archive log filename=/tmp/1_23_697585829.dbf thread=1 sequence=24
                                RMAN-00571: ===========================================================
                                RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
                                RMAN-00571: ===========================================================
                                RMAN-03002: failure of recover command at 09/14/2009 23:36:50
                                RMAN-11003: failure during parse/execution of SQL statement: alter database recover logfile '/tmp/1_23_697585829.dbf'
                                ORA-00310: archived log contains sequence 23; sequence 24 required
                                ORA-00334: archived log: '/tmp/1_23_697585829.dbf'
                                
                                RMAN> recover database;
                                
                                Starting recover at 14-SEP-09
                                using channel ORA_DISK_1
                                
                                starting media recovery
                                
                                unable to find archive log
                                archive log thread=1 sequence=24
                                RMAN-00571: ===========================================================
                                RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
                                RMAN-00571: ===========================================================
                                RMAN-03002: failure of recover command at 09/14/2009 23:37:42
                                RMAN-06054: media recovery requesting unknown log: thread 1 seq 24 lowscn 13165045
                                
                                RMAN> alter database open resetlogs;
                                
                                database opened
                                
                                RMAN>
                                • 13. Re: Duplicating database - archivelogs
                                  Hemant K Chitale
                                  Ah ! I see. 10.2.0.1 doesn't handle it as well as 10.2.0.4

                                  I had earlier tested (but not posted the results here) with 10.2.0.4 as well and had said, in that earlier post,
                                  "However, if you are not using an FRA but are using log_archive_dest_1, RMAN still reads the archivelogs from this destination directory during the RECOVER command ! It just doesn't know when to stop. You will have to manually OPEN RESETLOGS after RMAN errors after after reading the last available archivelog."


                                  Hemant K Chitale
                                  • 14. Re: Duplicating database - archivelogs
                                    jdi
                                    Thanks all, with your help I was able to successfully apply all the archive logs and open the database with resetlogs option. So the duplicated database is in a new host and it is in sync with the source database. I changed the global_name to the new db server. Can I leave the dbid same as the source database or do I need to change it as well?

                                    Thanks for all your help.

                                    Cheers
                                    1 2 Previous Next