I'm having trouble connecting to my oracle databases with NTS and ODP as sysdba (the goal is to use a lot of maintenance scripts without any passwords in it). I did some research without success, so here I come.
Here is the powershell code I use :
$srvOra = "oracle_server"
$port = 1521
$serviceName = "serviceName"
Add-Type -Path "C:\some_rep\Oracle.ManagedDataAccess.dll" #version 4.121.2.0
$connectionString = "User Id=/;DBA Privilege=SYSDBA;Data Source=" + "(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)" + "(HOST=$srvOra)(PORT=$port))(CONNECT_DATA=" + "(SERVICE_NAME=$serviceName)))"
$connection = New-Object Oracle.ManagedDataAccess.Client.OracleConnection($connectionString)
$connection.open()
And here are my results :
Facts :
oracle databases are 12.1.0.2.0 std, servers are 2012R2 and sqlnet.ora only contain the following lign :
SQLNET.AUTHENTICATION_SERVICES = (NTS)
My account is member of ora_dba group on each database server.
Fips algorithm is disabled.
Connection from any computer with oracle components works with sqlplus /@some_entry as sysdba.
Any help will be appreciated. Thanks for your time :)
I found the solution.
The Oracle.ManagedDataAccess.dll version I had load was incorrect. So I copied correct version of dll from one of my oracle servers and It worked fine, as expected.