Solved

COnnectin to sqlserver from oracle

Posted on 2011-02-16
14
772 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
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 500 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
Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

 
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

Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

Question has a verified solution.

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

Suggested Solutions

I've encountered valid database schemas that do not have a primary key.  For example, I use LogParser from Microsoft to push IIS logs into a SQL database table for processing and analysis.  However, occasionally due to user error or a scheduled task…
In this article I will describe the Backup & Restore method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.

777 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