Wednesday, December 13, 2017

Unable to Connect to Database: Incorrect location for tnsnames.ora in OID 11g

Problem

If you are trying to execute the oidpasswd command, for example:
$ORACLE_HOME/ldap/bin/oidpasswd connect=OIDDB create_wallet=true 
$ORACLE_HOME/ldap/bin/oidpasswd connect=OIDDB change_oiddb_pwd=true
You receive the following error on the prompt:
Unable to Connect to Database: Incorrect location for tnsnames.ora (derived from ORACLE_INSTANCE) or Incorrect TNS Connect string or Invalid Password

Solution

1. This is because you must set the TNS_ADMIN environment variable:
export ORACLE_HOME=/u01/app/oracle/middleware/Oracle_OID 
export ORACLE_INSTANCE=/u01/app/oracle/middleware/asinst_1 
export TNS_ADMIN=$ORACLE_INSTANCE/config 
export PATH=$ORACLE_HOME/bin:$ORACLE_HOME/ldap/bin:$ORACLE_INSTANCE/bin:$PATH
2. If this does not work, try the following:
cp $TNS_ADMIN/tnsnames.ora $ORACLE_HOME/network/admin
3. If this does not work, the problem is with the "ods" account on the database.
a. Try to connect to the "ods" user using Oracle SQL Developer.

b. Try to connect to the "ods" user using SQL*Plus on the OAM server:  
sqlplus ods/welcome1@oiddb
c. Then try resetting the password again or create a new wallet

 
Applicable Versions
  • Oracle Internet Directory (OID) 11g

 

No comments: