Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Create database link Problem !

Status
Not open for further replies.

Benouche

Programmer
Aug 6, 2002
48
FR
I have a problem accessing to a remote db thru a database link (the 2 dbs are on different servers).
The same user/pwd is defined for both db and
if I simply run CONNECT user/pwd@orcl, it works !

my sql is the following :

CREATE DATABASE LINK dblink USING 'orcl';
SELECT * FROM MAURIENNE@orcl; (-> error msg)
DROP DATABASE LINK orcl;

I get the error
ORA-01017: invalid username/password; logon denied

I also get the same error message with CONNECT TO:
CREATE DATABASE LINK dblink CONNECT TO user BY pwd USING 'orcl';

Any help hotly welcome !!!

Thanks,
Benouche

 

CREATE DATABASE LINK dblink CONNECT TO user BY pwd USING 'orcl'

should be (I think:)

CREATE DATABASE LINK dblink CONNECT TO user IDENTIFIED BY pwd USING 'orcl';

which constitutes a private link.

Public link:

CREATE DATABASE LINK dblink CONNECT TO user USING 'orcl';


SELECT * FROM MAURIENNE@orcl;

could possibly just be (?):

SELECT * FROM MAURIENNE; T. Blom
Information analist
Shimano Europe
tbl@shimano-eu.com
 
Hello Blom0344,

The pwd is entered after 'IDENTIFIED BY' and not 'BY'. You're right, I failed only in copying this in the message.

the error message remains the same.

The public link you wrote won't work, the IDENTIFIED BY is mandatory after CONNECT TO...

finally the remote database name is also mandatory after the table name -> MAURIENNE@orcl.

Does anyone have a solution/Hint/advice for the problem ?

I feel desesperate !!!

Thanks in advance,
Benouche

 
I'm fairly sure that it's the name of the database link that has to be specified after the @ sign. Since you named your link "dblink", that means your query should be

SELECT * FROM MAURIENNE@DBLINK;

The surprising this is that your error is "invalid user/password" instead of something like "db link doesn't exist". Perhaps there is another database link already defined with the name "orcl". If it was defined with an old user or password, that would explain the error you're getting.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top