Database Triggers and event attributes--DDL/Client Events【Blog 搬家】
Database Triggers and event attributes--DDL/Client Events
DDL/Client Events
There are 14 DDL/client event triggers and these can be created at the database level and will execute for all schemas, or these can be created at the schema level and will execute only for the schema it is created for. When a trigger is created at the schema level, the trigger is created in the schema specified and executes only for that schema.
This provides a great deal of flexibility depending on your environment and what you want to monitor or respond to. The 14 DDL/client event triggers are outlined below, along with a description and the event attributes that are set for each event.
Database Trigger |
BEFORE/AFTER Execution |
Description |
Attribute Events |
ALTER |
BEFORE/AFTER |
Executed when object altered |
ora_sysevent ora_login_user ora_instance_num ora_database_name ora_dict_obj_type ora_dict_obj_name ora_dict_obj_owner ora_des_encrypted_password (for ALTER USER events) ora_is_alter_column, ora_is_drop_column (for ALTER TABLE events) |
DROP |
BEFORE/AFTER |
Executed when object is dropped |
ora_sysevent ora_login_user ora_instance_num ora_database_name ora_dict_obj_type ora_dict_obj_name ora_dict_obj_owner |
ANALYZE |
BEFORE/AFTER |
Executed when the analyze command is executed |
ora_sysevent ora_login_user ora_instance_num ora_database_name ora_dict_obj_name ora_dict_obj_type ora_dict_obj_owner |
ASSOCIATE STATISTICS |
BEFORE/AFTER |
Executed when the associate statistics command is executed |
ora_sysevent ora_login_user ora_instance_num ora_database_name ora_dict_obj_name ora_dict_obj_type ora_dict_obj_owner ora_dict_obj_name_list ora_dict_obj_owner_list |
AUDIT/NOAUDIT |
BEFORE/AFTER |
Executed when the audit or noaudit command is executed |
ora_sysevent ora_login_user ora_instance_num ora_database_name |
COMMENT |
BEFORE/AFTER |
Executed when the comment command is executed |
ora_sysevent ora_login_user ora_instance_num ora_database_name ora_dict_obj_name ora_dict_obj_type ora_dict_obj_owner |
CREATE |
BEFORE/AFTER |
Executed when an object is created |
ora_sysevent ora_login_user ora_instance_num ora_database_name ora_dict_obj_type ora_dict_obj_name ora_dict_obj_owner ora_is_creating_nested_table (for CREATE TABLE events) |
DDL |
BEFORE/AFTER |
Executed when SQL DDL commands are executed (not executed when and ALTER/CREATE DATABASE, CREATE CONTROLFILE, or DDL issued through the PL/SQL procedure interface) |
ora_sysevent ora_login_user ora_instance_num ora_database_name ora_dict_obj_name ora_dict_obj_type ora_dict_obj_owner |
DISASSOCIATE STATISTICS |
BEFORE/AFTER |
Executed when the disassociate statistics command is executed |
ora_sysevent ora_login_user ora_instance_num ora_database_name ora_dict_obj_name ora_dict_obj_type ora_dict_obj_owner ora_dict_obj_name_list ora_dict_obj_owner_list |
GRANT |
BEFORE/AFTER |
Executed when the grant command is executed |
ora_sysevent ora_login_user ora_instance_num ora_database_name ora_dict_obj_name ora_dict_obj_type ora_dict_obj_owner ora_grantee ora_with_grant_option ora_privileges |
RENAME |
BEFORE/AFTER |
Executed when the rename command is executed |
ora_sysevent ora_login_user ora_instance_num ora_database_name ora_dict_obj_name ora_dict_obj_owner ora_dict_obj_type |
REVOKE |
BEFORE/AFTER |
Executed when the revoke command is executed |
ora_sysevent ora_login_user ora_instance_num ora_database_name ora_dict_obj_name ora_dict_obj_type ora_dict_obj_owner ora_revokee ora_privileges |
TRUNCATE |
BEFORE/AFTER |
Execute when a table is truncated |
ora_sysevent ora_login_user ora_instance_num ora_database_name ora_dict_obj_name ora_dict_obj_type ora_dict_obj_owner |
The new triggers are ideal for DBAs to build mechanisms based on certain events. When the database is started, the objects that need to be pinned can now be moved from the startup SQL script. to the STARTUP trigger. When the database is shut down, statistics scripts can be executed to log information into monitoring tables with the SHUTDOWN trigger. Error trapping can be enhanced with the SERVERERROR trigger. Capturing user connect time can be handled through the LOGON and LOGOFF triggers. An object audit trail can be created through the CREATE, ALTER, and DROP triggers.
myhuaer 發表於:2004.11.15 11:04 ::分類: ( Oracle Infomation ) ::閱讀:(705次)
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/34596/viewspace-661920/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- Database Triggers and event attributes--DDL/Client EventsDatabaseclient
- Database Triggers and event attributes--Database System Events【Blog 搬家】Database
- Database Triggers and event attributes--Event Attributes【Blog 搬家】Database
- Database Triggers and event attributes--Introduction[Blog 搬家]Database
- Database Triggers and event attributes--Database System EventsDatabase
- oracle Database Event trace 設定【Blog 搬家】OracleDatabase
- float datatype in Oracle database 【Blog 搬家】OracleDatabase
- Database Triggers and event attributes--Event AttributesDatabase
- Oracle Database Link Problems【Blog 搬家】OracleDatabase
- Oracle event 10231 【Blog 搬家】Oracle
- Database Triggers and event attributes--IntroductionDatabase
- Database Link 建立注意的兩點【Blog 搬家】Database
- Oracle System Event TriggersOracle
- Oracle backgroud Process【Blog 搬家】Oracle
- oracle Distinct|Unique 異同【Blog 搬家】Oracle
- Oracle DDL 執行過程【Blog 搬家】Oracle
- HP -Data Protector Restore file system【Blog 搬家】REST
- V$SESSION_LONGOPS bug 【Blog 搬家】SessionGo
- 限制End User Session數量 【Blog 搬家】Session
- Trim() 函式的介紹【Blog 搬家】函式
- Oracle Date Function 講解和事例【Blog 搬家】OracleFunction
- ora -03232 問題解決【Blog 搬家】
- oracle ora-00997 problems【Blog 搬家】Oracle
- RMAN 只備份當前資料?【Blog 搬家】
- mysql的mysql.event和information_schema.eventsMySqlORM
- alter system set event和set events的區別
- alter system events與alter system event的區別
- exp/imp expdp/impdp Tables 萬用字元 % 的使用【Blog 搬家】字元
- Oracle Optimizer -RBO (理解Rule-based 優化器)【Blog 搬家】Oracle優化
- oracle Database Event trace 設定OracleDatabase
- 資料庫加密Product_user_profile(PUP) TABLE FOR security 【Blog 搬家】資料庫加密
- MM-DD-RRRR / MM-DD-YYYY 的區別【Blog 搬家】
- How To List All The Named Events Set For A Database [ID 436036.1]Database
- Unable to Connect to Database with Oracle Client Software for WindowsDatabaseOracleclientWindows
- How To List All The Named Events Set For A Database (Doc ID 436036.1)Database
- 執行node提示:events.js:160 throw er; // Unhandled 'error' eventJSError
- zt_關於wait events asynch descriptor resize_wait eventAI
- 說服您的CTO使用事件溯源 -Event Store Blog事件