DBLink issue, ORA-12154: TNS:could not resolve service name

Hi Experts,

I'm able to connect through SQLPLUS, using tkeep/tiger@pepsi

Now created DB Link, in other DB, with the below command:

CREATE DATABASE LINK TKEEPDBLINK
   CONNECT TO TKEEP IDENTIFIED BY TIGER
   USING 'PEPSI';

When trying to do a
SELECT * from aug@TKEEPDBLINK  
gives the below error
ORA-12154: TNS:could not resolve service name

Please do the needful.

Thanks.
amutallibkhanAsked:
Who is Participating?
 
esmail1349Connect With a Mentor Commented:
test TNSPING PEPSI in windows command prompt on machine that DBlink arised.
it should return OK.
else check pepsi host string for any problem.
0
 
riazpkCommented:
Do you have more than one oracle homes?
0
 
amutallibkhanAuthor Commented:
Ya, we have.
0
Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

 
amutallibkhanAuthor Commented:
C:\Documents and Settings\Abdulmutallib>tnsping pepsi

TNS Ping Utility for 32-bit Windows: Version 9.2.0.1.0 - Production on 07-SEP-20
10 13:18:15

Copyright (c) 1997 Oracle Corporation.  All rights reserved.

Used parameter files:
D:\oracle\ora92\network\admin\sqlnet.ora


Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (COMMUNITY = tcp
.world) (PROTOCOL = TCP) (Host = 10.10.40.5) (Port = 1521)) (ADDRESS = (COMMUNIT
Y = tcp.world) (PROTOCOL = TCP) (Host = 10.10.40.5) (Port = 1526))) (CONNECT_DAT
A = (SID = ORCL)))
OK (0 msec)
0
 
esmail1349Commented:
pepsi host string should be in D:\oracle\ora92\network\admin\tnsnames.ora
and then
check/add  ORACLE_HOME environment variable to value "D:\oracle\ora92"
0
 
boriskalavskyCommented:
check firewall
0
 
boriskalavskyCommented:
are you listening on both ports on 10.10.40.5 (1521 and 1526)? Can you ost a listener.ora file from  10.10.40.5?
0
 
amutallibkhanAuthor Commented:
Helped in getting resolved.
0
All Courses

From novice to tech pro — start learning today.