Code Project

Link Unit

Tuesday, October 23, 2007

DBLink Problem : TNS COULD NOT RESOLVE SERVICE NAME.

I was also facing the same problem when i create the DB Link as

CREATE PUBLIC DATABASE LINK TestService USING 'TestService';


TNS COULD NOT RESOLVE SERVICE NAME.

This is basically the problem with the TNSNAME.ora file, the 'Using' clause not able to find the service name in the TNSNAMES.ora

This is how i solved: I just copy paste the TestService`s Description part as

CODE

alter system set global_names=false
/
CREATE PUBLIC DATABASE LINK TestService
using
'(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = TestHost)(PORT = 1521))
)
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = TestService)
)
)
'
/
here my destination server host is TestHost & service name is TestService .

NOTE: If I had set the "GLOBAL_NAME" parameter to "TRUE", then the DBLink name need to be same as that of DBName .

No comments: