Monday, January 26, 2015

ORA-01031 insufficient privileges during switchover using DGMGRL

If you have Dataguard broker configured in your Dataguard environment and you are doing a switchover using DGMGRL, you may see ORA-013031 as you can see in the following.

[oracle@SGPvGMSIMDG01 ~]$ dgmgrl sys /
DGMGRL> switchover to mydb_prod
Performing switchover NOW, please wait...
New primary database "mydb_prod" is opening...
Operation requires shutdown of instance "mydb" on database "mydb_stby"
Shutting down instance "mydb"...
ORA-01031: insufficient privileges

Warning: You are no longer connected to ORACLE.

Please complete the following steps to finish switchover:
        shut down instance "mydb" of database "mydb_stby"
        start up and mount instance "mydb" of database "mydb_stby"

The reason for this error is logging into the DGMGRL using OS authentication instead of by supplying the password.

Solution
You should always log in as user sys with password while logging in to DGMGRL utility before initiating any maintenance tasks on your Dataguard. Following is the example

[oracle@SGPvGMSIMDG01 ~]$ dgmgrl sys/password
DGMGRL for Linux: Version 11.2.0.3.0 - 64bit Production

Copyright (c) 2000, 2009, Oracle. All rights reserved.

Welcome to DGMGRL, type "help" for information.
Connected.
DGMGRL> show configuration

Configuration - MYDBDG

  Protection Mode: MaxPerformance
  Databases:
    mydb_prod - Primary database
    mydb_stby - Physical standby database

Fast-Start Failover: DISABLED

Configuration Status:
SUCCESS

DGMGRL> switchover to mydb_stby
Performing switchover NOW, please wait...
New primary database "mydb_stby" is opening...
Operation requires shutdown of instance "mydb" on database "mydb_prod"
Shutting down instance "mydb"...
ORACLE instance shut down.
Operation requires startup of instance "mydb" on database "mydb_prod"
Starting instance "mydb"...
ORACLE instance started.
Database mounted.
Switchover succeeded, new primary is "mydb_stby"
DGMGRL>

6 comments:

  1. Tried like above..but still am getting same exception.. please suggest...

    ReplyDelete
    Replies
    1. Try connecting with primary and standby database from SQLPLUS using same TNS entry to confirm if you are supplying correct SYS password and password is same on both primary and standby.

      Delete
    2. SQL> /

      DATABASE_ROLE OPEN_MODE
      ---------------- --------------------
      PRIMARY READ WRITE

      SQL> conn sys@prod as sysdba
      Enter password:
      Connected.
      SQL> conn sys@stand as sysdba
      Enter password:
      Connected.
      SQL>



      SQL> /

      DATABASE_ROLE OPEN_MODE
      ---------------- --------------------
      PHYSICAL STANDBY MOUNTED

      SQL> conn sys@stand as sysdba
      Enter password:
      Connected.
      SQL> conn sys@prod as sysdba
      Enter password:
      Connected.
      SQL>



      Password is same on both servers and replication is working fine. if password is not matched the how the replication is working fine.

      Please suggest.......

      Delete
    3. I am sorry Vinod I have no clue. One last thing, do not use "as sysdba" while connecting as SYS, if you are using this.

      Delete
    4. Following below steps.

      [oracle@rac2 ~]$ dgmgrl
      DGMGRL for Linux: Version 11.2.0.1.0 - 64bit Production

      Copyright (c) 2000, 2009, Oracle. All rights reserved.

      Welcome to DGMGRL, type "help" for information.
      DGMGRL> connect sys@stand
      Password:
      Connected.
      DGMGRL> switchover to prod;
      Performing switchover NOW, please wait...
      New primary database "prod" is opening...
      Operation requires shutdown of instance "stand" on database "stand"
      Shutting down instance "stand"...
      ORA-01109: database not open

      Database dismounted.
      ORACLE instance shut down.
      Operation requires startup of instance "stand" on database "stand"
      Starting instance "stand"...
      ORA-01031: insufficient privileges

      Warning: You are no longer connected to ORACLE.

      Please complete the following steps to finish switchover:
      start up and mount instance "stand" of database "stand"

      Delete
    5. I am afraid I can not help any further. As a last resort, try copying password file from primary host to the DG host and try switchover again,.

      Delete

Popular Posts - All Times