[心缘地方]同学录
首页 | 功能说明 | 站长通知 | 最近更新 | 编码查看转换 | 代码下载 | 常见问题及讨论 | 《深入解析ASP核心技术》 | 王小鸭自动发工资条VBA版
登录系统:用户名: 密码: 如果要讨论问题,请先注册。

[备忘]Asp+OO4O,连接Oracle出错……[已解决]

上一篇:[备忘]VmWare虚拟机增加硬盘容量的方法。
下一篇:[转帖]Javascript中的Trim方法……

添加日期:2007/7/24 15:09:53 快速返回   返回列表 阅读7197次
2003 sp1 + Oracle 9i

ASP + OO4O (Oracle Objects for OLE)

SQL Plus可以正确连接。
-------------------------------------------------
(1)ASP中仅仅写了一句:

set xx=Server.createObject("OracleInProcServer.XOraSession")

就报CreateObject错误。

Microsoft OLE DB Provider for Oracle 错误 '80004005' 
-------------------------------------------------

以为没装好,卸载了OO4O,又装了一遍,依旧…………

想起来2003系统,而且是NTFS格式,可能是权限问题……

但是不知道给哪个文件添加权限,不知道OO4O对应的是哪个dll文件
---------------------------------------------------
(2)后来又试验ADO+OLE DB连接方式

set conn=server.createObject("adodb.connection")
str="Provider=MSDAORA.1;Data Source=EduSys;User ID=edu01;Password=edu01"
conn.open str

报什么什么什么…………

类似这个:
------------------------------
Microsoft OLE DB Provider for Oracle (0x80004005)

Oracle client and networking components were not

found. These components are supplied by Oracle

Corporation and are part of the Oracle Version 7.3.3

or later client software installation. Provider is

unable to function until these components are

installed. 
-------------------------------
(3)又换ODBC的连接方式

set conn=server.createObject("adodb.connection")
str="Provider=MSDASQL;DRIVER={Microsoft ODBC for ORACLE};UID=edu01;PWD=edu01;Server=EduSys"
conn.open str

报类似这个错:
-------------------
Microsoft OLE DB Provider for ODBC Drivers 错误 '80004005'  
[Microsoft][ODBC 驱动程序 管理器] 驱动程序的 SQLAllocHandle on SQL_HANDLE_ENV 失败
-------------------

(4)极其郁闷,到处乱翻,翻倒微软的文章:

http://support.microsoft.com/default.aspx?scid=kb;zh-cn;255084
ASP-to-Oracle 连接问题疑难解答

看到这段:
------------------
向 Oracle 主文件夹中添加 IUSR_machine name 帐户和 IWAM_machine name 帐户。赋予两个帐户完全控制权。

为此,右键单击 Windows 资源管理器中的 Oracle 主文件夹。单击属性,然后单击安全选项卡。添加相应的帐户并赋予它们完全控制权。重新启动计算机。

------------------
智慧啊,管它那个dll呢,整个目录我都添加权限不就完了嘛。

我的Oracle在d:\oracle\ora92下,整个添加IUSR_xxx的权限,

恩,第一个问题好了…………

第2,3个问题依旧…………
==========================================================
补记说明:
其实,以上的问题是oracle 9.2 一个bug,原因是NTFS的安全与IIS运行的用户模式问题……

第一个解决方法应该是:
Oracle\ora92 打开Ora92的-》属性-》安全,选Authenticated Users 看下面的属性。
将“读取和运行”的勾去掉,然后又勾上,确定,重新启动机器 ,ok 搞定,就是这么简单


我都没有重新启动就好了。(上面的问题都好了)

如果这样不行,才是上面说的,添加ISUR_XXX用户。
====================================================================
一些额外说明文字:


%ORACLE_HOME%这个目录在安装的时候,是单独设置了权限的,
默认是管理员组、SYSTEM组和一个名为“Authenticated Users”的组具有权限。


Oracle 公司的原版资料:

