Database Triggers and event attributes--Database System Events【Blog 搬家】

Database Triggers and event attributes--Database System Events

There are six database system event triggers. The six database system 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 Event

LOGOFF

BEFORE

Executed when a user logs off, at the start of the logoff process

ora_sysevent

ora_login_user

ora_instance_num

ora_database_name

LOGON

AFTER

Executed when a user logs into the database, after a successful login of the user

ora_sysevent

ora_login_user

ora_instance_num

ora_database_name

ora_client_ip_address

STARTUP

AFTER

Executed when the database is opened; starts a separate transaction and commits after this trigger is complete

ora_sysevent

ora_login_user

ora_instance_num

ora_database_name

SHUTDOWN

BEFORE

Executed when the instance is shutdown; prior to the shutdown of the instance process; not always executed on abnormal shutdown; starts a separate transaction and commits after this trigger is complete

ora_sysevent

ora_login_user

ora_instance_num

ora_database_name

SERVERERROR

AFTER

Executes when an Oracle error occurs (can check for a specific error number to only execute for (errno=eno)); does not execute for certain errors (1034, 1403, 1422, 1423, 4030); starts a separate transaction and commits after this trigger is complete

ora_sysevent

ora_login_user

ora_instance_num

ora_database_name

ora_server_error

ora_is_servererror

space_error_info

SUSPEND

AFTER

Executed whenever a server error causes a transaction to be suspended (example: out-of-space error)

ora_sysevent

ora_login_user

ora_instance_num

ora_database_name

ora_server_error

ora_is_servererror

space_error_info

The startup and shutdown triggers can only be created at the database level. The other four database system events can be created at the database or schema levels. The STARTUP trigger returns a success, even if the trigger fails.

The SERVERERROR trigger does not execute when the following Oracle errors are returned:

·               ORA-01403: data not 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

For these triggers, Oracle opens an autonomous transaction scope, fires the trigger, and commits any separate transaction.


myhuaer 发表于:2004.11.15 11:04 ::分类: ( Oracle Infomation ) ::阅读:(17813次)

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/34596/viewspace-661921/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/34596/viewspace-661921/

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值