The question is published on by Tutorial Guruji team.
We have a number of development environments and an application that opens 20+ logins to our database in each environment.
Every time someone misconfigures an application, we get a log entry that says simply:
java.sql.SQLException: ORA-01017: invalid username/password; logon denied
This happens a lot, and it would simplify life tremendously if either Spring Framework, Oracle or Apache Tomcat could be configured to report the username that could not log in.
This usually happens during application startup when Spring is wiring the beans for the application, so I’m not sure if our code (e.g., custom error pages) is even available yet.
Anyone have any cool ideas about how to do this?
At the database level, you can enable AUDIT TRAIL to log all the login details. It could be done by setting the
audit_trail parameter to true.
show parameter audit_trail
Once enabled for unsuccessful logons, all failed logon attempts will be directed to the database audit trail
SYS.AUD$ table. You could query
dba_audit_trail to fetch the details:
select os_username, username, terminal, to_char(timestamp,'MM-DD-YYYY HH24:MI:SS') from dba_audit_trail;