在.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。
(www.111cn.net)
這個問題網上查找很久,嘗試的解決方法很多,但最終我的方案是:
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中設置系統環境變量,重啟系統后,問題消失
from:http://www.111cn.net/database/Oracle/43838.htm