Monday, January 26, 2015

ORA-01031 insufficient privileges during switchover using DGMGRL

Problem
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>



No comments: