Failover from standby database to primary database

Hi,
Can anyone suggest me, How to do " Standby DataGuard database to primary database (dataguard)".
Kindly Give me steps.
Thanks,
Shweta

Hi
Follow these steps
Oracle switchover operation:
1.     Check and verify the role parameter on the v$parameters both primary and standby
On Primary
Log_archive_dest_1=”this is the local archive destination”
+Log_archive_dest_2=”This is the Service [TNS ENTRY]”+
Log_archive_dest_state_1=Enable
Log_archive_dest_state_2=Enable
Fal_server=”this should have the tns entry for the standby
Fal_Client=”this should have the tns entry for the primary
Standby_archive_dest=”This should have the Location where the archive located”
Standby_File_Management=AUTO
On Standby
Log_archive_dest_1=”this is the local archive destination”
+Log_archive_dest_2=”This is the Service [TNS ENTRY]”+
Log_archive_dest_state_1=Enable
Log_archive_dest_state_2=DEfer
Fal_server=”this should have the tns entry for the primary
Fal_Client=”this should have the tns entry for the standby
Standby_archive_dest=”This should have the Location where the archive located”
Standby_File_Management=AUTO
2.     Down all the applications connects to the database
3.     Shutdown both primary and standby databases
4.     For RAC Keep Only one primary and One standby up and all other nodes should be down
5.     Check the Primary database on Open mode and the Standby database on mount stage
6.     On Primary
SQL>select switchover_status from v$database;Sessions Active or To standby will be appearing on the result
SQL> alter database commit to switchover to standby with session shutdown;
SQL> shutdown Immediate;
SQL>startup nomount;
SQL>alter database mount standby database;
SQL>Alter system set log_Archive_dest_state_2=defer;7.     On Standby
SQL>select switchover_status from  v$database;it is acceptable to have Sessions Active or To Primary
SQL>alter database commit to switchover to primary with session shutdown;
SQL>shutdown immediate;
SQL>Startup;
SQL.>Alter system set log_archive_dest_state_2=enable;8.     On Primary
start the managed recovery
SQL>Alter database recover managed standby database disconnect from session;9.     Check the log shipment is working from New Primary to New Standby Using
SQL>Alter system switch logfile; ---- On New Primary.check the alert log on both Primary and Standby for the log shipment and Media recovery.
10.     If the switch over fail issue the following statement on standby (ORACLE 9i)
SQL> alter database recover managed standby database finish skip standby logfile ┘
SQL> alter database commit to switchover to primary┘
SQL> shutdown immediate;
SQL> Startup;11.     If this don’t work please issue the below statement
SQL> alter database activate standby database skip standby logfile;12.     If the switch over fail issue the following statement on standby (ORACLE 10g and above)
SQL> alter database recover managed standby database finish force;
SQL> alter database commit to switchover to primary;
SQL> alter database open;
SQL> shutdown Immediate;
SQL> startup;13. Added the temp file to your temp tablespace
If you follow the steps (10,11 & 12 ) you have to recreate the standby again. those steps are actually fail over steps. Hope this will be helpful
Cheers
Kanchana

