Oracle通过表名查询触发器
Oracle通过表名查询触发器
查询命令
可查出对应表名下的所有触发器名称,触发器的状态(是否可用),触发器body(trigger_body,即触发器声明)…
注意:通过查看 ** TRIGGER_BODY **可查看触发器创建脚本。
举例验证
1 | select a.trigger_name,a.status,a.TRIGGER_BODY,a.* from all_triggers a where table_name= 'USER_INFO'
|
Oracle中查看触发器使用到的SQL
ORACLE 查出表所有的触发器及触发器详细信息
1、查all_triggers表得到trigger_name
1 | select trigger_name from all_triggers where table_name= 'XXX' ;
|
2、根据trigger_name查询出触发器详细信息
1 | select text from all_source where type= 'TRIGGER' AND name = 'TR_XXX' ;
|
3、在Oracle数据库中查询所有触发器、存储过程、视图、表
1 2 3 4 5 6 7 8 9 10 11 | Select object_name From user_objects Where object_type= 'TRIGGER' ;
Select object_name From user_objects Where object_type= 'PROCEDURE' ;
Select object_name From user_objects Where object_type= 'VIEW' ;
Select object_name From user_objects Where object_type= 'TABLE' ;
|
1 2 3 4 | Select * From user_triggers;
Select * From user_procedures;
Select * From user_views;
Select * From user_tables;
|