Home » RDBMS Server » Server Administration » Audit Logon of Specific User (Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production Version 19.17.0.0.0)
Audit Logon of Specific User [message #687361] Wed, 01 March 2023 10:44 Go to next message
wtolentino
Messages: 390
Registered: March 2005
Senior Member
I'm trying to create an audit policy whenever a user attempts to logon and could not connect successfully because of incorrect password. I tried this command and I am getting an error:

create audit policy connect_spiuser_policy actions logon 
when 'SYS_CONTEXT(''USERENV'',''SESSION_USER'')=''SPIUSER'''
whenever not successful;
SQL> create audit policy connect_spiuser_policy actions logon
  2  when 'SYS_CONTEXT(''USERENV'',''SESSION_USER'')=''SPIUSER'''
  3  whenever not successful;
whenever not successful
*
ERROR at line 3:
ORA-00905: missing keyword
Please advise. Thank you.
Re: Audit Logon of Specific User [message #687362 is a reply to message #687361] Wed, 01 March 2023 11:15 Go to previous messageGo to next message
John Watson
Messages: 8922
Registered: January 2010
Location: Global Village
Senior Member
You specify WHENEVER NOT SUCCESSFUL when you enable policy, not when you create it Smile

Example in the Security Guide here,
https://docs.oracle.com/en/database/oracle/oracle-database/19/dbseg/configuring-audit-policies.html#GUID-AC30632D-80E0-40BB-91AF-0416 A904A707
Re: Audit Logon of Specific User [message #687363 is a reply to message #687362] Wed, 01 March 2023 11:18 Go to previous messageGo to next message
wtolentino
Messages: 390
Registered: March 2005
Senior Member
That works. Thanks so much.
Re: Audit Logon of Specific User [message #687364 is a reply to message #687361] Wed, 01 March 2023 11:22 Go to previous message
Michel Cadot
Messages: 68625
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator

"whenever not successful" is an option of AUDIT not CREATE AUDIT POLICY.
You create the audit policy then you "activate" it using "AUDIT POLICY ... WHENEVER NOT SUCCESSFUL".

Previous Topic: New Oracle Home patches do not match database registry patches after migration
Next Topic: Oracle Tablespace Datafile Who Created
Goto Forum:
  


Current Time: Fri Mar 29 01:12:50 CDT 2024