Oracle 客戶端鏈接時報ORA-01019錯誤總結

在.net+oracle開發中,發佈web程序的時候,有是會遇到該錯誤 ora-01019html

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

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

或者 錯誤,不能從進程得到上下文.安全


此錯誤是因爲oracle或者microsoft的bug引發.(實際上是,iis的訪問權限的控制過高).服務器

解決方法: oracle

一:爲ORACLE_HOME目錄,添加network services 用戶組的訪問權限,並將權限繼承到子目錄.重啓機器.app

二:提升虛擬路徑對應的應用程序池,執行用戶的權限.(該方法本人認爲對帶來不安全因素)ide


令,本錯誤有時候提示是,須要安裝oracle7.13版本客戶端以上.解決方法同上.工具

 

問題二this


在Win8企業版64位環境下,鏈接Oracle11g 服務端,搞了整整兩天,特將過程分享出來,供有須要的同窗參考。

本機環境:

一、服務端:Oracle 11g R2 64位,安裝路徑E:/Org12

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

二、客戶端:

(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。

(www.111cn.net)

這個問題網上查找好久,嘗試的解決方法不少,但最終個人方案是:

一、刪除Oracle服務端;方法能夠在網上搜,要刪乾淨;

二、刪除ODAC及全部組件;

三、保留Instant Client及其安裝目錄,主要是networkADMINtnsnames.ORA

四、從新安裝Oracle服務端;

此時接全部客戶端鏈接徹底正常!

小結:

一、剛開始懷疑是64位Oracle驅動路徑(x86)引發的bug,最後得出的結論是同一臺機器,最好不要裝兩個Oracle客戶端 ,服務端+客戶端也不推薦,會引發一些潛在的問題,緣由不明。

二、64位的Oracle服務端+32位的Oracle客戶端,會有一些潛在的問題,最好32位對32位。

三、安裝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中設置系統環境變量,重啓系統後,問題消失
from:http://www.111cn.net/database/Oracle/43838.htm

相關文章
相關標籤/搜索