Heim  >  Artikel  >  Datenbank  >  Oracle 客户端连接时报ORA-01019错误总结

Oracle 客户端连接时报ORA-01019错误总结

WBOY
WBOYOriginal
2016-06-07 17:46:232826Durchsuche

本文章总结了大多数网友在使用orace数据库是出现的一个客户端连接时报ORA-01019错误收集总结,有需要的朋友可参考一下。

本文章总结了大多数网友在使用orace数据库是出现的一个客户端连接时报ORA-01019错误收集总结,有需要的朋友可参考一下。

在.net+oracle开发中,发布web程序的时候,有是会遇到该错误 ora-01019

ORA-01019 unable to allocate memory in the user side
Cause: The user side memory allocator returned an error.

Action: Increase the size of the process heap or switch to the old set of calls.

或者 错误,不能从进程获得上下文.

 
此错误是由于oracle或者microsoft的bug引起.(其实是,iis的访问权限的控制太高).

解决方法: 

一:为ORACLE_HOME目录,添加network services 用户组的访问权限,并将权限继承到子目录.重启机器.

二:提高虚拟路径对应的应用程序池,执行用户的权限.(该方法本人认为对带来不安全因素)


令,本错误有时候提示是,需要安装oracle7.13版本客户端以上.解决方法同上.

 

问题二


在Win8企业版64位环境下,连接Oracle11g 服务端,搞了整整两天,特将过程分享出来,供有需要的同学参考。

本机环境:

1、服务端:Oracle 11g R2 64位,安装路径E:/Org12

官方下载:http://www.oracle.com/technetwork/database/enterprise-edition/downloads/index.html

2、客户端:

(1)Instant Client ,轻量级,安装路径E:/Oracle11/client
http://www.oracle.com/technetwork/database/features/instant-client/index-097480.html

(2)32-bit Oracle Data Access Components (ODAC) with Oracle Developer Tools for Visual Studio,安装路径E:/Org12/Product/11.2.0/client_1

http://www.oracle.com/technetwork/topics/dotnet/utilsoft-086879.html?ssSourceSiteId=otncn 

 用客户端三种工具去连Oracle服务端,结果:

第一种:Oracle自带的SQL Deveploer工具,基本没问题!也不需要什么客户端配置。

http://www.oracle.com/technetwork/developer-tools/sql-developer/downloads/index.html

第二种,用PL/SQL 9.0去连,需要copy服务端的XXapporacleproduct11.2.0servernetworkADMINtnsnames.ORA文件到客户端(1)的networkADMIN下,并删除不需要的部分,保留内容大致如下:

 

 代码如下 复制代码
ORCL =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
    )
    (CONNECT_DATA =
       (SID =ORCL)
    )
  )

并用如下方式启动PL/SQL

 代码如下 复制代码


set Path=E:/Oracle11/client
rem 服务端路径: E:Org12product11.2.0dbhome_1BIN
set ORACLE_HOME=E:/Oracle11/client
set TNS_ADMIN=E:/Oracle11/client
set NLS_LANG=AMERICAN_AMERICA.AL32UTF8
start E:/Oracle11/PL_SQL/plsqldev.exe此时OK。


这个问题网上查找很久,尝试的解决方法很多,但最终我的方案是:

1、删除Oracle服务端;方法可以在网上搜,要删干净;

2、删除ODAC及所有组件;

3、保留Instant Client及其安装目录,主要是networkADMINtnsnames.ORA

4、重新安装Oracle服务端;

此时接所有客户端连接完全正常!

小结:

1、刚开始怀疑是64位Oracle驱动路径(x86)引起的bug,最后得出的结论是同一台机器,最好不要装两个Oracle客户端 ,服务端+客户端也不推荐,会引起一些潜在的问题,原因不明。

2、64位的Oracle服务端+32位的Oracle客户端,会有一些潜在的问题,最好32位对32位。

3、安装Oracle 11g R2 EX时,会在环境变量Path前面加上“e:Org12apporacleproduct11.2.0serverbin;;”,注意是两个分号,须删除一个;这个不知道是安装程序的BUG?


问题三


今天开发的同事碰到了这个ORA-1019错误。
 
详细的错误信息为:

Microsoft OLE DB Provider for ODBC Drivers错误'80004005'
[Microsoft][ODBC driver for Oracle][Oracle]Error while trying to retrieve text for error ORA-01019
/includes/data_func.asp,行12

而Oracle文档上对这个错误的描述为:

ORA-01019: unable to allocate memory in the user
Cause: The user side memory allocator returned error.

Action: Increase the processes heap size or switch to the old set of calls.

从错误描述上看,似乎是内存分配的问题,但是客户端服务器上的内存有2G,而且并没有启动什么程序,显然不是简单的内存不足的问题。

不过问题多半是出在客户端程序上,检查了一下metalink,发现文档ID 91906.1中提到的问题可能和当前类似。导致这个问题的原因似乎是ODBC没有使用Oracle提供的驱动程序,而是使用了ORACLE_HOME之外系统提供的驱动。
又通过GOOGLE搜索了一下,找到了一篇文章,其中包含下面的描述:
You must set the following environment variables:
ORACLE_HOME
 Specifies the top-level directory in which Oracle is installed.
 
TNS_ADMIN
 Specifies the location of configuration files, for example, $ORACLE_HOME/network/admin. After installation Oracle creates the configuration files under /var/opt/oracle. If listener.ora and tnsnames.ora are in this directory, you might not need to set TNS_ADMIN, because by default Oracle uses /var/opt/oracle.
 

If you do not set these environment variables properly, Oracle returns the ORA-1019 error code the first time you attempt to connect. For information on error handling,


看来问题很可能是由于没有正确设置ORACLE_HOME环境变量造成的,

解决办法

在WINDOWS中设置系统环境变量,重启系统后,问题消失。

Stellungnahme:
Der Inhalt dieses Artikels wird freiwillig von Internetnutzern beigesteuert und das Urheberrecht liegt beim ursprünglichen Autor. Diese Website übernimmt keine entsprechende rechtliche Verantwortung. Wenn Sie Inhalte finden, bei denen der Verdacht eines Plagiats oder einer Rechtsverletzung besteht, wenden Sie sich bitte an admin@php.cn