SQL*Plus Does Not Return "FAILURE" Even If an Error Occurs At Logon
(Doc ID 2820050.1)
Last updated on MARCH 03, 2025
Applies to:
SQL*Plus - Version 11.2.0.4 and laterInformation in this document applies to any platform.
Symptoms
If running a shell script by non-interactive mode, SQL*Plus returns 0(SUCCESS) as OSERROR code when an error like ORA-1017, ORA-01034 occurs at logon.
Example:
Running the script in interactive mode, OSERROR is returned 1(FAILURE) as expected.
$ ./<shellscript>.sh
ERROR:
ORA-01017: invalid username/password; logon denied
ERROR:
ORA-01017: invalid username/password; logon denied
ERROR:
ORA-01017: invalid username/password; logon denied
SP2-0157: unable to CONNECT to ORACLE after 3 attempts, exiting SQL*Plus
OSERROR=1
But if running it in non-interactive mode, OSERROR is returned 0(SUCCESS).
$ true | ./<shellscript>.sh
ERROR:
ORA-01017: invalid username/password; logon denied
OSERROR=0
Changes
Cause
To view full details, sign in with your My Oracle Support account. |
|
Don't have a My Oracle Support account? Click to get started! |
In this Document
Symptoms |
Changes |
Cause |
Solution |
References |