Moneycontrol Brokerage Recos

Thursday, September 19, 2019

DGMGRL SWITCHOVER fails with ORA-01017: invalid username/password; logon denied



While performing the Data Guard switchover activity for one of the container 2 node RAC primary and standby database (12.1.0.2) by Data Guard Broker (DGMGRL), it failed with error - ORA-01017: invalid username/password; logon denied.



Connect to DGMGRL:

DGMGRL> connect /
Connected as SYSDG.


DGMGRL>


View the details of current Data Guard Configuration:


DGMGRL> show configuration

Configuration - CDB_CONFIG

  Protection Mode: MaxPerformance
  Members:
  cdbad - Primary database
    cdb1  - Physical standby database

Fast-Start Failover: DISABLED

Configuration Status:
SUCCESS   (status updated 30 seconds ago)

DGMGRL>



Let's validate if the primary and standby databases are ready for  switchover operation.

DGMGRL> validate database cdbad

  Database Role:     Physical standby database
  Primary Database:  cdb1

  Ready for Switchover:  Yes
  Ready for Failover:    Yes (Primary Running)

  Flashback Database Status:
    cdb1:   Off
    cdbad:  Off

DGMGRL>



DGMGRL> validate database cdb1

  Database Role:    Primary database

  Ready for Switchover:  Yes

  Flashback Database Status:
    cdb1:  Off

DGMGRL>


Above you see that both the primary and standby databases are ready for the switchover.

Let's try to perform the switchover to standby as follows:


DGMGRL> switchover to cdb1
Performing switchover NOW, please wait...
Operation requires a connection to instance "CDB1" on database "cdb1"
Connecting to instance "CDB1"...
ORA-01017: invalid username/password; logon denied

Warning: You are no longer connected to ORACLE.

        connect to instance "CDB1" of database "cdb1"

DGMGRL> 


Oooops !! it failed, I validated the connection from primary to standby and vice versa and things look cool out there.... no issues with connectivity in either ways.

then I realized that when we connect to dgmgrl as "DGMGRL>connect /" then it connects with SYSDG user not with SYS user.

I tried to validate if SYSDG user is using the password file for remote authentication but..... this user is not assigned to password file to do the remote password file authentication. Only SYS user is there in the password file.


SQL> select * from v$pwfile_users;

USERNAME                       SYSDB SYSOP SYSAS SYSBA SYSDG SYSKM     CON_ID
------------------------------ ----- ----- ----- ----- ----- ----- ----------
SYS                            TRUE  TRUE  FALSE FALSE FALSE FALSE          0




Resolution : In this case, try to connect with SYS user at DGMGRL as below and perform the switchover operation since SYS user is already added in the password file and its connectivity is fine from both primary and standby directions.


DGMGRL> connect sys
Password:*******
Connected as SYSDG.
DGMGRL>




DGMGRL> switchover to cdb1
Performing switchover NOW, please wait...
Operation requires a connection to instance "CDB1" on database "cdb1"
Connecting to instance "CDB1"...
Connected as SYSDBA.
New primary database "cdb1" is opening...
Oracle Clusterware is restarting database "cdbad" ...
Switchover succeeded, new primary is "cdb1"
DGMGRL>

Great.....!! switchover operation successful now !!

Why?

because we connected as SYS user and it is using the password file for remote authentication !!



DGMGRL> show configuration

Configuration - CDB_CONFIG

  Protection Mode: MaxPerformance
  Members:
  cdb1  - Primary database
    cdbad - Physical standby database

Fast-Start Failover: DISABLED

Configuration Status:
SUCCESS   (status updated 61 seconds ago)

DGMGRL>




DGMGRL> show database cdb1

Database - cdb1

  Role:               PRIMARY
  Intended State:     TRANSPORT-ON
  Instance(s):
    CDB1
    CDB2

Database Status:
SUCCESS

DGMGRL>



New container standby is in sync...

DGMGRL> show database cdbad

Database - cdbad

  Role:               PHYSICAL STANDBY
  Intended State:     APPLY-ON
  Transport Lag:      0 seconds (computed 0 seconds ago)
  Apply Lag:          0 seconds (computed 0 seconds ago)
  Average Apply Rate: 6.00 KByte/s
  Real Time Query:    OFF
  Instance(s):
    cdbad1
    cdbad2 (apply instance)

Database Status:
SUCCESS

DGMGRL>


SQL> show pdbs

    CON_ID CON_NAME                       OPEN MODE  RESTRICTED
---------- ------------------------------ ---------- ----------
         2 PDB$SEED                       MOUNTED
         3 PDB1                           MOUNTED
         5 PDB3                           MOUNTED
SQL>



Hope it helps, subscribe to this blog to stay updated on latest Oracle Technologies and new articles.

Twitter : https://twitter.com/rajsoft8899
Linkedin : https://www.linkedin.com/in/raj-kumar-kushwaha-5a289219/





No comments:

Post a Comment