如何找到的所有代码,从涉及到特定表Oracle数据库触发器?(How do I find all c

2019-09-18 22:56发布

我有我需要删除所有的代码,并从涉及到某些表,以便Solaris软件包安装一个数据库触发器的一个问题。 长期复杂的故事,但我需要开始用干净的石板。

我已经成功地删除所有现有表/同义词,而是如何找到代码/从sqlplus的触发有关?

不幸的是,这是不可行删除数据库并重新创建它。

Answer 1:

好了,原来所有的表名与我的模块名称前缀DAP。

所以,找到用sqlplus的所有表名和公共同义词:

select table_name from all_tables where table_name like 'DAP%';
select synonym_name from all_synonyms where table_name like 'DAP%';

要获取触发器和序列的列表。

select trigger_name from all_triggers where table_name like 'DAP%';
select sequence_name from all_sequences where sequence_name like 'DAP%';

要获得所有的约束列表

select table_name, constraint_name from all_constraints where table_name like 'DAP%';

要获得DAP相关的代码:

select text from dba_source where name like 'DAP%';

我现在可以写滴一切的脚本。



Answer 2:

你应该能够查询系统表ALL_TRIGGERS找到触发器。 它有一个TABLE_NAME列。 你也许可以找到不同的系统表(已一段时间,因为我已经与Oracle搞砸)其他有关目的。

http://download.oracle.com/docs/cd/B19306_01/server.102/b14237/statviews_2107.htm



文章来源: How do I find all code, triggers from an oracle database that relate to specific tables?
标签: oracle10g