Problem Description 
------------------- 
When running an application that connects to Oracle and uses the Authenticated User privilege (such as Microsoft's Internet Information Server (IIS)) via Oracle's 9.2 client software and any of these programmatic interfaces 

1. Oracle Provider for OLE DB 
2. Microsoft OLE DB Provider for Oracle 
3. Oracle ODBC Driver 
4. Microsoft ODBC for Oracle 
5. Oracle Objects for OLE (OO4O) 

you will receive one of the following errors: 

(1) Oracle Provider for OLE DB Error Type: Microsoft OLE DB Service Components (0x80070005) Access is denied. 

(2) Microsoft OLE DB Provider for Oracle Error Type: Microsoft OLE DB Provider for Oracle (0x80004005) Oracle client and networking components were not found. These components are supplied by Oracle Corporation and are part of the Oracle Version 7.3.3 or later client software installation. Provider is unable to function until these components are installed. Or Error Type: Microsoft OLE DB Provider for Oracle (0x80004005) Oracle error occurred, but error message could not be retrieved from Oracle. 

(3) Oracle ODBC Driver Error Type: Microsoft OLE DB Provider for ODBC Drivers (0x80004005) Specified driver could not be loaded due to system error 5 (Oracle in OraHome92). 

(4) Microsoft ODBC for Oracle The Oracle(tm) client and networking components were not found. These components are supplied by Oracle Corporation and are part of the Oracle Version 7.3 (or greater) client software installation. You will be unable to use this driver until these components have been installed. 

(5) Oracle Objects for OLE (a) while using a GLOBAL.ASA file Error Type: Active Server Pages (0x0) An error occurred while creating object 'OraSession'. (b) not using a GLOBAL.ASA file Error Type: Microsoft VBScript runtime (0x800A0046) Permission denied: 'CreateObject' 

(6) Other miscellaneous errors (a) The Specified Module Could Not Be Found 

Solution Description 
-------------------- 
You need to give the Authenticated User privilege to the Oracle Home by following these steps: 

1. Log on to Windows as a user with Administrator privileges. 

2. Launch Windows Explorer from the Start Menu and and navigate to the ORACLE_HOME directory. 

3. Right-click on the ORACLE_HOME folder and choose the "Properties" option from the drop down list. A "Properties" window should appear. 

4. Click on the "Security" tab on the "Properties" window. 

5. Click on "Authenticated Users" item in the "Name" list (on Windows XP the "Name" list is called "Group or user names"). 

6. Uncheck the "Read and Execute" box in the "Permissions" list (on Windows XP the "Permissions" list is called "Permissions for Authenticated Users"). This box will be under the "Allow" column. 

7. Check the "Read and Execute" box. This is the box you just unchecked. 

8. Click the "Apply" button. 

9. Click the "OK" button. 

10. You may need to reboot your computer after these changes have been made. Re-execute the application and it should now work. 

Explanation 
----------- 
If you install Oracle9i Release 2 (9.2.0.1) on a computer running Windows with an NTFS partition, the contents of ORACLE_HOME directory will not be visible to users who are authenticated on that machine. 

These permissions were not set properly when the software was installed. Applications that were working fine with previous versions of Oracle software will stop working when they upgrade to Oracle 9.2. 

NOTE: The application will continue to work if the user has logged onto the machine as an Administrator. Any application that is using the Authenticated User privilege will not work. A notable example would be IIS which might service some of the requests based on the Authenticated User privileges. 

To demonstrate the problem in further detail, you can log on to the operating system as an authenticated machine user. You won't be able browse the contents of the ORACLE_HOME directory demonstrating your inability to load any Oracle DLLs or make a connection. 

References 
---------- 
Bug:2498880 - Oracle 9I Release 2 Installation Issue on Windows 2000 NTFS File System Additional Search Words 
----------------------- 

以下转文:
=================================================================

   时值今天 ,我们也不得不感谢gene的那晚苦思冥想的郁闷,正是他一夜的郁闷让我们以后解决这类没头绪的问题变得异常轻松。

  我们的.Net应用绝大多数都是部署在ntfs分区,我们的数据库客户端也大多是Oracle9.2 ,所以这样的问题就屡见不鲜。按照邮件介绍的操作,大多数情况都能解决问题。如果还不行,把用户Aspnet和Internet 来宾用户IUSR_COMPUTERNAME加入Ora92的安全权限里,无法连接的问题就可以解决。从来就是这么简单,一直到上周五。

    上周五某平台测试机部署时同样遇见这个问题,操作系统windows 2003,Oracle客户端9201。用户Aspnet和Interet 来宾用户IUSR_COMPUTERNAME 已经加入Ora92的安全权限里,不行。匿名访问用户赋予管理员权限,还不行。检查system.config,web.config,没发现任何异常。替换oracle本身提供的provider也不行。重启IIS,重启3w服务,重启机器,怎么折腾都不行。真是郁闷古今同啊。最后,已经准备做换机器这样无奈的打算了。还好,在绝望之前又仔细检查了一些细节。

    windows 2000和2003的ASP.NET 的体系结构其实是有结构上的差异的。在 Windows 2000 上,多个 Web 应用程序运行于 ASP.NET 工作进程 (Aspnet_wp.exe) 的单个实例中。每个应用程序驻留在其自己的应用程序域中,该域为托管节点提供一定程度的隔离。而在 Windows Server 2003 上,体系结构发生更改,因为 IIS 6 允许使用多个进程来驻留独立的 Web 应用程序。与 Windows 2000 下的 ASP.NET 体系结构相比,Windows Server 2003 中的ASP.NET 体系结构的主要区别在于可以使用单独的 IIS 工作进程实例 (W3wp.exe) 来驻留 Web 应用程序。默认情况下,所有的应用程序都在默认应用程序池中运行。

   所以,对默认的应用程序池的配置又做了最后一次详细的检查,在默认的应用程序池属性中标识页,发现有一个预定义帐户选项,列出了三个选项:网络服务 (NetworkService)、本地系统 (LocalSystem)、本地服务 (LocalService) 。当前选中的网络服务,而该帐户是这三个帐户权限最低的,将选项改为本地系统,重启IIS,久违的输入框出现了,终于正常连接到数据库。

  总结:如果问题确认出现在环境上,那么就仔细检查每一个细节,以及每一个可能相关的配置项。
=======================================================
 

评论 COMMENTS
没有评论 No Comments.

添加评论 Add new comment.
昵称 Name:
评论内容 Comment:
验证码(不区分大小写)
Validation Code:
(not case sensitive)
看不清?点这里换一张!(Change it here!)
 
评论由管理员查看后才能显示。the comment will be showed after it is checked by admin.
CopyRight © 心缘地方 2005-2999. All Rights Reserved