- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: create trigger on logon between hours
Operating System - HP-UX
1748185
Members
4026
Online
108759
Solutions
Forums
Categories
Company
Local Language
юдл
back
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
юдл
back
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-01-2010 01:10 PM
тАО06-01-2010 01:10 PM
create trigger on logon between hours
Has anyone done this...
I want to create a trigger that will only allow the user to log into the database between 12 and 4 am.
My next question is can I assign this trigger to the role that the user has been assigned to?
I have pulled some similar code that I would like to use but do not know how to modify it to be either assigned to a user: npq or to the role ntq_ro.
I do not know what the declare dba number means...
create or replace trigger logon_time after logon on database
declare dba number;
begin
if to_char(sysdate,'HH24') between 4 and 24
then
raise_application_error(-20001,'Not allowed to logon database during this time');
end if;
end
/
I want to create a trigger that will only allow the user to log into the database between 12 and 4 am.
My next question is can I assign this trigger to the role that the user has been assigned to?
I have pulled some similar code that I would like to use but do not know how to modify it to be either assigned to a user: npq or to the role ntq_ro.
I do not know what the declare dba number means...
create or replace trigger logon_time after logon on database
declare dba number;
begin
if to_char(sysdate,'HH24') between 4 and 24
then
raise_application_error(-20001,'Not allowed to logon database during this time');
end if;
end
/
3 REPLIES 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-01-2010 08:08 PM
тАО06-01-2010 08:08 PM
Re: create trigger on logon between hours
Hi,
I dont know more about "trigger"
I think you can set these kind of things in database itself.
If you are talking about unix login then yes we can create a script and put into the users .profile there we can restricted this kind of things.
Suraj
I dont know more about "trigger"
I think you can set these kind of things in database itself.
If you are talking about unix login then yes we can create a script and put into the users .profile there we can restricted this kind of things.
Suraj
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-01-2010 08:50 PM
тАО06-01-2010 08:50 PM
Re: create trigger on logon between hours
hi,
from security reason it should be set on the DB level.
mikap
from security reason it should be set on the DB level.
mikap
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-02-2010 03:15 AM
тАО06-02-2010 03:15 AM
Re: create trigger on logon between hours
Hi
declare dba number; => you declare a variable (but it's not used in your code!)
If I understand you want to check the user's role. you need to add a few lines of code and check the table user_role_privs.
The user will be able to connect at 23:59 !
Regards
Jean-Luc
declare dba number; => you declare a variable (but it's not used in your code!)
If I understand you want to check the user's role. you need to add a few lines of code and check the table user_role_privs.
The user will be able to connect at 23:59 !
Regards
Jean-Luc
fiat lux
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
News and Events
Support
© Copyright 2024 Hewlett Packard Enterprise Development LP