Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How to get all the associated objects to a table?

574641Apr 7 2010 — edited Apr 8 2010
Hi,

I have a requirement to delete records from a 50 million row table ( to delete 5 million rows each month).
Now the designer has given me a design where instead of deleting the records, he is creating a new table with records that need to be kept.

The thing that haunts me is that now this old table might have several items associated with it. Indexes, Synonyms, Triggers, Constraints, etc.... . My plan was to use DBMS_METADATA.get_ddl to get the DDLs for each of these objects associated to the table. But the issue is that, say today they might only have indexes and my script would generate indexes after the new table is created. Tomorrow some other application team will have created a trigger, which my script will never create.

So is there some option which would give me the objects associated with a table and also give one full big script which has all the create index,create trigger etc.... , instead of cretaing them induvidually using get_ddl?

Thanks,
Saff
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 6 2010
Added on Apr 7 2010
4 comments
847 views