Home » RDBMS Server » Server Administration » dblink Problem
dblink Problem [message #53669] Fri, 04 October 2002 00:44 Go to next message
Benouche
Messages: 1
Registered: October 2002
Junior Member
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 !!!
Re: dblink Problem [message #53673 is a reply to message #53669] Fri, 04 October 2002 11:06 Go to previous message
Grant
Messages: 578
Registered: January 2002
Senior Member
I suspect you have an ORCL DB on both servers. Make sure you do not have two aliases for ORCL in your tnsnames.ora file. It should look like this if u do:

ORCLA =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = SERVERA)(PORT = 1521))
)
(CONNECT_DATA =
(SID = orcl)
)
)
ORCLB =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = SERVERB)(PORT = 1521))
)
(CONNECT_DATA =
(SID = orcl)
)
)

You should be able to ping, tnsping, or use sqlplus before creating/using a DB link (if going in either direction both tnsnames.ora file need to be updated). Create a table or something in each schema that is unique.

sqlplus user/pwd@ORCLA
select * from orcla;

connect user/pwd@ORCLB
select * from orclb;

Once you get this to work create the link.

Note: If "global_names = true" the dblink name has to match the database name.

Also the correct syntax is:

create database link dblink connect to user identified by password using 'connect_string'

where connect_string is the tns entry.
Previous Topic: Temporary tablespace
Next Topic: ORA-01874: time zone hour must be between -12 and 13
Goto Forum:
  


Current Time: Fri Dec 27 00:31:01 CST 2024