Jump to content
vnewdba

DGMGRL ORA-01017: invalid username/password

Recommended Posts

hi frds,
          1 am working on oracle 11.2 database. i have set up data guard. now i m trying yo change role from snapshot to physical and vice versa. it is working fine when i manually run all commands on command prompt but when i run these command from script i get flowing error.

Converting database "test" to a Physical Standby database, please wait...
Operation requires shutdown of instance "TEST" on database "test"
Shutting down instance "TEST"...
ORA-01017: invalid username/password; logon denied

Warning: You are no longer connected to ORACLE.

Please complete the following steps and reissue the CONVERT command:
        shut down instance "TEST" of database "test"
        start up and mount instance "TEST" of database "test"


this is my script

#!/bin/bash
export ORACLE_HOME=/u01/app/oracle/product/11.2.0/dbhome_1
export ORACLE_SID=primedb
dgmgrl <<__EOF >/archive/standby.log
connect sys/pasword@primdb
show configuration
convert database TEST to physical standby
show configuration

please guide me.

regards

Share this post


Link to post
Share on other sites

Hi,

Since these commands work manually, this is obviously, failure to set an environmental variable!

It looks good, but I would run oraenv after exporting ORACLE_SID:

. /use/local/bin/oraenv

also set and export LD_LIBRARY_PATH:

export LD_LIBRARY_PATH=$ORACLE_HOME/lib

Finally, google for some examples of working shell scripts that invoke dgmgrl.

Please let us know your solution!  Thanks.

Good luck!

Share this post


Link to post
Share on other sites

Thank you sir for quick reply.

I tried following script according to your guideline but same result even i tried bash_profile too but still same result.

#!/bin/bash
export ORACLE_HOME=/u01/app/oracle/product/11.2.0/dbhome_1
export ORACLE_SID=primedb
LD_LIBRARY_PATH=/u01/app/oracle/product/11.2.0/dbhome_1/lib
export LD_LIBRARY_PATH
. /usr/local/bin/oraenv
dgmgrl <<__EOF >/archive/standby.log
connect sys/pasword@primdb
show configuration
convert database TEST to physical standby
show configuration

I did so much google but have not find any clue regarding my problem. Please tell me where i am doing wrong.

Regards

 

 

Share this post


Link to post
Share on other sites

Hi,

That’s very curious, dozens of working examples and it won’t work for you.

Have you tried running the script after connecting to the server as root?

Why would you not have support?

You have a service request, not a question, and most busy folks will not have the spare time to help you debug this.

You can hire 3rd party support, but it’s expensive.

You might also try the open Oracle forum, but the members might be abusive:

https://community.oracle.com/community/technology_network_community/database/general_questions

Sorry we could not help you . . . 

 

Share this post


Link to post
Share on other sites

Thanks sir for your reply.

my script is working fine when i run following command

show configuration      #command works fine

convert database test to snapshot standby   #command works fine

convert database test to physical standby   #it gives me error

after so much google i didn't find any script that is doing it using shell script most of them doing just for checking status.

anyways i will keep finding the solution and thank you so much for your precious time if you find any thing that can help me i would be grateful .

and will be back to you if i need your help in future.

Regards

Share this post


Link to post
Share on other sites

this is output of my logfile

Welcome to DGMGRL, type "help" for information.
DGMGRL> [W000 09/28 14:36:58.38] Connecting to database using .
[W000 09/28 14:36:58.43] Checking broker version [BEGIN :version := dbms_drs.dg_broker_info('VERSION'); END;].
[W000 09/28 14:36:58.43] Broker version is '11.2.0.3.0'
Connected.
DGMGRL>
Configuration - dgprimedb

  Protection Mode: MaxPerformance
  Databases:
    primedb     - Primary database
    test - Snapshot standby database

Fast-Start Failover: DISABLED

Configuration Status:
SUCCESS

DGMGRL> Converting database "test" to a Physical Standby database, please wait...
Operation requires shutdown of instance "TEST" on database "test"
Shutting down instance "TEST"...
[W000 09/28 14:36:59.11] Connecting to database using (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=10.30.1.42)(PORT=1521))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=test_DGB)(INSTANCE_NAME=TEST)(UR=A))).
ORA-01017: invalid username/password; logon denied

Warning: You are no longer connected to ORACLE.

Please complete the following steps and reissue the CONVERT command:
        shut down instance "TEST" of database "test"
        start up and mount instance "TEST" of database "test"

when i use “connect /“  i get following error


ORA-01031: insufficient privileges

 

as per my search if i can write a script where i can provide password is second line it might work but i cud not write that script like

dgmgrl>connect sys@primedb

password: my_password

i feel it is related to "/"  if somehow i can avoid this while connecting to sys it might work.

i have same password file, tnsnames.ora, listener.ora but still no luck.

Regards

Share this post


Link to post
Share on other sites

Sir why do i need to bounce TEST before issuing the convert command ? i could not understand .

this command will do all needful steps itself.

Regards

Share this post


Link to post
Share on other sites

That is in your error log, right before you comment on “connect /“.  See it?

Warning: You are no longer connected to ORACLE.

Please . . .

CONVERT command:

        shut down instance "TEST" of database "test"
        start up and mount instance "TEST" of database "test"

Anyway, what did Oracle Support say?

Share this post


Link to post
Share on other sites

sir i have mentioned earlier that i don't have oracle support. and  i meant to comment on connect / is that if i could make a script where i can provide password to dgmgrl on second line so i think it may work , i might be wrong but i have not made this script i tried lot of commands in script but could not provide password to dgmgrl in second line.

i cant understand it must be very common scenario where a database is switching between physical to snapshot and vice versa using strip but i haven't found any single example on google.

Regards

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×