Need to connect web app through ODP.NET 10.1.0.400 to Oracle 11g

miyahira
miyahira used Ask the Experts™
on
Hello,

I have this problem, I need to connect an ASP.NET web app through ODP.NET 10.1.0.400 to an Oracle 11g, but I can't.
I can however connect via TOAD to Oracle 11g.

Server: Windows Server 2003 32 bits
Name of server: jne-prueba
Name of Instance: Prueba

This is tnsnames.ora in server jne-prueba:
--------------------------------------
PRUEBA =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = jne-prueba.DOMINTERN0JNE.LOCAL)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = prueba)
    )
  )

ORACLR_CONNECTION_DATA =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
    )
    (CONNECT_DATA =
      (SID = CLRExtProc)
      (PRESENTATION = RO)
    )
  )
---------------------------------------

This is Listener.ora in server jne-prueba:

SID_LIST_LISTENER =
  (SID_LIST =
    (SID_DESC =
      (SID_NAME = CLRExtProc)
      (ORACLE_HOME = D:\app\oracle\product\11.2.0\dbhome_1)
      (PROGRAM = extproc)
      (ENVS = "EXTPROC_DLLS=ONLY:D:\app\oracle\product\11.2.0\dbhome_1\bin\oraclr11.dll")
    )
  )

LISTENER =
  (DESCRIPTION_LIST =
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = TCP)(HOST = jne-prueba)(PORT = 1521))
      (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
    )
  )

ADR_BASE_LISTENER = D:\app\oracle

----------------------------

This is sqlnet.ora in jne-prueba:
SQLNET.AUTHENTICATION_SERVICES = (NONE)

-------------------------------

These files are in:
D:\app\oracle\product\11.2.0\dbhome_1\NETWORK\ADMIN

-------------------------------

tnsnames.ora entry in PC where ASP:NET app is:
DESAOPINT =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = jne-prueba)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = dedicated)
      (SERVICE_NAME = prueba)
    )
  )

ConnectionString in ASP.NET:
<add key="ConnectionString" value="user id=orgpol;data source=desaopint;password=xxx;"/>

I got error:

ORA-1017: invalid username/password; logon denied

I think the problem is with ".DOMINTERN0JNE.LOCAL". How can I connect without problem?
As I said, with Toad I can connect without problem.
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Most Valuable Expert 2012
Distinguished Expert 2018

Commented:
I don't think the ".DOMINTERN0JNE.LOCAL" would cause an ORA-1017 unless it causes you to look at a different server.

Make the ODP.Net oracle_home tnsnames.ora file look like the one toad uses.
Most Valuable Expert 2012
Distinguished Expert 2018

Commented:
Also check the sqlnet.ora in the ODP.Net oracle home.

Author

Commented:
Toad and asp.net web app use the same tnsnames.ora in my PC:

D:\oracle\product\10.2.0\client_1\network\ADMIN\tnsnames.ora
Ensure you’re charging the right price for your IT

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden using our free interactive tool and use it to determine the right price for your IT services. Start calculating Now!

Author

Commented:
In my PC where asp.net is:

D:\oracle\product\10.2.0\client_1\network\ADMIN\sqlnet.ora:

# sqlnet.ora Network Configuration File: D:\oracle\product\10.2.0.\client_1\network\admin\sqlnet.ora
# Generated by Oracle configuration tools.

SQLNET.AUTHENTICATION_SERVICES= (NTS)

NAMES.DIRECTORY_PATH= (TNSNAMES, EZCONNECT)


Most Valuable Expert 2012
Distinguished Expert 2018

Commented:
Just to confirm:  You can connect using Toad using:
user: orgpol
password: xxx
server: DESAOPINT


Did you install sqlplus?

from a command prompt try:
sqlplus orgpol/xxx@DESAOPINT

Author

Commented:
In my client PC, where toad and asp.net are, I only installed ODP.NET 10.0. So I didn't install sqlplus or Oracle Client.

Author

Commented:
However, using Net Manager I can connect successfully.
Most Valuable Expert 2012
Distinguished Expert 2018

Commented:
In: D:\oracle\product\10.2.0\client_1\network\ADMIN

rename the tnsnames.ora and sqlnet.ora files to some backup name and copy the ones from the database server.

>>ConnectionString in ASP.NET:

This is an example from a web.config.  Are you 100% sure the .Net code is not hard coding a different username and password on some connections?

Author

Commented:
I copied  tnsnames.ora and sqlnet.ora files from server to my PC. Same result:
ORA-1017: invalid username/password; logon denied

I'm 100% sure that there is no hardcoding.

If I connect to  Oracle database 10.2.0.4.0 in other servers, I got no problem. The problem is with this oracle 11g.

Most Valuable Expert 2012
Distinguished Expert 2018
Commented:
>>The problem is with this oracle 11g.

Ah...  I missed this in the thread:  in 11g passwords are case sensitive by default.  

If you know the proper case for the password change the web.config to (notice I changed the initial double quotes to singles):

<add key="ConnectionString" value='user id=orgpol;data source=desaopint;password="xXxXx";'/>

or disable case sensitive passwords (not recommended) by setting sec_case_sensitive_logon to FALSE

Author

Commented:
That was it!

I changed the password for upper letters:

alter user orgpol identified by XXX;

<add key="ConnectionString" value="data source=PRUEBA;user id=ORGPOL;password=XXX"/>

And then it connected.

However, if password is in lower letters, why can't connect?

Most Valuable Expert 2012
Distinguished Expert 2018

Commented:
>>However, if password is in lower letters, why can't connect?

I said that:  in 11g passwords are now case sensitive by default.

In older version Oracle automatically took whatever you provided for a username and password and converted it to uppercase behind the scenes.

Author

Commented:
Thank you slightwv

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial