database link ORA-01017: invalid username/password
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; logondenied
ORA-02063: preceding line from DATABASE_LINK1
01017. 00000 - “invalid username/password; logondenied”
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 is11g and it by default sets password case sensitive to true. Tosolve the problem, I use double quotes to enclose lower casepassword and user name:
CREATE DATABASE LINK DATABASE_LINK1
CONNECT TO “scott” IDENTIFIED BY“tiger” --double quotes is especially important
USING ‘PDTT’;