Truncate all tables in schema
3073Jan 18 2006 — edited Jan 18 2006Hi,
I want to truncate all tables (300 tables) in a schema. There are some enabled constraints in this schema. I want to keep all tables attached objects (like indexes, constraints, etc). Id like to create a procedure to do this job. What's the safe and right way for this?
I am thinking as follows:
1- Retrieve all user constraints name using user_constrants view and then disable them.
2- Retrieve all user tables name using user_tables view and then Truncate them.
3- Enable all constraints that were disabled in step 1.
Is this a safe and right way?
Let me know your thought please. Thanks.