Skip to Main Content

Database Software

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Converting standby database with dgmgrl and no password

Peter de GrootFeb 24 2011 — edited Mar 3 2011
Hi,

I have a DG configuration (11.1.0.7) with a primary database and two standby databases. For my own convenience, everything is located on one AIX machine, and every command I issue, is issues locally.
The standby databases are intended to get converted from physical to snapshot standby, and vice versa, twice a day. The easiest way to do so, is by using the dgmgrl CONVERT command.
The configuration we start with (database overview only):
  Databases:
    DGPRIM - Primary database
    DGSBY1 - Snapshot standby database
    DGSBY2 - Physical standby database
From here, we issue the following:
CONVERT DATABASE 'DGSBY2' TO SNAPSHOT STANDBY;
CONVERT DATABASE 'DGSBY1' TO PHYSICAL STANDBY;
which leaves us with the following configuration:
  Databases:
    DGPRIM - Primary database
    DGSBY1 - Physical standby database
    DGSBY2 - Snapshot standby database
A few hours later we do the same thing in reverse, which gets us back to the initial configuration.

This works fine when it's done manually, connected to any database in the configuration, using username/password. We have to use a password because the conversion to physical standby shuts down the database, and returns ORA-01031 (insufficient privileges) if we connect using just /.

However, we want to schedule the conversions, and wouldn't want to use the password for a SYSDBA user in the script. The way we usually do this, is by adding credentials to a secure password store using the mkstore command, so that's what I've done for user SYS. I can use it to connect to either database using sqlplus and dgmgrl, without a password:
sqlplus /@DGPRIM as sysdba
 dgmgrl /@DGPRIM
This is different from the old way of connecting without a password, because we now use sql-net to connect to the connection identifier in tnsnames.ora.

However, connecting like this won't enable dgmgrl to convert the snapshot database to physical database. The same error occurs that we get when connecting with just a / to a local database, even when I connect to the database I'm converting:
DGMGRL> convert database 'DGSBY1' to physical standby;
Converting database "DGSBY1" to a Physical Standby database, please wait...
Operation requires shutdown of instance "DGSBY1" on database "DGSBY1"
Shutting down instance "DGSBY1"...
ORA-01031: insufficient privileges
 
You are no longer connected to ORACLE
Please connect again.
Unable to shut down instance "DGSBY1"
You must shut down instance "DGSBY1" manually
Operation requires startup of instance "DGSBY1" on database "DGSBY1"
You must start instance "DGSBY1" manually
Failed to convert database "DGSBY1"
It looks like dgmgrl doesn't use the tnsnames.ora entries to connect to a database to issue a shutdown, and therefore ignores the entries in the secure password store. I've tried some options like adding the DGMGRL and DGB entries for all databases to the secure password store with mkstore, but that doesn't help.

Has anyone got any idea if it's possible to do this passwordless using a secure password store, and what entries I should add to the store and to tnsnames.ora. Or should I just forget the DG Broker for now, and script this in sqlplus instead?

Regards,
Peter.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 31 2011
Added on Feb 24 2011
10 comments
3,989 views