cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

ORA-1017 from powershell script only

PeterLA2
Newcomer
0 Likes
469

Hi all,

old topic maybe, but with a new twist...

I have an SAP system with an oracle database on windows that I can connect to from the command line as sidadm just fine:

sqlplus / as sysdba

SQL*Plus: Release 19.0.0.0.0 - Production on Fri May 9 17:52:12 2025
Version 19.14.0.0.0

Copyright (c) 1982, 2021, Oracle. All rights reserved.

Connected to:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.14.0.0.0
SQL>

If I try the same from a powershell script, I am getting ora-1017:

$AdminDomain = 'host'
$AdminUsername = 'sidadm'
$AdminPassword = 'password'

$credential = New-Object System.Management.Automation.PSCredential @(($AdminDomain + "\" + $AdminUsername), (ConvertTo-SecureString -String $AdminPassword -AsPlainText -Force))

Invoke-Command -Credential $credential -ComputerName localhost -ScriptBlock { get-childitem env:
sqlplus -S / as sysdba }

Resulting output:

Name Value PSComputerName
---- ----- --------------
DBMS_TYPE ora localhost
dbs_ora_schema SAPSR3 localhost
dbs_ora_tnsname SID localhost
NLS_LANG AMERICAN_AMERICA.UTF8 localhost
ORACLE_HOME F:\oracle\SID\19.0.0 localhost
ORACLE_SID SID localhost
PSModulePath C:\Users\sidadm\Documents\WindowsPowerShell\Modules;C:\Prog... localhost
PUBLIC C:\Users\Public localhost
rsdb_ssfs_connect 1 localhost
RSEC_SSFS_DATAPATH \\host\sapmnt\SID\SYS\global\security\rsecssfs\data localhost
RSEC_SSFS_KEYPATH \\host\sapmnt\SID\SYS\global\security\rsecssfs\key localhost
SAP_DIR_PERF F:\usr\sap\PRFCLOG localhost
SAPDATA_HOME K:\oracle\SID localhost
SAPEXE F:\usr\sap\SID\SYS\exe\uc\NTAMD64 localhost
SAPLOCALHOST host localhost
SAPSYSTEMNAME SID localhost
...
TNS_ADMIN \\host\sapmnt\SID\SYS\profile\oracle localhost
ERROR:
ORA-01017: invalid username/password; logon denied


a tnsping with invoke-command shows that I am connecting to the correct host and database.
Enabling audit trail creates no audit file for failed logins.
Enabling client trace in sqlnet.ora writes a trace file whenever sqlplus is invoked from the command line but not with invoke-command from powershell.

Any ideas ?


Accepted Solutions (0)

Answers (1)

Answers (1)

mamartins
Active Contributor
0 Likes

When you are logging on with SQLPLUS, you use the OPS$ connection method. With the POWERSHELL script, you are using username/password combination.

Please check these SAP notes:

  • 3262491 - R3trans -d failed with Connecting as SYSTEM - Netweaver
  • 3110012 - R3trans returns error ORA-01017 - Netweaver
  • 2939522 - Installation fails while testing connection to the database