简体   繁体   English

如何从远程客户端连接到Oracle 10g?

[英]How to connect to Oracle 10g from remote client?

Using the standard Delphi dbexpress dbexpora.dll + oci.dll (10g) (the oracle instantclient is installed). 使用标准的Delphi dbexpress dbexpora.dll + oci.dll(10g)(已安装oracle Instantclient)。

When directly on the Oracle Database box we can run dbexpress apps just fine. 直接在Oracle数据库框中,我们可以运行dbexpress应用程序。 The local dbxconnections.ini alias used in that case simply specifies our DB service name ORCL as the "database" parameter. 在这种情况下,使用的本地dbxconnections.ini别名只是将数据库服务名称ORCL指定为“数据库”参数。

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: 使用MOHAWK2:1521:ORCL这样的字符串,我们至少可以得到一个侦听器错误:

Failure to Connect: ORA-12514 TNS:listener does not currently know of service requested in connect descripter. 连接失败:ORA-12514 TNS:侦听器当前不知道连接描述符中请求的服务。

I imagine there are some tools to test the naming availability... 我想有一些工具可以测试命名可用性...

Use TNSPING on the server to see how it's resolving the service name. 在服务器上使用TNSPING可以查看其如何解析服务名称。 Various configuration options and files can map a simple designation to a full server/port/service. 各种配置选项和文件可以将简单的名称映射到完整的服务器/端口/服务。

C:>TNSPING ORCL 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) 使用TNSNAMES适配器解析别名尝试联系(DESCRIPTION =(地址=(PROTOCOL = TCP)(HOST = 127.0.0.1)(PORT = 1521))(CONNECT_DATA =(SERVER = DEDICATED)(SERVICE_NAME = XE)))OK (0毫秒)

Extract out the server/port/service and construct the connect string in whatever format the component or connection method your using needs. 提取服务器/端口/服务,并以您需要使用的组件或连接方法的任何格式构造连接字符串。

Is the listener setup and running on the oracle server? 侦听器是否已安装并在oracle服务器上运行? Is it accepting connection for the instance/service of the database you are connecting to? 是否接受要连接的数据库的实例/服务的连接? Have you checked with lsnrctl status? 您是否检查过lsnrctl状态? 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? 您是否尝试过打开sqlnet日志记录和侦听器日志记录,以查看您是否甚至正在从远程站点建立到数据库的连接,并且列表器日志中记录了有关其拒绝服务原因的错误? Is the listener accepting tcp connection or is the listener only accepting IPC connection? 侦听器接受TCP连接还是侦听器仅接受IPC连接? without listening for tcp connection, it won't accept remote connections. 不监听tcp连接,它将不接受远程连接。

Check connectivity using tnsping first. 首先使用tnsping检查连接性。 If OK, try connecting with sqlplus. 如果可以,请尝试使用sqlplus连接。 If tnsping fails you are using incorrect service name, or you haven't configured your client properly. 如果tnsping失败,则您使用的服务名称不正确,或者您的客户端配置不正确。 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. 如果您依赖本地配置,则要编辑的文件是ORAHOME \\ NETWORK \\ ADMIN中的tnsnames.ora,它将需要配置设置才能找到服务器,其中包括主机,端口和服务名称。

Sorry, about the CAPS, this is all new to me. 抱歉,关于CAPS,这对我来说是全新的。 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. 我设置了一个新的vmware克隆-在目录中安装了oracle客户端以及我们的dll和exe夫妇,并且可以正常工作。

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. 我认为这是该计算机上已经存在的delphi 2007干扰...尽管试图绕过它的所有路径。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM