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

Similar Messages

  • How to create primary controlfile from standby controlfile?

    We need to create a primary control file from a standby control file.
    SQL> select name, controlfile_type from v$database;
    NAME CONTROL
    HPR STANDBY
    Please help.
    Thank you very much.

    May wrote:
    We need to create a primary control file from a standby control file.
    SQL> select name, controlfile_type from v$database;
    NAME CONTROL
    HPR STANDBY
    Please help.
    Thank you very much.What is a problem?
    You can not create controlfile from standby controlfile(Expected activate time).
    And you lost controlfile?

  • 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

  • Archive sequence number from standby does not match primary

    I have two unix servers configured, one as primary and one as standby, both in 11.2.0.2. When I run the verification scripts, I noticed that my standby's archive log sequence does not match the primary.
    From standby:
    select database_role, open_mode from v$database; Result: PHYSICAL STANDBY, MOUNTED
    select max(sequence#) from v$archived_log; Result is null
    archive log list;Database log mode Archive Mode
    Automatic archival Enabled
    Archive destination /arch/standby
    Oldest online log sequence 0
    Next log sequence to archive 0
    Current log sequence 0

    Hello;
    I don't think you have Data Guard working.
    select max(sequence#) from v$archived_log; This should return a number.
    Do an alter system switch logfile; on the primary, I'm thinking the new log never makes it to your standby.
    Once you have this working consider running something like this from your Primary:
    SELECT name as STANDBY, SEQUENCE#, applied, completion_time from v$archived_log WHERE DEST_ID = 2 AND NEXT_TIME > SYSDATE -1;
    select max(sequence#) from v$archived_log where NEXT_TIME > sysdate -1;
    You can change the first query to include both the Primary and the Standby.
    Best Regards
    mseberg

  • 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.

  • 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

  • Delete standby redo log from primary database

    Hi all,
    I'm trying to drop standby logfiles on primary database (other database that I'm configuring the DG).
    The members of the standby log groups don't exists on file system.
    Somebody have deleted these files. Its old configuration where the files were in file system. Now they are in ASM.
    When I try to drop the standby logfiles I got the following error:
    SQL> alter database clear logfile group 7;
    alter database clear logfile group 7
    ERROR at line 1:
    ORA-19528: redo logs being cleared may need access to files
    SQL> select * from v$logfile order by 1;
        GROUP# STATUS  TYPE    MEMBER                                                                           IS_
             1         ONLINE  +REDO1/proj/onlinelog/group_1.256.340558657                                     NO
             1         ONLINE  +REDO2/proj/onlinelog/group_1.256.340558659                                     NO
             2         ONLINE  +REDO1/proj/onlinelog/group_2.257.340558879                                     NO
             2         ONLINE  +REDO2/proj/onlinelog/group_2.259.340558879                                     NO
             3         ONLINE  +REDO1/proj/onlinelog/group_3.258.340558707                                     NO
             3         ONLINE  +REDO2/proj/onlinelog/group_3.257.340558709                                     NO
             4         ONLINE  +REDO2/proj/onlinelog/group_4.258.340558713                                     NO
             4         ONLINE  +REDO1/proj/onlinelog/group_4.259.340558711                                     NO
             5         ONLINE  +REDO2/proj/onlinelog/group_5.260.340558965                                     NO
             5         ONLINE  +REDO1/proj/onlinelog/group_5.260.340558963                                     NO
             6         ONLINE  +REDO1/proj/onlinelog/group_6.261.340558967                                     NO
             6         ONLINE  +REDO2/proj/onlinelog/group_6.261.340558967                                     NO
             7         STANDBY /oracle/proj/onlinelog2/redo_702.log                                            NO
             7         STANDBY /oracle/proj/onlinelog1/redo_701.log                                            NO
             8         STANDBY /oracle/proj/onlinelog2/redo_802.log                                            NO
             8         STANDBY /oracle/proj/onlinelog1/redo_801.log                                            NO
             9         STANDBY /oracle/proj/onlinelog2/redo_902.log                                            NO
             9         STANDBY /oracle/proj/onlinelog1/redo_901.log                                            NO
            10         STANDBY /oracle/proj/onlinelog1/redo_1001.log                                           NO
            10         STANDBY /oracle/proj/onlinelog2/redo_1002.log                                           NO
    20 rows selected.
    SQL> select * from v$standby_log order by 1;
        GROUP# DBID            THREAD#  SEQUENCE#      BYTES       USED ARC STATUS     FIRST_CHANGE# FIRST_TIM LAST_CHANGE# LAST_TIME
             7 UNASSIGNED            0          0  104854601        512 YES UNASSIGNED             0                      0
             8 UNASSIGNED            0          0  104854601        512 YES UNASSIGNED             0                      0
             9 UNASSIGNED            0          0  104854601        512 YES UNASSIGNED             0                      0
            10 UNASSIGNED            0          0  104854601        512 YES UNASSIGNED             0                      0What can I do to drop these reference?
    Any other solution instead of edit the controlfile and stop/start tghe database?
    thank you!!!!

    Hello;
    Well Oracle thinks the files are there, but I remember a bug on metalink where the controlfile still had them, but they were not on the file system. Can you confirm they exist?
    Meanwhile I check my notes for the Oracle doc nunber.
    Bug 6128242: TRYING TO DROP STANDBY LOG FAILS WITH ORA-19528
    So if you are Oracle 10 this might be the issue.
    workaround is to re-create the controlfile without the incorrect logfile. ( Yuk!! )
    ORA-01156 When Adding Or Dropping Redo Logs [ID 452152.1]
    Best Regards
    mseberg
    Edited by: mseberg on Oct 31, 2011 5:09 PM

  • How do the application servers connect the new database after failing over from primary DB to standby DB

    How do the application servers connect the new database after failing over from primary DB to standby DB?
    We have setup a DR environment with a standalone Primary server and a standalone Physical Standby server on RHEL Linux 6.4. Now our application team would like to know:
    When the primary DB server is crashed, the standy DB server will takeover the role of primary DB through the DataGuard fast failover. As the applications are connected by the primary DB IP before,currently the physical DB is used as a different IP or listener. If this is happened, they need to stop their application servers and re-configure their connection so the they coonect the new DB server, they cannot tolerate these workaround. 
    Whether does oracle have the better solution for this so that the application can automatically know the role's transition and change to the new IP without re-confige any connection and shutdown their application?
    Oracle support provides us the answer as following:
    ==================================================================
    Applications connected to a primary database can transparently failover to the new primary database upon an Oracle Data Guard role transition. Integration with Fast Application Notification (FAN) provides fast failover for integrated clients.
    After a failover, the broker publishes Fast Application Notification (FAN) events. These FAN events can be used in the following ways:
    Applications can use FAN without programmatic changes if they use one of these Oracle integrated database clients: Oracle Database JDBC, Oracle Database Oracle Call Interface (OCI), and Oracle Data Provider for .NET ( ODP.NET). These clients can be configured for Fast Connection Failover (FCF) to automatically connect to a new primary database after a failover.
    JAVA applications can use FAN programmatically by using the JDBC FAN application programming interface to subscribe to FAN events and to execute event handling actions upon the receipt of an event.
    FAN server-side callouts can be configured on the database tier.
    FAN events are published using Oracle Notification Services (ONS) and Oracle Streams Advanced Queuing (AQ).
    =======================================================================================
    Who has the experience and the related documentation or other solutions? we don't have the concept of about FAN.
    Thank very much in advance.

    Hi mesbeg,
    Thanks alot.
    For example, there is an application JBOSS server connecting the DB, we just added another datasource and put the standby IP into the configuration file except adding a service on DB side like this following:
            <subsystem xmlns="urn:jboss:domain:datasources:1.0">
            <datasources>
                    <datasource jta="false" jndi-name="java:/jdbc/idserverDatasource" pool-name="IDServerDataSource" enabled="true" use-java-context="true">
                        <connection-url>jdbc:oracle:thin:@<primay DB IP>:1521:testdb</connection-url>
                        <connection-url>jdbc:oracle:thin:@<standby DB IP>:1521:testdb</connection-url>
                        <driver>oracle</driver>
                        <pool>
                            <min-pool-size>2</min-pool-size>
                            <max-pool-size>10</max-pool-size>
                            <prefill>true</prefill>
                        </pool>
                        <security>
                            <user-name>TEST_USER</user-name>
                            <password>Password1</password>
                        </security>
                        <validation>
                            <valid-connection-checker class-name="org.jboss.jca.adapters.jdbc.extensions.oracle.OracleValidConnectionChecker"/>
                            <validate-on-match>false</validate-on-match>
                            <background-validation>false</background-validation>
                            <use-fast-fail>false</use-fast-fail>
                            <stale-connection-checker class-name="org.jboss.jca.adapters.jdbc.extensions.oracle.OracleStaleConnectionChecker"/>
                            <exception-sorter class-name="org.jboss.jca.adapters.jdbc.extensions.oracle.OracleExceptionSorter"/>
                        </validation>
                    </datasource>
                    <drivers>
                        <driver name="oracle" module="com.oracle.jdbc">
                            <xa-datasource-class>oracle.jdbc.OracleDriver</xa-datasource-class>
                        </driver>
                    </drivers>
                </datasources>
            </subsystem>
    If the failover is occurred, the JBOSS will automatically be pointed to the standby DB. Additional actions are not needed.

  • How will you find out no of standby databases configured for primary database from OS level

    How can find the number of standby databases configured for primary database from os level

    Check the alert log.
    The Alert log will always have Data Guard messages in it.
    Example
    cd /u01/app/oracle/diag/rdbms/primary/PRIMARY/trace
    tail -1700 alert_PRIMARY.log | more
    Wed Nov 13 13:35:26 2013
    ARC7: Standby redo logfile selected for thread 1 sequence 1164 for destination LOG_ARCHIVE_DEST_2
    LNS: Standby redo logfile selected for thread 1 sequence 1165 for destination LOG_ARCHIVE_DEST_2
    If you don't see messages like this it's probably not a Data Guard system.
    Or search it for :
    System parameters with non-default values:
    Which on Data Guard system will show things like:
    log_archive_dest_1 = "LOCATION=USE_DB_RECOVERY_FILE_DEST VALID_FOR=(ALL_LOGFILES,ALL_ROLES) DB_UNIQUE_NAME=PRIMARY"
    log_archive_dest_2 = "SERVICE=STANDBY LGWR ASYNC VALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLE) DB_UNIQUE_NAME=STANDBY"
    log_archive_dest_state_1 = "ENABLE"
    log_archive_dest_state_2 = "ENABLE"
    fal_server = "STANDBY"
    Best Regards
    mseberg

  • Use of standby redo log files in primary database

    Hi All,
    What is the exact use of setting up standby redo log files in the primary database on a data guard setup?
    any good documents?

    A standby redo log is required for the maximum protection and maximum availability modes and the LGWR ASYNC transport mode is recommended for all databases. Data Guard can recover and apply more redo data from a standby redo log than from archived redo log files alone.
    You should plan the standby redo log configuration and create all required log groups and group members when you create the standby database. For increased availability, consider multiplexing the standby redo log files, similar to the way that online redo log files are multiplexed.
    refer the link,and Perform the following steps to configure the standby redo log.:-
    http://download.oracle.com/docs/cd/B19306_01/server.102/b14239/create_ps.htm#i1225703
    If the real-time apply feature is enabled, log apply services can apply redo data as it is received, without waiting for the current standby redo log file to be archived. This results in faster switchover and failover times because the standby redo log files have been applied already to the standby database by the time the failover or switchover begins.
    refer the link
    http://download.oracle.com/docs/cd/B19306_01/server.102/b14239/log_apply.htm#i1023371

  • 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;

  • Standby database,Possible network disconnect with primary database

    Hello
    I have a database on linux with standby configured on different server with same os and database version.When i was about clone primary database through OEM,it stuck in the middle and popup for recovery. I restored and recover whole database. Then, the alert log on the standby database shows this error.
    Possible network disconnect with primary database.
    I checked standby databsase,listener is up & running. But archive files are getting into standby database.
    What should i do now? Please anybody can put some light on this.
    Thanks
    Ariz

    Is there anything in the primary alert log? Can you tnsping the standby instance from the primary server, and the primary instance from the standby server?

  • 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

  • Restore primary database using physical standby

    hi,
    i am taking rman backup on production database,we have physical standby.coming month i have to take backup from standby instead of prod db.pls advise me, is it possible to restore and recover production database using standby database backup.if production crashed.pls advise me .i am new to dba.if possible pls provide proper steps.
    Regards
    Faruk

    Faruk.m wrote:
    hi,
    i have to take backup on standby instead of production.failover i can do.but i need to know the recovery procedures from standby.and thank u for reply.i want, is it possible to restore my production controlfile with controlfile backup from standby.
    i tested with my local database ,that below:
    1.backup with controlfile from standby (rman>backup current controlfile)
    2.manual deleted my test db controlfile,tried to restore from backup taken from standby(rman>restore controlfile from '*****************';)
    3.rman>restore database
    3.but it shows error (datafile already exists) ,controlfile tried to create datafiles on standby location.
    my conclusion:above my cmds used to create datafiles on standby becoz i restored with standby controlfile.
    my question:what is wrong with my steps? and how to restore my (prod) controlfile from standby.and bring backup my prod db.
    regards
    farukHi Faruk,
    Sorry my late.
    I can share with you my test.
    It is my standby  database, I connecting with RMAN
    SQL> select database_role, db_unique_name, name from  v$database;
    DATABASE_ROLE      DB_UNIQUE_NAME           NAME
    PHYSICAL STANDBY       stldb                    ADMDB
    [oracle@oel62-x64 oradata]$ rman target /
    Recovery Manager: Release 11.2.0.3.0 - Production on Tue Apr 23 12:23:00 2013
    Copyright (c) 1982, 2011, Oracle and/or its affiliates.  All rights reserved.
    connected to target database: ADMDB (DBID=4063877183, not open)
    RMAN> backup current controlfile;
    Starting backup at 23-APR-13
    Starting implicit crosscheck backup at 23-APR-13
    using target database control file instead of recovery catalog
    allocated channel: ORA_DISK_1
    channel ORA_DISK_1: SID=29 device type=DISK
    Finished implicit crosscheck backup at 23-APR-13
    Starting implicit crosscheck copy at 23-APR-13
    using channel ORA_DISK_1
    Finished implicit crosscheck copy at 23-APR-13
    searching for all files in the recovery area
    cataloging files...
    no files cataloged
    using channel ORA_DISK_1
    channel ORA_DISK_1: starting full datafile backup set
    channel ORA_DISK_1: specifying datafile(s) in backup set
    including current control file in backup set
    channel ORA_DISK_1: starting piece 1 at 23-APR-13
    channel ORA_DISK_1: finished piece 1 at 23-APR-13
    piece handle=/u01/app/oracle/fast_recovery_area/stldb/STLDB/backupset/2013_04_23/o1_mf_ncnnf_TAG20130423T122310_8qdfq19x_.bkp tag=TAG20130423T122310 comment=NONE
    channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
    Finished backup at 23-APR-13
    RMAN> exit
    Recovery Manager complete.
    [oracle@oel62-x64 oradata]$ sqlplus / as sysdba
    SQL*Plus: Release 11.2.0.3.0 Production on Tue Apr 23 12:23:26 2013
    Copyright (c) 1982, 2011, Oracle.  All rights reserved.
    Connected to:
    Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
    With the Partitioning, OLAP, Data Mining and Real Application Testing options
    SQL> shut immediate;
    ORA-01109: database not open
    Database dismounted.
    ORACLE instance shut down.
    SQL> startup nomount;
    ORACLE instance started.
    Total System Global Area  551165952 bytes
    Fixed Size              2230232 bytes
    Variable Size            167774248 bytes
    Database Buffers       377487360 bytes
    Redo Buffers              3674112 bytes
    SQL>
    SQL>
    SQL> exit
    Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
    With the Partitioning, OLAP, Data Mining and Real Application Testing options
    [oracle@oel62-x64 oradata]$ rman target /
    Recovery Manager: Release 11.2.0.3.0 - Production on Tue Apr 23 12:34:58 2013
    Copyright (c) 1982, 2011, Oracle and/or its affiliates.  All rights reserved.
    connected to target database: ADMDB (not mounted)
    RMAN> restore controlfile  from '/u01/app/oracle/fast_recovery_area/stldb/STLDB/backupset/2013_04_23/o1_mf_ncnnf_TAG20130423T122310_8qdfq19x_.bkp';
    Starting restore at 23-APR-13
    using target database control file instead of recovery catalog
    allocated channel: ORA_DISK_1
    channel ORA_DISK_1: SID=19 device type=DISK
    channel ORA_DISK_1: restoring control file
    channel ORA_DISK_1: restore complete, elapsed time: 00:00:01
    output file name=/u01/app/oracle/oradata/stldb/control01.ctl
    Finished restore at 23-APR-13
    RMAN> alter database mount;
    database mounted
    released channel: ORA_DISK_1
    RMAN> exit
    Recovery Manager complete.
    [oracle@oel62-x64 oradata]$ sqlplus / as sysdba
    SQL*Plus: Release 11.2.0.3.0 Production on Tue Apr 23 12:35:31 2013
    Copyright (c) 1982, 2011, Oracle.  All rights reserved.
    Connected to:
    Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
    With the Partitioning, OLAP, Data Mining and Real Application Testing options
    SQL> select database_role, db_unique_name, name from  v$database;
    DATABASE_ROLE      DB_UNIQUE_NAME           NAME
    PRIMARY       stldb                    ADMDB
    As show here, you can backup standby control file, and restore as primary .
    Regars
    Mahir M. Quluzade
    http://www.mahir-quluzade.com

  • Accidentally primary database convert to physical standby

    Hi ,
    Accidentally the primary database was converted to physical standby .Is there any way where it can be revert back to primary other than using the activate command.
    Thanks and Regards,
    Hussain

    Well although I said "alter database open;" and the same is written into the alert.log, the sequence# again starts with 1 - only the bad word "resetlogs" is no longer mentioned :-)
    SQL> select * from v$log;
        GROUP#    THREAD#  SEQUENCE#      BYTES    MEMBERS ARC STATUS
    FIRST_CHANGE# FIRST_TIM
             2          1          5  104857600          1 YES CLEARING_CURRENT
           383710 16-JUN-09
             1          1          4  104857600          1 YES CLEARING
           383708 16-JUN-09
    SQL> alter database activate standby database;
    alter database activate standby database
    ERROR at line 1:
    ORA-01154: database busy. Open, close, mount, and dismount not allowed now
    SQL> recover managed standby database cancel
    Media recovery complete.
    SQL> alter database activate standby database;
    Database altered.
    SQL> alter database open;
    Database altered.
    SQL>  select * from v$log;
        GROUP#    THREAD#  SEQUENCE#      BYTES    MEMBERS ARC STATUS
    FIRST_CHANGE# FIRST_TIM
             1          1          1  104857600          1 NO  CURRENT
           383714 16-JUN-09
             2          1          0  104857600          1 YES UNUSED
                0But it seems to me as if you have no other option anyway.

Maybe you are looking for

  • Restoring my Macbook Pro system to a Time Machine back up?

    Due to having issues turning on/off my a fairly new laptop, I had to reinstall my OS on to it. Before this occured I was backing up my computer onto a WD external hard drive via time machine. Now that the OS is reinstalled and my Macbook Pro is worki

  • How to repeat template layout in new pages?

    I want to make a very simple storyboard layout with three rows dividing the page horizontally and one vertical line a third of the way from the left margin. I did this and saved it as a template but the layout only shows up on the first page.  If I a

  • Site History still showing in Private Browsing

    Ever since updating to to 5.1, I activate Private Browsing and my viewing history still shows. Any way around this, or to fix this? I did not see any new options in Preferences. Thanks in advance, sorry if this has already been answered.

  • Apple Wired Keyboard Causing Bootcamp Boot Freeze

    Hello everyone, I discovered a very serious issue with my late 2009 21.5" iMac. Whenever I would attempt to boot to my Bootcamp partition, the system would freeze on the selection screen. After months of trying various things, including a complete re

  • Tool StarTree from BusinessObjects / Inxight to visualize SAP-CRM Relations

    Hi community, I am very much interessted in the tool StarTree to visualize SAP-CRM relationships between business partners and contact persons. Unfortunately I only found the following description of its features: http://wiki.sdn.sap.com/wiki/display