Triggers can be firing on the following types of events:
- DML events
- DDL events
- Database events
Example of DDL trigger:
CREATE OR REPLACE TRIGGER some_triggerDatabase triggers are something even more interesting. They fire on the following events:
BEFORE GRANT ON schema.object
BEGIN
...
END;
SERVERERROR event seemed very useful to me. You can create a trigger which will send each error message to your mail box, using the UTL_SMTP package.SERVERERROR Specify
SERVERERROR
to fire the trigger whenever a server error message is logged.The following errors do not cause a
SERVERERROR
trigger to fire:
ORA-01403
: no data found
ORA-01422
: exact fetch returns more than requested number of rows
ORA-01423
: error encountered while checking for extra rows in exact fetch
ORA-01034
: ORACLE not available
ORA-04030
: out of process memory when trying to allocatestring
bytes (string
,string
)LOGON Specify
LOGON
to fire the trigger whenever a client application logs onto the database.LOGOFF Specify
LOGOFF
to fire the trigger whenever a client application logs off the database.STARTUP Specify
STARTUP
to fire the trigger whenever the database is opened.SHUTDOWN Specify
SHUTDOWN
to fire the trigger whenever an instance of the database is shut down.SUSPEND Specify
SUSPEND
to fire the trigger whenever a server error causes a transaction to be suspended.DB_ROLE_CHANGE In a Data Guard configuration, specify
DB_ROLE_CHANGE
to fire the trigger whenever a role change occurs from standby to primary or from primary to standby.
No comments:
Post a Comment