Useful shortcuts for vi editor

Showing posts with label login. Show all posts
Showing posts with label login. Show all posts

Tuesday 21 March 2017

How to manage logon mechanism with trigger ?

CREATE OR REPLACE TRIGGER SYS.DENY_LOGIN
   AFTER LOGON
   ON DATABASE
BEGIN
   IF     TO_CHAR (SYSDATE, 'hh24') BETWEEN 08 AND 22
      AND SYS_CONTEXT ('USERENV', 'SESSION_USER') = 'HR'
   THEN
      raise_application_error (
         -20001,
         'You cannot login between 08 AM and 06 PM. Please contact with Alper!');
   END IF;
END deny_login;
/

Error message:
ORA-00604: error occurred at recursive SQL level 1
ORA-20001: You cannot login between 08 AM and 06 PM. Please contact with Alper!
ORA-06512: at line 5

Monday 23 January 2017

How to configure login options in Oracle?

Apply the option permanently
sec_case_sensitive_logon=FALSE
or
sec_case_sensitive_logon=TRUE

Check the parameter
SQL>
show parameter sec_case_sensitive_logon

Note that default value is "TRUE"