Similar Messages

  • Restore production from standby database

    Hi,
    I would like to make a standby database for my production database.
    But, I have a basic question to restore my production database from standby database. There is a method to make it ?
    If I lost all files from production database, how to restore from my standby datase (which become in this case my new production database) ?
    thanks in advance for your help.
    gnom92.

    * I make a copy datafiles from my new production database (old standby database) on old production (where crash)
    * With my old production database, I make a standby database on new production database (old standby)
    * I can close the new production database and open the new standby database in read / write mode, and this is my production database.
    * After what I recreate my standby database (old standby,newproduction), or can I return in recover standby mode ?
    thank you very much for your patience.
    gnom92.

  • Recover Primary Database from Standby Database

    Hi all,
    I'm trying to understand how to use physical standby database in order to have a backup from a primary database.
    The first part is very clear. I supose I have a physical standby database ready and archiving from a primary database but the second part is the problem.
    1. Now I supose that my primary database is gone... not just a logical corruption but a physical disaster such a fire o something worst.
    How to recover the primary site from the physical standby database??????????
    2. Just a logical corruption in primary database. How to syncronize with the standby database that it's the one who has the right data???
    Thanks in advance.
    Edited by: jsfelix on 18-nov-2009 4:48
    Edited by: jsfelix on 18-nov-2009 4:51

    How to recover the primary site from the physical standby database?1. Ensure that you DO have a Primary Site up and running. It might be the same building. It might be another building. Management might decide to switch to another city. (BTW, all of this should be defined in the D.R. / B.C.P. documentation).
    The (possibly new) Primary Site has to have the required hardware , O.S etc.
    2. Take a backup of the Standby and restore it to the (possibly new) Primary.
    Actually, the Standby becomes the new Primary and the new site that is setup becomes the Standby. This continues until management decides to switch over.
    Just a logical corruption in primary database.Take a backup of the Standby and restore it to the Primary. You have to suffer an outage. Note : If only one or few files on the Primary are physically corrupt (and offline), you could backup the selected files from the Standby and RESTORE and RECOVER on the Primary !
    Hemant K Chitale
    http://hemantoracledba.blogspot.com

  • Error when trying to recover datafile from standby database to primary

    hi friends,
    getting problem with restoring datafile from backupset taken on standby database to primary database.
    os: windows server 2003
    db: oracle 11gR1(11.1.0.6)
    i've configured standby database on two different hosts.
    host1 - primary (db_uinque_name= prod)
    host2 - standby (db_uniue_name= prodsby)
    I've configure both database with recovery catalog. I take backup on standby database. users' datafile of primary database has been lost.i'm trying to restore from the backupsets taken on standby database.
    with the help of - http://download.oracle.com/docs/cd/B28359_01/server.111/b28294/rman.htm#BAJCEFEG
    on primary
    c:\>rman target sys/password catalog rcat/password
    rman>list backup for db_unique_name prodsby;
    display the backupsets
    rman>restore datafile 4;
    Starting restore at 06-NOV-08
    starting full resync of recovery catalog
    full resync complete
    allocated channel: ORA_DISK_1
    channel ORA_DISK_1: SID=1051 device type=DISK
    RMAN-00571: ===========================================================
    RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
    RMAN-00571: ===========================================================
    RMAN-03002: failure of restore command at 11/06/2008 12:12:18
    RMAN-06026: some targets not found - aborting restore
    RMAN-06023: no backup or copy of datafile 4 found to restore
    also use to tag to restore the datafile
    rman>restore datafile 4 from tag='base0_prodsby';
    Starting restore at 06-NOV-08
    using channel ORA_DISK_1
    RMAN-00571: ===========================================================
    RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
    RMAN-00571: ===========================================================
    RMAN-03002: failure of restore command at 11/06/2008 11:27:21
    RMAN-06026: some targets not found - aborting restore
    RMAN-06023: no backup or copy of datafile 4 found to restore
    i'm getting above errors when try to restore the datafile.
    when i issue the following command.
    BACKUP AS COPY DATAFILE 4 AUXILIARY FORMAT 'C:\app\Administrator\oradata\prod\USERS01.DBF';
    Starting backup at 06-NOV-08
    using target database control file instead of recovery catalog
    allocated channel: ORA_DISK_1
    channel ORA_DISK_1: SID=1068 device type=DISK
    channel ORA_DISK_1: starting datafile copy
    input datafile file number=00004 name=C:\APP\ADMINISTRATOR\ORADATA\prod\USERS01.
    DBF
    RMAN-00571: ===========================================================
    RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
    RMAN-00571: ===========================================================
    RMAN-03009: failure of backup command on ORA_DISK_1 channel at 11/06/2008 12:49:
    15
    ORA-17628: Oracle error 19505 returned by remote Oracle server
    please friends, try to help me to solve the problem.
    Thanks,
    Vihang

    hi.
    Its not necessary its a otherway around to recover datafile from this backupset and apply archivelogs to make datafile consistent.
    yes, it ain't the right way to restore backup to primary location.
    so how would i connect to standby database with primary and recovery catalog.
    i need to connect to recovery catalog and primary site because i need to restore to primary location and recovery catalog contain all metadata and backupsets related information.
    i also tried the following steps from oracle documentation.
    Connect to the standby database as the target database:
    CONNECT TARGET sys@standby
    You are prompted for a password:
    target database Password: password
    Connect to the primary database as the auxiliary database:
    CONNECT AUXILIARY sys@primary
    You are prompted for a password:
    target database Password: password
    Back up the datafile on the standby host across the network to a location on the primary host. For example, suppose that /disk1/df2.dbf is the name of datafile 2 on the standby host. Suppose that /disk8/datafile2.dbf is the name of datafile 2 on the primary host. The following command would copy datafile 2 over the network to /disk9/df2copy.dbf:
    BACKUP AS COPY DATAFILE 2 AUXILIARY FORMAT '/disk9/df2copy.dbf';
    Starting backup at 06-NOV-08
    using target database control file instead of recovery catalog
    allocated channel: ORA_DISK_1
    channel ORA_DISK_1: SID=1068 device type=DISK
    channel ORA_DISK_1: starting datafile copy
    input datafile file number=00004 name=C:\APP\ADMINISTRATOR\ORADATA\prod\USERS01.
    DBF
    RMAN-00571: ===========================================================
    RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
    RMAN-00571: ===========================================================
    RMAN-03009: failure of backup command on ORA_DISK_1 channel at 11/06/2008 12:49:
    15
    ORA-17628: Oracle error 19505 returned by remote Oracle server
    getting this error.

  • Create dev database from standby database

    Hi folks,
    I need to create a dev database by using RMAN's method of cloning. But, since it is business hours and the production database is being used at a very high rate, I cannot carryout the cloning by connecting the primary database as it may cause performance slowness.
    The time allotted for the activity is also very short. We have a standby database created for the primary database. So, my question is it possible for me to create the dev database using the standby database ?
    Database version is 11.1.0.6 and I can go ahead with the active database feature.

    Yes, you can clone from the standby database. Follow the below steps.
    1. Check if your standby database is in sync with the primary database.
    2. Cancel the MRP on the standby database.
    alter database recover managed standby database cancel;3. connect to standby as target database and dev database as auxiliary
    rman target sys/<pwd>@<standby-alias> auxiliary sys/pwd@<dev-alias>4. Your standby database would be in mount stage and dev in nomount stage.
    5. Run the duplicate command
    rman>duplicate target database to 'dev' nofilenamecheck;6. Once done, start the MRP on the standby database
    alter database recover managed standby database disconnect from session;

  • Duplicate from standby database to create a test database?

    Hello!
    Would it be possible to use backup-based duplication FROM a physical standby database to create another database to be used for testing? If I performed RMAN backup of the standby database, moved the backup to another test server, and then ran duplicate?
    Anyone know if this would be possible? If possible, would the new test database's controlfile be "standby" or "primary".
    (version 11.2.0.2)
    thanks..

    Yes it works ! I've tried that recently on 10g so I think on 11g will not be a problem.
    You can do it with or without duplicate. If you want to use duplicate, you don't need to copy the backup. Actually, on 11g you don't need no backup at all, since now you have 'from active database' option for duplicate command !
    Also, duplicate will rebuild the controlfile so it will not be "standby" or "primary" ...
    Gabriel

  • Database refresh from standby database

    All,
    OS : Sun version : 11.1.0.7
    I'm doing database refresh using stand by database datafiles in different server.
    1)Disabled Data guard broker in standby database .
    2)Copied all datafiles in mount stage to target server (different server)
    3)created controlfile and started the database in mount stage in different server
    4)Applied all archive log files .
    5)But still the database not recovered .
    SQL> recover database using backup controlfile until cancel;
    ORA-00279: change 10401147296308 generated at 01/13/2012 09:03:43 needed for
    thread 1
    ORA-00289: suggestion :
    /u01/app/oracle/admin/qecgdeva/arch/qecgdeva_727091849_1_57879.arc
    ORA-00280: change 10401147296308 for thread 1 is in sequence #57879
    Specify log: {<RET>=suggested | filename | AUTO | CANCEL}
    /u01/app/oracle/admin/qecgdeva/arch/qecgdeva_727091849_1_57879.arc
    Specify log: {<RET>=suggested | filename | AUTO | CANCEL}
    /u01/app/oracle/admin/qecgdeva/arch/qecgdeva_727091849_1_57885.arc
    ORA-00279: change 10401156453328 generated at 01/13/2012 10:48:01 needed for
    thread 1
    ORA-00289: suggestion :
    /u01/app/oracle/admin/qecgdeva/arch/qecgdeva_727091849_1_57886.arc
    ORA-00280: change 10401156453328 for thread 1 is in sequence #57886
    ORA-00278: log file
    '/u01/app/oracle/admin/qecgdeva/arch/qecgdeva_727091849_1_57885.arc' no longer
    needed for this recovery
    Specify log: {<RET>=suggested | filename | AUTO | CANCEL}
    CANCEL
    ORA-01547: warning: RECOVER succeeded but OPEN RESETLOGS would get error below
    ORA-01196: file 1 is inconsistent due to a failed media recovery session
    ORA-01110: data file 1:
    '/mounts/qecgdeva_data/oradata/qecgdeva/dbfiles/qecgprod_system.dbf'
    ORA-01112: media recovery not started
    SQL> alter database open resetlogs;
    alter database open resetlogs
    ERROR at line 1:
    ORA-01196: file 1 is inconsistent due to a failed media recovery session
    ORA-01110: data file 1:
    '/mounts/qecgdeva_data/oradata/qecgdeva/dbfiles/qecgprod_system.dbf'Am I missing any steps here ? Please advice me on this .
    Thanks.

    Hi,
    When you copy files of standby server to another target server ? - Yesterday.
    Is standby is SYNC with primary? or MRP is still running? - ---------yes, standby db is running fine .
    Even you can open database with resetlogs after recreating controlfile, no need of recovery too -- >I was unable to open . So went to apply arch files.
    Do you have archive of thread 1 is in sequence #57887, -- No , Because sequence 57887 yet generate. I have applied all recent available archive log files.
    ORA-00289: suggestion :
    /u01/app/oracle/admin/qecgdeva/arch/qecgdeva_727091849_1_57886.arc
    ORA-00280: change 10401156453328 for thread 1 is in sequence #57886
    ORA-00278: log file
    '/u01/app/oracle/admin/qecgdeva/arch/qecgdeva_727091849_1_57885.arc' no longer
    needed for this recovery
    Specify log: {<RET>=suggested | filename | AUTO | CANCEL}
    CANCEL
    ORA-01547: warning: RECOVER succeeded but OPEN RESETLOGS would get error below
    ORA-01196: file 1 is inconsistent due to a failed media recovery session
    ORA-01110: data file 1:
    '/mounts/qecgdeva_data/oradata/qecgdeva/dbfiles/qecgprod_system.dbf'
    ORA-01112: media recovery not started
    SQL> alter database open resetlogs;
    alter database open resetlogs
    ERROR at line 1:
    ORA-01196: file 1 is inconsistent due to a failed media recovery session
    ORA-01110: data file 1:
    '/mounts/qecgdeva_data/oradata/qecgdeva/dbfiles/qecgprod_system.dbf'Edited by: 805877 on Jan 12, 2012 10:43 PM

  • UAT Database from Standby database

    Hi,
    I'm using oracle 11.2.0.2.0 on Windows 2008,
    I have prod & standby databases, I want to create new UAT DB which wiil be same as prod,
    How Can create a UAT using standby database cold backup,
    can i use cold backup of standby database.
    Thanks
    Edited by: user10745179 on Oct 22, 2012 12:42 PM

    This would be a database duplication from backup with RMAN. A Catalog will help, particularly as you are working in a Data Guard environment, but it is a straightforward and well documented operation:
    http://docs.oracle.com/cd/E11882_01/backup.112/e10642/rcmdupdb.htm#i1008564

  • HOW? switch from standby database

    I on standby database and want to usse it for update,insert .
    tell me, how do i switch stand by database.
    please tell me for command and process
    thx

    1/ open Firefox (or you favorite browser)
    2/ enter URL: http://tahiti.oracle.com
    3/ pick you release
    4/ in the "Search box" enter: "Data Guard" and hit enter
    5/ In the list, pick the link that will lead you to "Data Guard Concepts and Administration - Contents" (name for 10g)
    6/ Good reading.
    Regards,
    Yoann.
    PS: From your post, it's not clear what you want to achieve.

  • Failed to clone DB from StandBy database

    Hello,
          I need to  perform a clone of Data Guard physical standby  database  (production) to use in preproduction. we  have a  full RMAN  backup of standby database.
    My restore is failed,  i use this steps:
       * full RMAN backup of standby database
      *  backup control file of primary
      * on a new  database server, copy backup
      *  RMAN > restore control file (of brimary)
    *  RMAN > CATALOG START WITH ' Path of backup'
    *  crosscheck backup
    *  restore database
    -> the restore is failed with errors messages :
       RMAN-06026: some targets not found - aborting restore
       RMAN-06023: no backup or copy of datafile 4 found to restore
       RMAN-06023: no backup or copy of datafile 3 found to restore
      RMAN-06023: no backup or copy of datafile 2 found to restore
      RMAN-06023: no backup or copy of datafile 1 found to restore
    I  retry restore database after restoring a  standby control file, it's failed with the same message.
    can you help me ,please, to resolve this issue
    Regards
    Dj

    Thank's AbuFazalMdAbbas for your reply,
      RMAN > list backup :  i display only 3 Piece Name
                BS Key  Type LV Size       Device Type Elapsed Time Completion Time
                18364   Incr 1  36.56M     DISK        00:22:11     29-JUL-13
                        BP Key: 18364   Status: AVAILABLE  Compressed: YES  Tag: DIGI_SEC_DB1_DAT
                        Piece Name: /mnt/backup/RMAN/SEC_DB1/files/rman_SEC_DB1_29_01_0fofu8j3_1_1
                  List of Datafiles in backup set 18364
                  File LV Type Ckp SCN    Ckp Time  Name
                  17   1  Incr 22020167729 29-JUL-13 +DATA/DB1/datafile/indx_fusion54_purge.277.753031091
                  25   1  Incr 22020167729 29-JUL-13 +DATA/SEC_DB1/datafile/data_cmsco.284.762608775
                  44   1  Incr 22020167729 29-JUL-13 +DATA/SEC_DB1/datafile/indx_cmsco.303.799865601
                  64   1  Incr 22020167729 29-JUL-13 +DATA/SEC_DB1/datafile/indx_cmsco.324.809446025
                BS Key  Type LV Size       Device Type Elapsed Time Completion Time
                18365   Incr 1  11.17M     DISK        00:22:12     29-JUL-13
                        BP Key: 18365   Status: AVAILABLE  Compressed: YES  Tag: DIGI_SEC_DB1_DAT
                        Piece Name: /mnt/backup/RMAN/SEC_DB1/files/rman_SEC_DB1_29_01_0gofu8j3_1_1
                  List of Datafiles in backup set 18365
                  File LV Type Ckp SCN    Ckp Time  Name
                  18   1  Incr 22020167729 29-JUL-13 +DATA/DB1/datafile/indx_fusion54_purge.279.753031091
                  26   1  Incr 22020167729 29-JUL-13 +DATA/SEC_DB1/datafile/data_cmsco.285.762622281
                  45   1  Incr 22020167729 29-JUL-13 +DATA/SEC_DB1/datafile/data_cmsco.304.800028323
                  65   1  Incr 22020167729 29-JUL-13 +DATA/SEC_DB1/datafile/data_cmsco.325.814713695
                BS Key  Type LV Size       Device Type Elapsed Time Completion Time
                18366   Incr 1  49.25M     DISK        00:11:54     29-JUL-13
                        BP Key: 18366   Status: AVAILABLE  Compressed: YES  Tag: DIGI_SEC_DB1_DAT
                        Piece Name: /mnt/backup/RMAN/SEC_DB1/files/rman_SEC_DB1_29_01_0hofu9sq_1_1
                  List of Datafiles in backup set 18366
                  File LV Type Ckp SCN    Ckp Time  Name
                  4    1  Incr 22021555818 29-JUL-13 +DATA/DB1/datafile/users.281.753031093
                  27   1  Incr 22021555818 29-JUL-13 +DATA/SEC_DB1/datafile/indx_cmsco.286.763655749
                  47   1  Incr 22021555818 29-JUL-13 +DATA/SEC_DB1/datafile/indx_cmsco.306.800463801
                  66   1  Incr 22021555818 29-JUL-13 +DATA/SEC_DB1/datafile/data_cmsco.326.817754983
      # cd <location where backup files were copied>
      # ls -lrt
          ALL files (piece name in list backup) exist on file System,  and it's owner by oracle
      # show all
                RMAN> show all;
                using target database control file instead of recovery catalog
                RMAN configuration parameters for database with db_unique_name RSP are:
                CONFIGURE RETENTION POLICY TO REDUNDANCY 1; # default
                CONFIGURE BACKUP OPTIMIZATION OFF; # default
                CONFIGURE DEFAULT DEVICE TYPE TO DISK; # default
                CONFIGURE CONTROLFILE AUTOBACKUP ON;
                CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '+RECO/ctrl_%F';
                CONFIGURE DEVICE TYPE DISK PARALLELISM 2 BACKUP TYPE TO COMPRESSED BACKUPSET;
                CONFIGURE DATAFILE BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default
                CONFIGURE ARCHIVELOG BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default
                CONFIGURE MAXSETSIZE TO UNLIMITED; # default
                CONFIGURE ENCRYPTION FOR DATABASE OFF; # default
                CONFIGURE ENCRYPTION ALGORITHM 'AES128'; # default
                CONFIGURE COMPRESSION ALGORITHM 'BASIC' AS OF RELEASE 'DEFAULT' OPTIMIZE FOR LOAD TRUE ; # default
                CONFIGURE ARCHIVELOG DELETION POLICY TO NONE; # default
                CONFIGURE SNAPSHOT CONTROLFILE NAME TO '/u01/app/oracle/product/11.2.0/db/dbs/snapcf_MNTRSP.f'; # default

  • DG backup advisory , backup from standby database 11gr2

    Hi everyone
    I'm having a bit of issues with how the backups are setup in my DG environment. I have searched high and low and not really found a easy answer to how to setup your DG backups.
    One says this, another says that. So i'm asking here in the forum.
    What is the correct way to backup a DG environment? Some discussions just shows do a normal backup on the standby only, another says you must backup the controlfiles from the primary as well (this is where my problem starts)
    We recently upgraded a 11gr1 DB to 11gr2 and now the old setup does not work anymore. The old setup was doing backup on standby , and spfile + controlfile backup on primary node. this now fails with  ANU2614E Invalid sequence of function calls to Data Protection for Oracle (backup to tape)
    This particular error happens when I run a backup controlfile on the primary before the backup on the standby. If I skip the controlfile backup on the primary, the standby will backup correctly, including the controlfile + spfile.
    There is also a delete obsolete script running within each script (controlfile backup etc), might also cause issues I guess. But this worked fine in 11gr1.
    So i'm reaching out, trying to figure out the proper way to do backup, everyone says different.
    Sincerely
    Johnny

    What is the correct way to backup a DG environment?
    Neither backing from Primary or Standby is more correct than the other.
    You can use a backup taken on the Standby in order to restore and recover a Primary Database and vice versa.
    Datafiles, Control files and archive backups are interchangeable in a Data Guard environment.
    Where you backup should depend upon load. If the Primary can handle the load without causing a SLA issue then I would backup there.
    The main things I would do with Data Guard and RMAN are as follows:
    Enable Block Change Tracking.
    Always use Autobackup.
    Always use a FRA.
    Keep Flashback Database on.
    And always set this on the Primary  ( CONFIGURE ARCHIVELOG DELETION POLICY TO APPLIED ON ALL STANDBY; )
    ANU2614E Invalid sequence.
    Odd, If you are using Third party software along with RMAN I might check this:
    Rman fails ORA-19511 ANU2614E Invalid sequence of function calls to Data Protection for Oracle (Doc ID 1300134.1)
    Otherwise I would open a support ticket ASAP.
    Best Regards
    mseberg

  • Recovering primary using standby database

    Hi all,
    Here we have a dataguard environment with db1(db_unique_name) as primary and db2(db_unique_name) as physical standby database. We configured dataguard in 10g environments and we are not using grid control. And now we want to configure rman for incremental backups.After configuring we successfully took full backup in standby plus archive logs. Then as the test case we dropped one datafile from the primary and tried to recover it. It is showing the following error. Also when i tried 'crosscheck backup' from primary it is showing that all the backups taken in standby are 'expired'. But from RMAN connected to standby the same backups are showing as 'available'. Can anyone help to fix this?
    On primary:
    [oracle@db1 NIOS]$ sqlplus / as sysdba;
    SQL*Plus: Release 10.2.0.3.0 - Production on Thu Sep 6 02:58:11 2012
    Copyright (c) 1982, 2006, Oracle. All Rights Reserved.
    Connected to:
    Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - Production
    With the Partitioning, OLAP and Data Mining options
    SQL> alter database datafile 4 offline; (after deleting datafile from system level)
    Database altered.
    [oracle@db1 NIOS]$ rman target sys/oracle@db1 catalog rman/oracle@appsdb
    Recovery Manager: Release 10.2.0.3.0 - Production on Thu Sep 6 02:58:58 2012
    Copyright (c) 1982, 2005, Oracle. All rights reserved.
    connected to target database: NIOS (DBID=1590630518)
    connected to recovery catalog database
    RMAN> restore datafile 4;
    Starting restore at 06-SEP-12
    allocated channel: ORA_DISK_1
    channel ORA_DISK_1: sid=107 devtype=DISK
    channel ORA_DISK_1: starting datafile backupset restore
    channel ORA_DISK_1: specifying datafile(s) to restore from backup set
    restoring datafile 00004 to /u01/app/oracle/oradata/NIOS/users01.dbf
    channel ORA_DISK_1: reading from backup piece /u01/app/oracle/flash_recovery_area/DB2/backupset/2012_09_05/o1_mf_nnndf_TAG20120905T174801_84gjqt0n_.bkp
    ORA-19870: error reading backup piece /u01/app/oracle/flash_recovery_area/DB2/backupset/2012_09_05/o1_mf_nnndf_TAG20120905T174801_84gjqt0n_.bkp
    ORA-19505: failed to identify file "/u01/app/oracle/flash_recovery_area/DB2/backupset/2012_09_05/o1_mf_nnndf_TAG20120905T174801_84gjqt0n_.bkp"
    ORA-27037: unable to obtain file status
    Linux Error: 2: No such file or directory
    Additional information: 3
    failover to previous backup
    channel ORA_DISK_1: starting datafile backupset restore
    channel ORA_DISK_1: specifying datafile(s) to restore from backup set
    restoring datafile 00004 to /u01/app/oracle/oradata/NIOS/users01.dbf
    channel ORA_DISK_1: reading from backup piece /u01/app/oracle/flash_recovery_area/DB2/backupset/2012_09_05/o1_mf_nnndf_TAG20120905T164212_84gdwdst_.bkp
    ORA-19870: error reading backup piece /u01/app/oracle/flash_recovery_area/DB2/backupset/2012_09_05/o1_mf_nnndf_TAG20120905T164212_84gdwdst_.bkp
    ORA-19505: failed to identify file "/u01/app/oracle/flash_recovery_area/DB2/backupset/2012_09_05/o1_mf_nnndf_TAG20120905T164212_84gdwdst_.bkp"
    ORA-27037: unable to obtain file status
    Linux Error: 2: No such file or directory
    Additional information: 3
    failover to previous backup
    channel ORA_DISK_1: restoring datafile 00004
    input datafile copy recid=13 stamp=793208425 filename=/tmp/users01.dbf
    destination for restore of datafile 00004: /u01/app/oracle/oradata/NIOS/users01.dbf
    RMAN-00571: ===========================================================
    RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
    RMAN-00571: ===========================================================
    RMAN-03002: failure of restore command at 09/06/2012 02:59:10
    ORA-19571: datafilecopy recid 13 stamp 793208425 not found in control file
    ORA-19600: input file is datafile-copy 13 ()
    ORA-19601: output file is datafile-copy 0 (/u01/app/oracle/oradata/NIOS/users01.dbf)
    RMAN> crosscheck backup;
    using channel ORA_DISK_1
    crosschecked backup piece: found to be 'EXPIRED'
    backup piece handle=/u01/app/oracle/flash_recovery_area/DB2/backupset/2012_09_05/o1_mf_annnn_TAG20120905T164038_84gdsjlw_.bkp recid=18 stamp=793212040
    crosschecked backup piece: found to be 'EXPIRED'
    backup piece handle=/u01/app/oracle/flash_recovery_area/DB2/backupset/2012_09_05/o1_mf_annnn_TAG20120905T164038_84gdtz6p_.bkp recid=19 stamp=793212087
    crosschecked backup piece: found to be 'EXPIRED'
    backup piece handle=/u01/app/oracle/flash_recovery_area/DB2/backupset/2012_09_05/o1_mf_nnndf_TAG20120905T164212_84gdwdst_.bkp recid=20 stamp=793212132
    crosschecked backup piece: found to be 'EXPIRED'
    backup piece handle=/u01/app/oracle/flash_recovery_area/DB2/autobackup/2012_09_05/o1_mf_s_793242038_84gdxw5j_.bkp recid=21 stamp=793212180
    crosschecked backup piece: found to be 'EXPIRED'
    backup piece handle=/u01/app/oracle/flash_recovery_area/DB2/backupset/2012_09_05/o1_mf_annnn_TAG20120905T174759_84gjqrtn_.bkp recid=22 stamp=793216080
    crosschecked backup piece: found to be 'EXPIRED'
    backup piece handle=/u01/app/oracle/flash_recovery_area/DB2/backupset/2012_09_05/o1_mf_nnndf_TAG20120905T174801_84gjqt0n_.bkp recid=23 stamp=793216082
    crosschecked backup piece: found to be 'EXPIRED'
    backup piece handle=/u01/app/oracle/flash_recovery_area/DB2/autobackup/2012_09_05/o1_mf_s_793246288_84gjs9h4_.bkp recid=24 stamp=793216129
    crosschecked backup piece: found to be 'AVAILABLE'
    backup piece handle=/u01/app/oracle/product/10.2.0/db_1/dbs/c-1590630518-20120906-00 recid=5 stamp=793238431
    Crosschecked 8 objects
    On Stand-by:
    [oracle@db2 NIOS]$ rman target sys/oracle@db2 catalog rman/oracle@appsdb
    Recovery Manager: Release 10.2.0.3.0 - Production on Wed Sep 5 20:11:58 2012
    Copyright (c) 1982, 2005, Oracle. All rights reserved.
    connected to target database: NIOS (DBID=1590630518, not open)
    connected to recovery catalog database
    RMAN> crosscheck backup;
    allocated channel: ORA_DISK_1
    channel ORA_DISK_1: sid=91 devtype=DISK
    crosschecked backup piece: found to be 'AVAILABLE'
    backup piece handle=/u01/app/oracle/flash_recovery_area/DB2/backupset/2012_09_05/o1_mf_annnn_TAG20120905T164038_84gdsjlw_.bkp recid=18 stamp=793212040
    crosschecked backup piece: found to be 'AVAILABLE'
    backup piece handle=/u01/app/oracle/flash_recovery_area/DB2/backupset/2012_09_05/o1_mf_annnn_TAG20120905T164038_84gdtz6p_.bkp recid=19 stamp=793212087
    crosschecked backup piece: found to be 'AVAILABLE'
    backup piece handle=/u01/app/oracle/flash_recovery_area/DB2/backupset/2012_09_05/o1_mf_nnndf_TAG20120905T164212_84gdwdst_.bkp recid=20 stamp=793212132
    crosschecked backup piece: found to be 'AVAILABLE'
    backup piece handle=/u01/app/oracle/flash_recovery_area/DB2/autobackup/2012_09_05/o1_mf_s_793242038_84gdxw5j_.bkp recid=21 stamp=793212180
    crosschecked backup piece: found to be 'AVAILABLE'
    backup piece handle=/u01/app/oracle/flash_recovery_area/DB2/backupset/2012_09_05/o1_mf_annnn_TAG20120905T174759_84gjqrtn_.bkp recid=22 stamp=793216080
    crosschecked backup piece: found to be 'AVAILABLE'
    backup piece handle=/u01/app/oracle/flash_recovery_area/DB2/backupset/2012_09_05/o1_mf_nnndf_TAG20120905T174801_84gjqt0n_.bkp recid=23 stamp=793216082
    crosschecked backup piece: found to be 'AVAILABLE'
    backup piece handle=/u01/app/oracle/flash_recovery_area/DB2/autobackup/2012_09_05/o1_mf_s_793246288_84gjs9h4_.bkp recid=24 stamp=793216129
    crosschecked backup piece: found to be 'EXPIRED'
    backup piece handle=/u01/app/oracle/product/10.2.0/db_1/dbs/c-1590630518-20120906-00 recid=5 stamp=793238431
    Crosschecked 8 objects
    Thanks in advance.

    Hello;
    I would review one of these step by step :
    Using RMAN Backup Files from Standby Database to Recover Primary
    http://oraganism.files.wordpress.com/2009/04/backup-from-physical-standby.pdf
    How to use standby backup to restore primary db
    http://alexzeng.wordpress.com/2008/09/13/how-to-use-standby-backup-to-restore-primary-db/
    Steps to recover the primary database's datafile using a copy of a standby database's datafile.
    http://dbaregistry.blogspot.com/2010/01/steps-to-recover-primary-databases.html
    RMAN in a Data Guard Environment
    http://oracle.su/docs/11g/backup.112/e10642/rcmarchi.htm#CHDIFGFH
    Performing a database clone using a Data Guard physical standby database
    http://gavinsoorma.com/2012/04/performing-a-database-clone-using-a-data-guard-physical-standby-database/
    Best Regards
    mseberg

  • Standby database failover flashback restart as standby gap 1-100

    Hi,
    I have setup a physical standby database for a 3 node RAC primary database and configured the database to run in MAXIMUM AVAILABILITY mode. Both the primary and standby databases use ASM for managing the IO. I have enabled FLASHBACK ON on both the databases.
    I did failover to standby database with primary db SHUTDOWN for doing some testing. After testing is done, I flashbacked the (standby, currently primary)database to the point when it became primary and start it as standby again and the old primary as primary.
    Following are the steps:
    Failover steps
    .Shutdown the primary database
    To finisish the recovery at standby
    SQL>alter database recover managed standby database finish;
    To start as primary
    SQL>alter database commit to switchover to primary;
    do some DML on the new primary
    SQL>flashback database to scn <standby_became_primary_scn>;
    SQL>alter database create standby controlfile as '/backup/standby.ctl';
    Changed the spfile to point control_files to '/backup/standby.ctl';
    Restarted the standby db in mount mode and
    created the required stanbdy logs on it.
    Then issued
    SQL>alter database recover managed standby database using current logfile disconnect;
    I have the following message in v$dataguard_status at standby db;
    Fetching gap sequence in thread 1 branch(resetlogs_id) 653234404, gap seq 1-100
    DBID 2651011616 branch 653234404
    GAP - thread 1 sequence 1-100
    FAL[client]: Failed to request gap sequence
    FAL[client]: All defined FAL servers have been attempted.
    The same error is found in alert log file also.
    The status of the varioud managed standby db are as follows.
    SQL> select process, status from v$managed_standby;
    PROCESS STATUS
    ARCH CLOSING
    ARCH CLOSING
    ARCH CLOSING
    MRP0 WAIT_FOR_GAP
    RFS IDLE
    RFS IDLE
    RFS IDLE
    RFS IDLE
    RFS IDLE
    RFS IDLE
    RFS IDLE
    PROCESS STATUS
    RFS IDLE
    RFS IDLE
    RFS IDLE
    RFS IDLE
    15 rows selected.
    SQL>
    Could you please help me how to resolve the above error.
    Thanks,
    Sreekanth

    Sreekanth,
    I think your steps are right on for your requirement, except instead of
    alter database create standby controlfile as '/backup/standby.ctl';
    you can do this:
    ALTER DATABASE CONVERT TO PHYSICAL STANDBY;
    (although perhaps it achieves the same thing internally but you don't need to repoint to new controlfile).
    So far as the GAP - thread 1 sequence 1-100
    Let me guess, your current sequences are probably well ahead of this reported gap?
    If so, this is a bogus gap in a sense that your standby has long ago applied them, but for some reason standby controlfile gets a little confused and starts asking for them again.
    I have had this issue and opened multiple TAR's with Oracle since 10.2.0.1, got a few patches and advises to upgrade, but still occasionally get it now in 10.2.0.3
    I strongly believe this is related to combination of RAC (i.e. multiple threads of redo) and dataguard.
    It is also pretty hard to reproduce (I have not figured out how to reproduce this reliably, if you have, let me know), so I can understand why Oracle has so far been unable to fix this.
    Anyway, the workaround is to re-create standby controlfile with a copy generated on primary, and move it in place of the existing (and confused) controlfiles on standby.

  • 9i Standby Database - Failover Question - REF 227196.1

    Hi ,
    Im researching the use of a Standby DB for out Production DB....
    The Metalink DOC 227196.1 mentions that in failover , the Production going down , Standby becomes Primary and cannot be come Standby again , whereas with Switchover , they can be swapped as many times as you need for upgrades etc...
    "The Difference between a Switchover and a Failover is, that after a Failover, the Standby Database becoming a Primary now, cannot switchback to become a Standby Database again. In Opposition a Switchover exchanges the Database Roles (The Primary becomes a Standby and the Standby becomes a Primary). Switchovers can be performed arbitrarily, a Failover only once."
    If failover happens can someone tell me or point me in the right direction:
    a) Can you config Failover to happen automatically?
    b) If failover occurs , do you need to reconfig all the Primary/Standby DB again in the event that failover happens again?
    c) Any clear step by step guide to config of standby... The Oracle docs whilst very good are robust and some "summary" steps would be great
    thanks in advance
    Stephen

    HI,
    Please check this link:
    Physical Standby Database SWITCHOVER &amp;amp; FAILOVER Operations | Talip Hakan Ozturk&amp;#039;s ORACLE BLOG
    Thank you

  • Creating physical standby database from another physical standby database

    hi,
    We have one production database and one physical standby of the production. Now we have situation where we need to create one database from either production or from standby. As production is loaded we can not do it using active database option. Now we have the only option to copy the database from standby.
    As of now we open the standby and copy it using rman duplicate database and again we put it back to standby mode.
    Is it possible to create standby database from standby database only?
    Oracle version : 11.1.0.7.0
    I have seen procedure allowing to do the same in version 11.2.0.3. I have tried searching for the difference but didn't find when this feature was introduced.
    Thanks,
    Ketul Patel

    Hello;
    Active duplicate should work when connected to Standby as source Database. However there's a bug 11715084 which is not fixed until version 11.2.0.4.
    If patch 11715084 is available for your version it may work, but all the 11.1.0 are gone so I have no way to test.
    RMAN ACTIVE DUPLICATE WHEN CONNECTED TO STANDBY AS TARGET [ID 1343515.1]
    Understanding ORA-01671 error during controlfile creation / backup [ID 461121.1]
    Best Regards
    mseberg
    Edited by: mseberg on Feb 13, 2013 8:59 AM

Maybe you are looking for