Client events are the events related to user logon/logoff, DML, and DDL operations. For example:
CREATE OR REPLACE TRIGGER On_Logon
AFTER LOGON
ON The_user.Schema
BEGIN
Do_Something;
END;
The LOGON and LOGOFF events allow simple conditions on UID( ) and USER( ). All other events allow simple conditions on the type and name of the object, as well as functions like UID( ) and USER( ).
The LOGON event starts a separate transaction and commits it after firing the triggers. All other events fire the triggers in the existing user transaction.
The LOGON and LOGOFF events can operate on any objects. For all other events, the corresponding trigger cannot perform. any DDL operations, such as DROP and ALTER, on the object that caused the event to be generated.
The DDL allowed inside these triggers is altering, creating, or dropping a table, creating a trigger, and compile operations.
If an event trigger becomes the target of a DDL operation (such as CREATE TRIGGER), it cannot be fired later during the same transaction
Table 16-3 contains a list of client events.
Table 16-3 Client Events| Event | When Fired? | Attribute Functions |
|---|---|---|
BEFORE ALTER |
When a catalog object is altered. |
ora_sysevent |
BEFORE DROP |
When a catalog object is dropped. |
ora_sysevent |
BEFORE ANALYZE |
When an analyze statement is issued |
ora_sysevent |
BEFORE ASSOCIATE STATISTICS |
When an associate statistics statement is issued |
ora_sysevent |
BEFORE AUDIT |
When an audit or noaudit statement is issued |
ora_sysevent |
BEFORE COMMENT |
When an object is commented |
ora_sysevent |
BEFORE CREATE |
When a catalog object is created. |
ora_sysevent |
BEFORE DDL |
When most SQL DDL statements are issued. Not fired for ALTER DATABASE, CREATE CONTROLFILE, CREATE DATABASE, and DDL issued through the PL/SQL procedure interface, such as creating an advanced queue. |
ora_sysevent |
BEFORE DISASSOCIATE |
When a disassociate statistics statement is issued |
ora_sysevent |
BEFORE GRANT |
When a grant statement is issued |
ora_sysevent |
BEFORE LOGOFF |
At the start of a user logoff |
ora_sysevent |
AFTER LOGON |
After a successful logon of a user. |
ora_sysevent |
BEFORE RENAME |
When a rename statement is issued. |
ora_sysevent |
BEFORE REVOKE |
When a revoke statement is issued |
ora_sysevent |
AFTER SUSPEND |
After a SQL statement is suspended because of an out-of-space condition. The trigger should correct the condition so the statement can be resumed. |
ora_sysevent |
BEFORE TRUNCATE |
When an object is truncated |
ora_sysevent |
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/90618/viewspace-620846/ ,如需转载,请注明出处,否则将追究法律责任。