Oracle不会以某个用户ID打开

时间:2017-03-10 18:34:19

标签: c# oracle windows-server-2008

我有一个从任务调度程序运行的应用程序。如果我从我的帐户运行它,它运行正常,但如果我从系统帐户运行它(这个帐户在我的服务器上具有与我相似的权限(它甚至是管理员)),但是密码是非过期的。当我从打开Oracle时失败的系统帐户运行它。我的应用程序不会抛出异常。它只是死了。但是,事件查看器有以下内容:

Application: M921.exe
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.NullReferenceException
Stack:
   at Oracle.DataAccess.Client.OracleException.get_Source()
   at M921.Program.Main(System.String[])

Faulting application name: M921.exe, version: 1.0.0.0, time stamp: 0x58c2d17b
Faulting module name: unknown, version: 0.0.0.0, time stamp: 0x00000000
Exception code: 0xc0000005
Fault offset: 0x037d2be3
Faulting process id: 0x564
Faulting application start time: 0x01d299ba8cb4ef63
Faulting application path: D:\ScriptingApplications\M921\M921.exe
Faulting module path: unknown
Report Id: cbb37f30-05ad-11e7-97a4-005056824753

如果我检查跟踪日志,我会发现:

<msg time='2017-03-10T10:11:23.998-05:00' org_id='oracle' comp_id='clients'
 msg_id='3079483318' type='INCIDENT_ERROR' level='1'
 host_id='PWN401AV1369' host_addr='::1' prob_key='oci 24550 [3221225477]'
 errid='15721' detail_path='C:\Users\scrptadmin\Oracle\oradiag_scrptadmin\diag\clients\user_scrptadmin\host_2384361277_82\trace\ora_3292_1232.trc'>
 <txt>Errors in file



C:\Users\scrptadmin\Oracle\oradiag_scrptadmin\diag\clients\user_scrptadmin\host_2384361277_82\trace\ora_3292_1232.trc  (incident=15721):
oci-24550 [3221225477] [Unhandled exception: Code=c0000005 Flags=0
] [] [] [] [] [] [] [] [] [] []
 </txt>
</msg>
<msg time='2017-03-10T10:11:24.186-05:00' org_id='oracle' comp_id='clients'
 msg_id='dbgexProcessError:1266:3370026720' type='TRACE' level='16'
 host_id='PWN401AV1369' host_addr='::1'>
 <txt>Incident details in: C:\Users\scrptadmin\Oracle\oradiag_scrptadmin\diag\clients\user_scrptadmin\host_2384361277_82\incident\incdir_15721\ora_3292_1232_i15721.trc
 </txt>
</msg>

我已经检查了我能想到的所有权限。数据库凭据是oracle凭据(不是Windows凭据;用户名和密码是连接字符串的一部分)

我使用的是版本12.1.0 oracle客户端

我很困惑。

1 个答案:

答案 0 :(得分:0)

由于您没有提供任何源代码,我只是在这里猜测。要使用特权帐户(SYSDBA或SYSOPER)进行连接,需要将DBA特权属性添加到连接字符串中:

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

Oracle文档link