Skip to Main Content

Breadcrumb

Question and Answer

Tom Kyte

Thanks for the question, Rob.

Asked: August 27, 2004 - 12:09 pm UTC

Last updated: August 27, 2004 - 1:24 pm UTC

Version: 9.2.0.5

Viewed 1000+ times

You Asked

I'm have been asked if there is a way to limit a userid logins to certain times of day.

Example: user test1 can only login between 17:00 and 22:00.

I have not found anything in the docs or on the web talking about if this is possible or not. If it is possible, please let me know how this can be done.

Thanks for you time,
Rob


and Tom said...

you can easily use a logon trigger to prevent logons by anyone at any time.


</code> http://docs.oracle.com/cd/B10501_01/appdev.920/a96590/adg14evt.htm#999437 <code>


if ( user = 'TEST1' and NOT to_char(sysdate,'hh24') between '17' and '22' )
then
raise_application_error( -20000, 'No, not now' );
end if;

Rating

  (1 rating)

Is this answer out of date? If it is, please let us know via a Comment

Comments

Thanks

Rob Emerson, August 27, 2004 - 1:24 pm UTC

Thank you, that's what I was looking for.

More to Explore

PL/SQL demos

Check out more PL/SQL tutorials on our LiveSQL tool.

PL/SQL docs

PL/SQL reference manual from the Oracle documentation library