DBAsupport.com Forums - Powered by vBulletin
Results 1 to 4 of 4

Thread: switchover problem in dataguard

  1. #1
    Join Date
    Jun 2008
    Posts
    1

    switchover problem in dataguard

    Hi all,
    I am working in oracle 9i on windows platform,
    Im struct in dataguard switchover.
    On primary server i write a sql
    > select switchover_status from v$database;
    session active
    even though i make switchover
    >alter database commit to switchover to standby;
    it is completed sucessfully;
    my this server is also standby server
    Now on old standby server i write a sql
    >select switchover_status from v$database;
    session active
    and not switchover pending ,even though i make switchover
    >alter database commit to switchover to primary;
    it still hang ,no error or no message has came from half hr.

    please let me know my both database in standby mode,what should i do??

    Thanks in advance,

    airother

  2. #2
    Join Date
    Jul 2002
    Location
    Lake Worth, FL
    Posts
    1,492

    Lightbulb

    Use the GUI.
    "The person who says it cannot be done should not interrupt the person doing it." --Chinese Proverb

  3. #3
    Join Date
    Aug 2005
    Posts
    3
    May be you have missed some of the steps just follow the steps this will really help you

    Steps to perform switchover with Physical Standby database – DATA GUARD PROCESS


    CURRENT PRODUCTION SERVER (DC)

    SQL> alter system switch logfile;
    SQL> alter system archive log current;


    STANDBY SERVER (DR)

    Disconnect the managed recovery mode in Standby Server.

    SQL> recover managed standby database cancel;
    Media recovery complete.
    SQL> recover standby database;
    AUTO
    SQL> exit

    CURRENT PRODUCTION SERVER (DC)

    1. Verify that it is possible to perform a switchover operation. On the primary
    query the switchover_status column of v$database to verify that switchover
    to standby is possible.

    SQL> select switchover_status from v$database; ###FIRST SWITCHOVER####

    SWITCHOVER_STATUS
    ------------------
    SESSIONS ACTIVE

    In version 9.2.0 this process has been automated with the session shutdown clause that has been added to the alter database commit to switchover command. If SWITCHOVER_STATUS returns SESSIONS ACTIVE then you should either disconnect all sessions manually or when performing step 2 you should append with session shutdown clause. For example:

    SQL> alter database commit to switchover to physical standby with session shutdown;

    Note that the clause also works with the switchover to primary command.

    The SWITCHOVER_STATUS column of v$database can have the following values:

    NOT ALLOWED - Either this is a standby database and the primary database has not been uswitched first, or this is a primary database and there are no standby databases.

    SESSIONS ACTIVE - Indicates that there are active SQL sessions attached to the primary or standby database that need to be disconnected before the switchover operation is permitted.

    SWITCHOVER PENDING - This is a standby database and the primary database
    switchover request has been received but not processed.

    SWITCHOVER LATENT - The switchover was in pending mode, but did not complete
    and went back to the primary database.

    TO PRIMARY - This is a standby database, with no active sessions, that is allowed to switch over to a primary database.

    TO STANDBY - This is a primary database, with no active sessions, that is allowed to switch over to a standby database.

    RECOVERY NEEDED - This is a standby database that has not received the switchover request.

    During normal operations it is acceptable to see the following values for SWITCHOVER_STATUS on the primary to be SESSIONS ACTIVE or TO STANDBY. During normal operations on the standby it is acceptable to see the values of NOT ALLOWED or SESSIONS ACTIVE.

    2. Convert the primary database to the new standby:
    SQL> alter database commit to switchover to physical standby with session shutdown;
    Database altered.
    3. Shutdown the former primary and mount as a standby database:
    SQL> shutdown immediate
    ORA-01507: database not mounted
    ORACLE instance shut down.
    SQL> startup nomount
    ORACLE instance started.
    Total System Global Area 85020944 bytes
    Fixed Size 454928 bytes
    Variable Size 71303168 bytes
    Database Buffers 12582912 bytes
    Redo Buffers 679936 bytes
    SQL> alter database mount standby database;
    Database altered.

    4. Defer the remote archive destination on the old primary:

    SQL> alter system set log_archive_dest_state_2=defer;

    5. Verify that the physical standby can be converted to the new primary:

    SQL> select switchover_status from v$database;
    SWITCHOVER_STATUS
    ------------------
    SWITCHOVER PENDING

    Note that if the status returns SESSIONS ACTIVE then you should append the with session shutdown clause to the command in step 6.

    STANDBY DATABASE SERVER (DR)

    6. Convert the physical standby to the new primary:

    SQL> alter database commit to switchover to primary;
    Database altered.


    7. Shutdown and startup the new primary:

    SQL> shutdown immediate
    ORA-01507: database not mounted
    ORACLE instance shut down.

    SQL> startup
    ORACLE instance started.
    Total System Global Area 85020944 bytes
    Fixed Size 454928 bytes
    Variable Size 71303168 bytes
    Database Buffers 12582912 bytes
    Redo Buffers 679936 bytes
    Database mounted.
    Database opened.
    SQL>
    8. Enable remote archiving on the new primary to the new standby:

    SQL> alter system set log_archive_dest_state_2=enable;


    EX-PRODUCTION (DC)

    9. Start managed recover on the new standby database:

    SQL> recover managed standby database disconnect;
    Media recovery complete.
    SQL> exit








    Actions to be performed on Standby Database in case of Fail over:

    1) Disconnect the managed recovery mode on Standby Server.

    SQL> recover managed standby database cancel;
    Media recovery complete.
    SQL> recover standby database;
    AUTO

    2) Once recovery is complete, activate the standby database to Primary role:

    SQL> Alter database activate standby database;

    Now your previous standby database is the new Primary database.

    3) Now restart the new primary database normally.

    SQL> shutdown immediate

    SQL> startup

    Note: Changes related to IP address need to be done at application level.

  4. #4
    Join Date
    Oct 2008
    Posts
    2
    Quote Originally Posted by Sunil_orcl
    May be you have missed some of the steps just follow the steps this will really help you

    Steps to perform switchover with Physical Standby database – DATA GUARD PROCESS


    CURRENT PRODUCTION SERVER (DC)

    SQL> alter system switch logfile;
    SQL> alter system archive log current;

    .....

    Note: Changes related to IP address need to be done at application level.
    I've found this information really helpful!! I couldn't belive it worked the very first time I run it after having spent so many hours trying things which didn't work!
    Now, I've come across a problem I can't resolve... I'm implementing 'failover' and it worked ... but I just don't know how to make the original Primary Db be a Standby... Would you help me?

    Thanks in advance!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Click Here to Expand Forum to Full Width