Oracle 11gR1
DBA_TRIGGERS
describes all triggers in the database. Its columns are the same as those in ALL_TRIGGERS
.
· ALL_TRIGGERS
describes the triggers on tables accessible to the current user. If the user has the CREATE ANY TRIGGER
privilege, then this view describes all triggers in the database.
· USER_TRIGGERS
describes the triggers owned by the current user. This view does not display the OWNER
column.
Column | Datatype | NULL | Description |
|
| | Owner of the trigger |
|
| | Name of the trigger |
|
| | When the trigger fires: · · · · · · |
|
| | DML, DDL, or database event that fires the trigger |
|
| | Owner of the table on which the trigger is defined |
|
| | Base object on which the trigger is defined: · · · · |
|
| | If the base object type of the trigger is |
|
| | Name of the nested table column (if a nested table trigger), else NULL |
|
| | Names used for referencing |
|
| | Must evaluate to |
|
| | Indicates whether the trigger is enabled ( |
|
| | Trigger description; useful for re-creating a trigger creation statement |
|
| | Action type of the trigger body: · · |
|
| | Statements executed by the trigger when it fires |
Note:
1. List triggers by schema
select trigger_name
, trigger_type
, table_name
, status
from dba_triggers
where owner = '&owner'
order by status, table_name;
TRIGGER_NAME | TRIGGER_TYPE | TABLE_NAME | STATUS |
SPCOL_DEL_CASCADE_50 | AFTER EACH ROW | STU_TAB | ENABLED |
SPCOL_DEL_CASCADE_49 | AFTER EACH ROW | PAS_TAB | ENABLED |
SPCOL_DEL_CASCADE_48 | AFTER EACH ROW | BUS_TAB | ENABLED |
SDE_LOGFILE_DELETE | AFTER EACH ROW | SDE_LOGFILES | ENABLED |
2. Display all triggers on the specified table
select trigger_name
, trigger_type
, status
from dba_triggers
where owner = '&owner'
and table_name = '&table'
order by status, trigger_name;
3. Enable/Disable a trigger
alter triggerenable
alter triggerdisable
No comments:
Post a Comment