VinceYuan

Personal Blog

导航

Oracle OLEDB不支持sys以sysdba方式登陆

Posted on 2006-08-22 14:27  Vince Yuan  阅读(1487)  评论(0编辑  收藏  举报
Oracle OLEDB常见的connection  string如下:
"Provider=OraOLEDB.Oracle;Data Source=MyOracleDB;User Id=Username;Password=asdasd;"
其中,User Id可以写system,可以登陆成功。但如果写成sys,会有错误消息:sys必须以sysdba方式登陆。但是Oracle OLEDB并不支持下列方式:
User Id=sys as sysdba;
原因是OLE DB标准本来就不支持这种方式登陆。

如果硬要sys以sysdba方式登陆,只能使用ODBC。

相关资料如下(我试过oracle 10g,依然不行):
Doc ID: Note:276719.1
Subject: Is It Possible to Connect to Oracle as SYSDBA From ADO
Type: PROBLEM
Status: PUBLISHED
Content Type: TEXT/X-HTML
Creation Date: 18-JUN-2004
Last Revision Date: 03-AUG-2005

Applies to:
Oracle Provider for OLE DB - Version: 9.2.0.1
Oracle ODBC Driver - Version: 8.1.7.0 to 10.1.0.4
Microsoft Windows 2000
Microsoft Windows XP
Microsoft Windows Server 2003
Microsoft Windows (32-bit)

Symptoms
Unable to connect as SYSDBA from ADO applications.
Cause
Using the Microsoft OLEDB Provider to connect as SYSDBA

According to Bug 2114052, it is not possible, per the OLE DB specification,
to connect to a database with the "AS SYSDBA" syntax. This will not work
with Oracle OLE DB Provider either.