Oracle database link error: ORA-01017: invalid username/password; logon denied

January 11, 2010 – 4:43 pm

Today I create a database link in Oracle as follows

CREATE DATABASE LINK DATABASE_LINK1
CONNECT TO SCOTT IDENTIFIED BY TIGER
USING ‘PDTT’;

When I try to use the link I get an error.

select * from dual@DATABASE_LINK1;

SQL Error: ORA-01017: invalid username/password; logon denied
ORA-02063: preceding line from DATABASE_LINK1
01017. 00000 -  “invalid username/password; logon denied”

At first I thought there was problem with service name ‘PDTT’, but when I used sqlplus to connect using PDTT it succeeded (i.e. sqlplus scott/tiger@PDTT).

The problem turns out to be that the DB I try to connect to is 11g and it by default sets password case sensitive to true. To solve the problem, I use double quotes to enclose lower case password and user name:

CREATE DATABASE LINK DATABASE_LINK1
CONNECT TO “scott” IDENTIFIED BY “tiger”
USING ‘PDTT’;

  1. 21 Responses to “Oracle database link error: ORA-01017: invalid username/password; logon denied”

  2. Hello..

    Thanks alot.. It really helped me

    Pushpen

    By Pushpendr on Mar 30, 2010

  3. Awesome! I was having the same problem and was ready to toss the server out of the window. This solved it.

    Thanks for sharing!

    By Gabri van Lee on May 17, 2010

  4. Thanks a lot

    I spent much time with this problem and i was desperate.

    It works.

    By Carlos on Jun 9, 2010

  5. Thanks a lot.. spent lot of time browsing through internet for it .. Was really helpful.. Indeed the connecting database was Oracle 11g

    By Khyati on Jun 25, 2010

  6. Awesome tip! Saved me from some hair pulling.

    By Rhonda on Dec 3, 2010

  7. Great tip — thanks! This solved my issue.

    By mark on Apr 25, 2011

  8. Good one! really helpful.

    By Andy on Jul 21, 2011

  9. Thanks,

    This really saved my day…

    By Phuti on Aug 2, 2011

  10. Thanxs!!!

    By Anon on Oct 5, 2011

  11. Thanks a lot, that was the answer! I spent the whole day getting crazy why it wouldn’t work. Thanks!

    By Ben on Nov 6, 2011

  12. Hi,

    This was really helpful. This solved my issue.

    By Prakash on Jan 3, 2012

  13. Spot on, thanks!

    By dfgad on Mar 14, 2012

  14. Christ. I just spend the entire day trying to fix a db link after we moved the db from one server to another.

    And this advice turns out to be the solution (new db on new server is 11g)!

    Thx!

    By Nikolaj on Apr 2, 2012

  15. I am have two Data base working on different servers. The Database link was established and working OK. However when I changed the Server due to breakdown to another server, the Database link is not establised.
    The message Invalid user/password Logon denied is appearing. Please help me
    M M Vakil, Western Railway

    By M M VAKIL on Apr 11, 2012

  16. It seems that there is no need to use double quotes around password when you create dblink.

    But what about user was created in lowercase (charcase of password does not matter), how dblink should be created in this case?

    By Yuri on Jun 22, 2012

  17. But there are variations between versions, 10.2.0.4 does not need double quotes around password, but 10.2.0.3 does need

    By Yuri on Jun 22, 2012

  18. Great Post, fetch me out from gray area

    By Rahul Khandelwal on Aug 3, 2012

  19. thanks very much buddy…………i could save my lot of time by using this prompt solution

    By ajit vasudev jadhav on Aug 15, 2012

  20. Great, Many thanks, it works.

    By OSAMMAN on Aug 17, 2012

  21. Muchas Gracias,

    Estuve como un dia tratando de averiguar cual es el problema, solo se necesita poner comillas dobles al usuario y password

    Muchas Gracias

    By Angel Davila on Oct 1, 2012

  22. Thanks this solved one of my issue.

    By Andre on Nov 5, 2012

Post a Comment