6 Replies Latest reply: Apr 6, 2013 7:12 PM by $phinx19 RSS

    Switchover in Standby database.

    $phinx19
      Hi All,

      DB:11g
      OS:AIX

      If I am performing a switchover for a Physical standby database, and I have successfully converted my Primary database to new Standby database and when I am trying to convert my Old Standby database to a new Primary database and let us say due to some error (the error is not the important here) I am not able to switch my Old standby database to a new primary database.

      What should be my possible steps to undo the switchover or to get me out of this hole?


      Regards,
      Sphinx
        • 1. Re: Switchover in Standby database.
          Mohamed ELAzab
          Hello $phinx19,

          I want to ask you something.Do you face this situation or you are assuming that this situation may occur?.when you do switch over that means you are switching the roles of your database and that means that the primary database will be standby and the standby will be primary.
          If you are trying to do this and meet an error then the switch over is not complete and you have to recover from the situation/Error.The errors vary from database to another but that means that the primary will stay as it is and the standby will stay as it is.

          General guidelines to follow from the documentation before doing the switch over:
          http://docs.oracle.com/cd/B19306_01/server.102/b14230/sofo.htm
          Please have a look at the part 5.3.1 Before You Perform a Switchover Operation

          BR
          Mohamed ElAzab
          http://mohamedelazab.blogspot.com/
          • 2. Re: Switchover in Standby database.
            $phinx19
            Hi Mohamed,

            Thanks!

            Well, I was asked this question in an interview and I cross questioned him "What is the error?". He said that the error is irrelevant and you have to give me back a Primary database in minimum time.
            Since the original primary is now converted to a standby database and the old standby database is not getting converted to Primary database, so what steps I will have to do to get a Primary database in minimum time, at this moment even if I do not have a standby database that will do as per the interviewer.

            This is my concern, finding the error is secondary which I can dig once my Primary is back.

            In a nutshell, I just want to know if in the middle of a switchover that I have to perform in a time constrain, if my switchover fails as I have explained above. What approach or steps that I have to take to undo the swicthover or at least get my Primary back.

            Hope it calirifes.

            Regards,
            Sphinx
            • 3. Re: Switchover in Standby database.
              mseberg
              Hello;

              If you are at the point where you have two Standby's then you can perform this on the Primary :

              1. alter database commit to switchover to primary;
              2. shutdown immediate
              3. startup
              4. Set system set log_archive_dest_state_2=enable to enable as needed.

              So instead of moving forward, you perform steps 1 - 4 on the Primary you were about to convert to the new standby.



              You may have to shutdown the Standby and restart the apply there depending upon where you error out.


              Best Regards

              mseberg
              • 4. Re: Switchover in Standby database.
                $phinx19
                Hi Msberg,

                Thanks.

                I told the same procedure to the interviewer but he disagreed.

                One more method that I can think of is as follows:
                1.As now we have two standby database, I will keep the old standby as it is and at the new standby database (X-primary), I will activate it
                alter database activate standby database;
                Take a bounce and start the database in open mode, so I will have a primary and my standby database is already there. This seems like an interim solution but I am not sure.

                Regards
                Sphinx
                • 5. Re: Switchover in Standby database.
                  mseberg
                  Mine is based on a test.

                  So he can disagreed, but he'd be wrong. Have tested this twice on both Oracle 10 and 11.

                  But then, he's just an interviewer. Still have doubts? Test it yourself. I ran into this on a few of my swtchover test and this is how I recovered.

                  Sorry you are dealing for such a hard case.

                  Best Regards

                  mseberg
                  • 6. Re: Switchover in Standby database.
                    $phinx19
                    Thanks