How can I connect to an Oracle database as SYS usi

2019-07-02 13:06发布

I am trying this:

Provider=MSDASQL.1;Persist Security Info=False;User ID=sys;Password=pwd;Initial Catalog=DATABASE;Data Source=OdbcDataSource;DBA Privilege=SYSDBA

But I get the error:

[Microsoft][ODBC Driver Manager] Driver's SQLSetConnectAttr failed

I'm using Delphi, but answers in any language are welcome.

Clarification: I am able to connect as a normal user. I run into trouble when I try to connect AS SYSDBA.

3条回答
smile是对你的礼貌
2楼-- · 2019-07-02 13:20

You can't connect as SYSDBA using standard System.Data.OracleClient, as stated by this post : http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=2245591&SiteID=1.

You can do that using ODP .NET (Oracle Data Provider for .NET), or other third parties library. If you're planning to build serious Oracle Application on .NET, I suggest you at least look at ODP.NET

查看更多
Rolldiameter
3楼-- · 2019-07-02 13:27

Oracle Connection string sample

You must have your Oracle SID defined in your TNSNames file. Which is the data source.

Data Source=oracl;User Id=userID;Password=password;Integrated Security=no

If you are using Visual Studios you can add a data source in the Sever Explore and it will give you the connection string.

查看更多
一纸荒年 Trace。
4楼-- · 2019-07-02 13:28

I'm not sure what you mean by connecting as a SYS, but there here is a link to sweet repository of connection strings. I hope you can find your answer there.

查看更多
登录 后发表回答