Home > Oracle > ORA-01017: invalid username/password; logon denied

ORA-01017: invalid username/password; logon denied

Today I faced a not too funny challenge. We had to downgrade the oracle driver (i.e. ODP.NET) from version 11.2 to 10.2 and guess what? I got the “ORA-01017: invalid username/password; logon denied” error. It turned out that ODP.NET 10.2 and prior uses case insensitive passwords and will convert the password to upper case when connecting to the database.

To fix the issue we had to wrap the password with double quotes

Data Source=MyTsn; User ID=MyUserId; Password=”mypassword”

Categories: Oracle Tags:
  1. Cliff
    October 3, 2011 at 10:18 am

    Thank you for posting this – I had the exact same scenario and your research saved me a lot of time.

    • Lajak Technologies Inc
      October 3, 2011 at 10:19 am

      My pleasure. It drove me nuts as well 🙂

  2. suma
    November 21, 2011 at 5:39 am


    I am working on c#.net code. From c# i am passing connection string
    Like(connection_string = “Data Source=” + DSname+ “;User Id=” + userName + “;Password=” + password + “;Pooling=false;”;).
    while connecting to the oracle11 database it’s giving “ORA-01017: invalid username/password; logon denied”. To fix this issue as per this solution i tried to put password in the double quotes like this(Password=”” + password + “”;) here it’s showing error is (; expected).
    Pls suggest me to fix this issue.


    • Lajak Technologies Inc
      November 21, 2011 at 9:20 am

      You need to write Password=””” + password + “”” or use string.format(“Password={0}{1}{0}”,”””,password)

      • suma
        November 22, 2011 at 1:50 am


        I have tried this above solution

        (Password=””” + password + “”” or use string.format(“Password={0}{1}{0}”,”””,password)

        it’s not working. Before it worked fine after they had migrated from pre-11g to oracle 11g version. Ater this problem is happend becoz of 11g-casesensitive. And also i tried to convert this case to upper & lower……but same error is coming. Pls help me to solve this.


      • Lajak Technologies Inc
        November 23, 2011 at 10:06 am

        I am not sure what to say. But the issue existed, to my knowledge, in and prior to ODP.NET version 10.2. What version of ODP are you using? Can you login to the database using a tool? Could it be that your DBA changed the password or didn’t migrate your rights?

  3. suma
    December 5, 2011 at 2:53 am


    Thanks for your reply.Actually my application was developed in .net framework2.0(this is console appln)version at that time they used oracle10g data base and it was worked fine.After some years they migrated from oracleDB 10g(ODP.NET version is: to oracleDB 11g(ODP.NET version is: i checked to login oracleDB from sqlplus it is connecting to the data base(EX:Connected to oracle DB11g enterprise edition when i connect from the source code it’s giving ORA-1017 Invalid username/password;login denied error.I am using currently visual studio 2008 & oracle 11g client and ODP.NET version is: to coonect with oracle11g DB. And also because of oracle11g case sensitive i added double quotes in the connection string from c# code( connection_string = “Data Source=” + ds+ “;User Id=” + “” + userName + “” + “;Password= ” + “” + password + “” + ” ;Pooling=false;”;
    ) .But then it’s giving same error

    If any one identify this issue please help me. It’s very urgent


  4. Shahid Mahmood
    February 27, 2012 at 1:24 am

    Wonderful !!! helped me alot!!

  5. Shri
    March 5, 2013 at 7:43 am

    Thanks a ton, it worked for me !!

    • Lajak Technologies Inc
      March 11, 2013 at 11:36 pm

      Really happy that it helped 🙂

  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: