My Oracle Support Banner

Data Guard switchover fails with ORA-1031 when using wallets (Doc ID 1405343.1)

Last updated on FEBRUARY 01, 2020

Applies to:

Oracle Database - Enterprise Edition - Version 10.2.0.5 to 11.2.0.3 [Release 10.2 to 11.2]
Oracle Database Cloud Schema Service - Version N/A and later
Oracle Database Exadata Express Cloud Service - Version N/A and later
Oracle Database Exadata Cloud Machine - Version N/A and later
Oracle Database Cloud Exadata Service - Version N/A and later
Information in this document applies to any platform.

Symptoms

NOTE: In the images and/or the document content below, the user information and environment data used represents fictitious data from the Oracle sample schema(s), Public Documentation delivered with an Oracle database product or other training material. Any similarity to actual environments, actual persons, living or dead, is purely coincidental and not intended in any manner.

For the purposes of this document, the following fictitious environment is used as an example to describe the procedure:

PRIMARY : prmdb
STANDBY : stbydb
Instance: Prmdb1
Wallet location: /home/oracle/wallet
ORACLE_HOME: /u01/app/oracle/product/11.2.0
SID_NAME: stby1, prm1

TNS Connection: stbydb_DG, prmdb_DG, stbydb_DG, prmdb_DG

 Host Name: prmdb-scan, prmdb-host, stdbydb-scan, stdby-host

=======================================

 

Data Guard configuration using wallets to connect to the database passwordless.

PRIMARY : prmdb
STANDBY : stbydb

Wallet was setup correctly and both sqlplus and dgmgrl connections are successful, however when trying to perform a switchover using the DG broker it fails with ORA-1031 when the broker tries to connect :

dgmgrl /@prmdb_DG

DGMGRL> switchover to 'stbydb'
Performing switchover NOW, please wait...
New primary database "stbydb" is opening...
Operation requires shutdown of instance "Prmdb1" on database "prmdb"
Shutting down instance "Prmdb1"...
ORA-01031: insufficient privileges

Warning: You are no longer connected to ORACLE.

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

Changes

There are no additional changes other than the fact that wallets are used, and they are configured correctly.

The credentials for the primary and standby databases are created (added to the wallet).

Wallet location: /home/oracle/wallet

mkdir -p /home/oracle/wallet

mkstore -wrl /home/oracle/wallet/ -create
Enter wallet password: welcome1

mkstore -wrl /home/oracle/wallet/ -createCredential stbydb_DG sys change_on_install
mkstore -wrl /home/oracle/wallet/ -createCredential prmdb_DG sys change_on_install

Wallet information is shown correctly :
mkstore -wrl /home/oracle/wallet -viewEntry oracle.security.client.connect_string1
mkstore -wrl /home/oracle/wallet -viewEntry oracle.security.client.username1
mkstore -wrl /home/oracle/wallet -viewEntry oracle.security.client.password1

mkstore -wrl /home/oracle/wallet -viewEntry oracle.security.client.connect_string2
mkstore -wrl /home/oracle/wallet -viewEntry oracle.security.client.username2
mkstore -wrl /home/oracle/wallet -viewEntry oracle.security.client.password2

Oracle Net config files are also setup correctly:
sqlnet.ora
NAMES.DIRECTORY_PATH= (TNSNAMES, EZCONNECT)
WALLET_LOCATION =
(SOURCE=(METHOD=FILE)
(METHOD_DATA=(DIRECTORY=/home/oracle/wallet/))
)
SQLNET.WALLET_OVERRIDE = TRUE

listener.ora
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(GLOBAL_DBNAME = stbydb_dgmgrl)
(ORACLE_HOME = /u01/app/oracle/product/11.2.0)
(SID_NAME = stby1)
)
(SID_DESC =
(GLOBAL_DBNAME = prmdb_dgmgrl)
(ORACLE_HOME = /u01/app/oracle/product/11.2.0)
(SID_NAME = prm1)
)
)

tnsnames.ora
stbydb =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = stbydb-scan)(PORT = 1521))
(CONNECT_DATA = (SERVER = DEDICATED)(SERVICE_NAME = stbydb))
)

prmdb =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = prmdb-scan)(PORT = 1521))
(CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = prmdb))
)

stbydb_DG =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = stbydb_host)(PORT = 1521))
(CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = stbydb))
)

prmdb_DG =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = prmdb_host)(PORT = 1521))
(CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = prmdb))
)


Testing passwordless connection using wallets:
sqlplus /@stbydb_DG as sysdba
sqlplus /@prmdb_DG as sysdba
dgmgrl /@stbydb_DG
dgmgrl /@prmdb_DG


Cause

To view full details, sign in with your My Oracle Support account.

Don't have a My Oracle Support account? Click to get started!


In this Document
Symptoms
Changes
Cause
Solution

My Oracle Support provides customers with access to over a million knowledge articles and a vibrant support community of peers and Oracle experts.