5 Replies Latest reply: Aug 9, 2013 1:00 PM by mseberg RSS

    primary db in standby role with ORA-16816: incorrect database role


      We have two RAC nodes of Primary(oraqa) and two RAC nodes of Physicalstandby(orasqa) managed by dataguard broker. fast start failover enabled.  Database version is OS is Redhat 5.3


      Couple days ago our primary oraqa failed over to orasqa by fast start failover, and I could not switchover since some network issue.


      Today the network issue fixed, and I would like to switchover orasqa to oraqa.

      However I got this error:

      ORA-16816: incorrect database role



      a check of database_role in v$database at orasqa shows it is in read only physical standby role.

      So now both oraqa/orasqa are in physical database role.


      How do I fix this issue?


      Help is highly appreciated.

        • 1. Re: primary db in standby role with ORA-16816: incorrect database role



          I'm sorry to say I have zero time right now but I can refer you to these Oracle docs:



          Data Guard Broker Switchover fails With ORA-16665 using Active Data Guard[Article ID 1323789.1]

          DATA GUARD BROKER SWITCHOVER FAILS WITH ORA-16665[Article ID 965142.1]







          Best Regards



          • 2. Re: primary db in standby role with ORA-16816: incorrect database role

            I followed orafaq link and it just stuck on this step:

            SQL> shutdown immediate;

            SQL> startup mount;

            SQL> alter database recover managed standby database;


            I checked alert log, it shows:


            Managed Standby Recovery not using Real Time Apply

            Parallel Media Recovery started with 12 slaves

            Fri Aug 09 15:05:21 2013

            Block change tracking file is current.

            Starting background process CTWR

            Fri Aug 09 15:05:21 2013

            CTWR started with pid=89, OS id=32465

            Block change tracking service is active.

            Media Recovery Waiting for thread 1 sequence 247

            and it just hung there.


            How to proceed from here?


            I tried the same command on old primary, same situation happened.

            • 3. Re: primary db in standby role with ORA-16816: incorrect database role

              Notice in his note where he does a:


              alter database commit to switchover to primary;


              This is the step where he converts the physical standby to a primary. So I would try to convert the database that was last in Primary mode back to primary. If that works you need to do several log switches and make sure you have working Data Guard system before trying the switch again.

              I had this happen without broker and you end up with what amounts to two Standbys. "alter database commit to switchover to primary" in kind of a way of doubling back to where you started.


              If this gives you more trouble I would get Oracle support help ASAP.


              Another way to look at it


              If you were doing this with SQL the short summary might be:


              On Primary


              1. Check switchover_status

              2. Commit database to switchover to standby

              3. Shutdown the database and mount as new standby

              4. Defer the remote archive destination



              At this point you in effect have two standbys and zero primaries.

              If your switchover_status gives a bad answer you have to get the Primary back.

              So instead of moving commands to the other server you proceed on the same server, a double back and you convert what was the primary back to a primary again.


              Then you trouble shoot the issue and try again.


              If you are using broker i would not use SQL unless Oracle Support told me to. Mixing SQL and broker is a bad idea.


              Best Regards