How to connect to Oracle 10g from remote client?

*爱你&永不变心* 提交于 2019-12-12 03:57:02

问题


Using the standard Delphi dbexpress dbexpora.dll + oci.dll (10g) (the oracle instantclient is installed).

When directly on the Oracle Database box we can run dbexpress apps just fine. The local dbxconnections.ini alias used in that case simply specifies our DB service name ORCL as the "database" parameter.

We are trying to connect to this same database from client machines and receiving a series of errors.

Naturally, we are trying all manner of strings in the database parameter. Using a string like, MOHAWK2:1521:ORCL we are at the point where we can at least get a listener error:

Failure to Connect: ORA-12514 TNS:listener does not currently know of service requested in connect descripter.

I imagine there are some tools to test the naming availability...


回答1:


Use TNSPING on the server to see how it's resolving the service name. Various configuration options and files can map a simple designation to a full server/port/service.

C:>TNSPING ORCL

Used TNSNAMES adapter to resolve the alias Attempting to contact (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = 127.0.0.1)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = XE))) OK (0 msec)

Extract out the server/port/service and construct the connect string in whatever format the component or connection method your using needs.




回答2:


Is the listener setup and running on the oracle server? Is it accepting connection for the instance/service of the database you are connecting to? Have you checked with lsnrctl status? Have you try turning on sqlnet logging and listener logging to see if you are even making a connection to the database from the remote site and what error is recorded in the listner log as to why its refusing service? Is the listener accepting tcp connection or is the listener only accepting IPC connection? without listening for tcp connection, it won't accept remote connections.




回答3:


Check connectivity using tnsping first. If OK, try connecting with sqlplus. If tnsping fails you are using incorrect service name, or you haven't configured your client properly. If you are relying on local configurations, the file to edit is tnsnames.ora in ORAHOME\NETWORK\ADMIN which will need configuration settings in order to locate the server, and this includes host, port and service name.




回答4:


Sorry, about the CAPS, this is all new to me. I don't have any reputation, what i did have has now been lowered do to this question title being in caps. I dont know how to comment to you all who have answered........casue it wont let me.....i dont have enough reputation. I guess i need to move onto another forum....

anyway,

Solved!

I setup a new vmware clone - installed the oracle client and our couple of dlls and exes in a dir and it worked.

So I removed everything extraneous on the box I was working with and bingo.

I think it was Interference from the delphi 2007 that was already on that machine...despite trying to path everything right around it.



来源:https://stackoverflow.com/questions/859491/how-to-connect-to-oracle-10g-from-remote-client

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!