Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

COnnectin to sqlserver from oracle

Posted on 2011-02-16
14
Medium Priority
?
792 Views
Last Modified: 2012-05-11
Hi

I am trying to connect sqlserver from Oracle using HS gateways. I configured listener,tnsnames.ora successfullyl Listerner also started succcessfuly

After that I created database link in Oracle , but when i am trying to connect to sqlserver from oracle, i am getting following error:

ORA_12154: TNS: COULD NOT RESOLVE THE cONNECT IDENTIFIER SPECIFIED

Please help me to fix this issue. Its very urgent


fyi:

I installed ORACLE HS gateway software on the machine where oracle client is installed and also on the same machine itself is Sqlserver database server.


Thx
Naren
0
Comment
Question by:knaren1975
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
14 Comments
 
LVL 2

Expert Comment

by:niaz
ID: 34913508
Do you have more then one Oracle installed on your system? if so, please make sure that you have configure your tnsnames.ora file for the right Oracle Install.

Please make sure that your parenthesis are matched when you edited your tnsnames.ora and listener.ora files.

You can use tnsping command from command prompt to verify the connectivity and your TNS Service Name Descriptor. This will also give the path for the TNS_ADMIN folder in use.

Please post your listener.ora and tnsnames.ora files.
0
 
LVL 39

Accepted Solution

by:
Pratima Pharande earned 2000 total points
ID: 34913605
0
 

Author Comment

by:knaren1975
ID: 34913624
Hi Niaz,

Please find the listener and tnsnames.ora files below:

# listener.ora Network Configuration File: F:\app\product\11.1.0\client_1\network\admin\listener.ora
# Generated by Oracle configuration tools.

LISTENERMYSQLSERVERDSN =
  (DESCRIPTION_LIST =
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
      (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
    )
  )


SID_LIST_LISTENERMYSQLSERVERDSN=
  (SID_LIST=
      (SID_DESC=
         (SID_NAME=testfeed)
         (ORACLE_HOME = F:\app\product\11.1.0\client_1)
         (PROGRAM=dg4odbc)
       )
      )

ADR_BASE_LISTENERMYSQLSERVERDSN = F:\product\11.2.0\tg_1

TNSNAME.ORA
=============

MYSQLSERVERDSN =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (COMMUNUITY = tcp.world)(PROTOCOL = TCP)(HOST = <oraclehostname>)(PORT = 1521))
    )
    (CONNECT_DATA =
      (SID = ismfeed)
      (HS=OK)
    )
  )


I checked tnsping and listener they are fine.

thx
Naren
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
LVL 23

Expert Comment

by:OP_Zaharin
ID: 34913630
Can u share with us your tnsnames settings? You can find the file on your ORACLE HS gateway machine on <drive>\oracle\product\10.2.0\db_1\NETWORK\ADMIN\tnsnames.ora

As per below tnsnames sample, you should use "MYDB" as the databse host string.

MYDB =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = 192.23.150.33)(PORT = 1521))
    )
    (CONNECT_DATA =
      (SERVICE_NAME = MYPRODDB)
    )
  )
0
 

Author Comment

by:knaren1975
ID: 34913827
Hi

In the hostname of TNS entry do we need to give the Oracl client Hostname or sqlserver database hiostname. pls clarify

thx
Naren
0
 
LVL 23

Expert Comment

by:OP_Zaharin
ID: 34913844
Hi knaren,

In the tnsnames, you need to give the Oracle client hostname.
0
 

Author Comment

by:knaren1975
ID: 34913966
Hi

I used servername where oracleclient is installed  as hostname in tnsnames.ora after changing i am getting the following error :

ORA-12518: TNS:listener could not hand off client connection

thx
Naren
0
 

Author Comment

by:knaren1975
ID: 34914058
Hi

pls let mwe know In TNS Listener under oracl_home, do we need to give the home  directory name of Oracle Gate way or client home directory?

thx
Naren
0
 
LVL 23

Expert Comment

by:OP_Zaharin
ID: 34914062
1-Check whether your listener version is compatible with the database. Use same or higher version of listener.

2-Set following parameter in listener.ora and restarted listener:
DIRECT_HANDOFF_TTC_LISTENER=OFF

3-Check the DB Processes:
select * from v$resource_limit where resource_name='processes';

RESOURCE_NAME | CURRENT_UTILIZATION | MAX_UTILIZATION | INITIAL_ALLO | LIMIT_VALUE
processes             |                22                      |               34             |       150               |      150

alter system set processes=300 scope=spfile;

0
 
LVL 23

Expert Comment

by:OP_Zaharin
ID: 34914115
For Oracle Home, use the location of your Oracle home directory.
eg: c:\oracle\product\11.1.0\client_1
0
 

Author Comment

by:knaren1975
ID: 34914566
Hi Zaharin

My oracle client version is 11.1.0 where as gateway version is 11.2.0 is that causing issue?

thx
Naren
0
 

Author Comment

by:knaren1975
ID: 34914730
tje follwoing is my listener file

# listener.ora Network Configuration File: F:\app\product\11.1.0\client_1\network\admin\listener.ora
# Generated by Oracle configuration tools.

LISTENERMYSQLSERVERDSN =
  (DESCRIPTION_LIST =
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = TCP)(HOST = loncsdbdion1.uk.db.com)(PORT = 1521))
      (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
    )
  )


SID_LIST_LISTENERMYSQLSERVERDSN=
  (SID_LIST=
      (SID_DESC=
         (SID_NAME=ismfeed)
         (ORACLE_HOME = F:\app\product\11.1.0\client_1)
         (PROGRAM=dg4odbc)
       )
      )

ADR_BASE_LISTENERMYSQLSERVERDSN = F:\product\11.2.0\tg_1

0
 
LVL 23

Expert Comment

by:OP_Zaharin
ID: 34940599
Hi knaren,

client version must always same or newer than the database server
0
 

Author Comment

by:knaren1975
ID: 34940640
Hi

Atlast i am able to fix the issue. thanks to all for your help

THx
Naren
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When writing XML code a very difficult part is when we like to remove all the elements or attributes from the XML that have no data. I would like to share a set of recursive MSSQL stored procedures that I have made to remove those elements from …
In SQL Server, when rows are selected from a table, does it retrieve data in the order in which it is inserted?  Many believe this is the case. Let us try to examine for ourselves with an example. To get started, use the following script, wh…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…

618 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question