0% found this document useful (0 votes)
62 views

How Do I Find All Code PDF

The document discusses how to find all code and triggers in an Oracle database that relate to specific tables. It provides the following suggestions: 1) Query the ALL_TABLES, ALL_SYNONYMS, ALL_TRIGGERS, ALL_SEQUENCES, and ALL_CONSTRAINTS views to find objects with names prefixed with a given string, like "DAP%". 2) Query the DBA_SOURCE view to find code objects with names prefixed with the same string. 3) Write a script to drop all found objects to clean the slate for a new package installation.

Uploaded by

julio25c
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
62 views

How Do I Find All Code PDF

The document discusses how to find all code and triggers in an Oracle database that relate to specific tables. It provides the following suggestions: 1) Query the ALL_TABLES, ALL_SYNONYMS, ALL_TRIGGERS, ALL_SEQUENCES, and ALL_CONSTRAINTS views to find objects with names prefixed with a given string, like "DAP%". 2) Query the DBA_SOURCE view to find code objects with names prefixed with the same string. 3) Write a script to drop all found objects to clean the slate for a new package installation.

Uploaded by

julio25c
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

oracle10g - How do I find all code, triggers from an oracle database that relate to specific ...

Page 1 of 2

Overflow

How do I find all code, triggers from an oracle database that relate to specific tables?

I have a problem where I need to remove all code and triggers from a database that relate to certain tables in order for a Solaris package to install. Long complicated story but I need to start with a clean slate. I've managed to remove all the existing tables/synonyms, but how to locate the code/triggers from sqlplus that is related? Unfortunately, it's not feasible to drop the database and recreate it.
oracle10g

asked Jul 15 '09 at 3:42 Matt 5,104 2 21 52 87% accept rate feedback

2 Answers
Well, it turns out all the table names are prefixed with my module name DAP. So, to find all the table names and public synonyms with sqlplus: select table_name from all_tables where table_name like 'DAP%'; select synonym_name from all_synonyms where table_name like 'DAP%';

To get a list of triggers and sequences select trigger_name from all_triggers where table_name like 'DAP%'; select sequence_name from all_sequences where sequence_name like 'DAP%';

To get a list of all the constraints select table_name, constraint_name from all_constraints where table_name like 'DAP%';

To get the DAP related code: select text from dba_source where name like 'DAP%';

I can now write a script that drops everything.


edited Jul 15 '09 at 5:03 answered Jul 15 '09 at 4:01 Matt 5,104 2 21 52

feedback

http://stackoverflow.com/questions/1129288/how-do-i-find-all-code-triggers-from-an-ora... 16/10/2012

oracle10g - How do I find all code, triggers from an oracle database that relate to specific ... Page 2 of 2

You should be able to query the system table ALL_TRIGGERS to find the triggers. It has a table_name column. You can probably find the other related objects with different system tables (been awhile since I've messed with Oracle). http://download.oracle.com/docs/cd/B19306_01/server.102/b14237/statviews_2107.htm
answered Jul 15 '09 at 3:50 Nate 1,250 4 12 feedback

Not the answer you're looking for? Browse other questions tagged oracle10g or ask your own question.

http://stackoverflow.com/questions/1129288/how-do-i-find-all-code-triggers-from-an-ora... 16/10/2012

You might also like