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

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’;

23 thoughts on “Oracle database link error: ORA-01017: invalid username/password; logon denied

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

  2. 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!

  3. 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

  4. 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?

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

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

  7. 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

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>