SQL Language Guide : 8. SQL Statements : CREATE SECURITY_ALARM : CREATE SECURITY_ALARM Examples
 
Share this page                  
CREATE SECURITY_ALARM Examples
1. Log all successful changes to the employee table.
CREATE SECURITY_ALARM ON TABLE employee
    IF SUCCESS WHEN INSERT, UPDATE, DELETE BY PUBLIC;
2. Specify alarms for a specific user group or application role.
CREATE SECURITY_ALARM clerk_update ON TABLE secure_data IF FAILURE WHEN UPDATE BY GROUP clerk
These alarms are fired when a session connects as the specified group or role.
3. Specify alarm on a particular database or the current installation to raise an alarm when user, spy, connects to any database.
CREATE SECURITY_ALARM secconnect ON CURRENT INSTALLATION WHEN CONNECT BY USER spy
4. Raise an optional database event, secconnect, as the result of an alarm firing when user, spy, connects to database sec1.
CREATE SECURITY_ALARM secconnect ON DATABASE sec1
WHEN CONNECT BY USER spy
RAISE DBEVENT secconnect 'user spy connected to sec1 database';