ntfs+oracle+2003+asp.net 网站发布

来源:互联网 发布:白马啸西风知乎 编辑:程序博客网 时间:2024/05/01 03:00

环境:asp.net +oracle9+windows2003

在本地测试网站完全没有问题。但是一上传到服务器就出问题了,数据库无法连接。由于远程没有VS环境,所以无法调试。真是费了牛劲才找到解决方案:

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:       
a)  Oracle Provider for OLE DB         Error Type:  Microsoft OLE DB Service Components (0x80070005)         Access is denied.       
b)  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.       
c)  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).       
d)  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.       
e)  Oracle Objects for OLE            i.  while using a GLOBAL.ASA file             Error Type:  Active Server Pages (0x0)             An error occurred while creating object ’OraSession’.                   ii.  not using a GLOBAL.ASA file             Error Type:  Microsoft VBScript runtime (0x800A0046)             Permission denied: ’CreateObject’      (6) 
f)  Other miscellaneous errors        
  
    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:    
        i.  Log on to Windows as a user with Administrator privileges.    
        ii.  Launch Windows Explorer from the Start Menu and and navigate to the   ORACLE_HOME directory.    
        iii.  Right-click on the ORACLE_HOME folder and choose the "Properties" option   from the drop down list.  A "Properties" window should appear.    
        iv.  Click on the "Security" tab on the "Properties" window.    
        v.  Click on "Authenticated Users" item in the "Name" list (on Windows XP the  "Name" list is called "Group or user names").    
        vi.  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.    
        vii.  Check the "Read and Execute" box.  This is the box you just unchecked.    
        viii.  Click the "Apply" button.    
        ix.  Click the "OK" button.  
        x.  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 ----------------------- OLEDB


        这里的原因说的太清楚了,还是Oracle 9.2的问题。

        这个版本的oracle安装在NTFS格式的分区上时对Authenticated Users用户的权限设置没有设置好,造成Authenticated Users对 ORACLE_HOME 目录是不可访问的。  而IIS就是使用 Authenticated Users 用户权限来访问的。 因此不能访问到ORACLE_HOME目录,也就提示 Microsoft OLE DB Provider for Oracle  没有注册 这样的错误了。   而使用Windows 桌面程序来访问oracle,因为是用administrator用户来登录的,所有就有权限访问。

      解决方法也很简单。 把ORACLE_HOME 目录的Authenticated Users 用户的权限那里的钩去掉,然后再购上,最后重启,就OK了。


      启示:
      1.  看来遇到问题还是上网找找好, 常见的问题肯定有人已经碰到过,就不必浪费时间自己去研究那么久了。 如果是不常见的问题,可能才要自己研究。

      2.  出现问题一定要按照正确的思路分析,采用不同的方法进行测试,从而来分析问题到底出在那里,不可能出在那里, 从而可以避免走弯路去做一些无畏的尝试