How can i connect to oracle database as sysdba usi

2019-08-26 08:21发布

问题:

i can connect to oracle normal user successfully but when i try to connect sys user i got this error.

ORA-28009: connection as SYS should be as SYSDBA or SYSOPER

because i have to connect as sysdba but how can do it on bltoolkit ?

How can solve this problem ?

I have to connect as sys user to oracle using bltoolkit

My Connstring:

Data Source=(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=localhost)(PORT=1521))(CONNECT_‌​DATA=(SID=prod)));User Id=sys;Password=manager;DBA Privilege=SYSDBA;Data Source=oracle;

回答1:

Oracle allows database administrators to connect to an Oracle Database with either SYSDBA or SYSOPER privileges. This is done through the DBA Privilege attribute of the ConnectionString.

//Connect SYS/SYS as SYSDBA   
con.ConnectionString = "User Id=SYS;Password=SYS;" + 
  "DBA Privilege=SYSDBA;Data Source=oracle;";