Job Seekers   Employers
dbapool: Authors | Submissions | Contact Us
   Forgot password? | Sign up
  Home   Discussion Forum   Articles   Interview Questions   FAQs   Scripts   Rewards   Analyzer   White Papers   Blog   Certification   Downloads   Tools
 

Topic: SQL*Plus and PL/SQL >> Truncate tables of all the schema's in Oracle Apps.

Disclaimer: The purpose of all dbapool forums including OCP and Other Oracle Certification forums is to help each other with specific issues but not to share dump and copyrighted exam content, materials or intellectual property. You may review the entire Oracle Certification Program Candidate Agreement online Here.



  


 Title: Truncate tables of all the schema's in Oracle Apps.
 Ramesh  Posted: Jun 23, 2008 02:44:31 AM

 Total Post: 2
 Joined: Jun, 2008






 I need a script for truncating all the Oracle Apps schema tables. It has to take care of all the constraints , parent & child table realtions etc.

It has around 230 schema's in Oracle Apps instance.

regards,
Ramesh

 Azaz
Posted: Jun 23, 2008 06:01:00 AM  

 Total Post: 84
 Joined: Mar, 2008






 
spool trunc_tab.sql
select 'truncate'
||' '||'table'
||' '||table_name
|| ';'
from dba_tables
where owner='&owner';
spool off

this may help you to truncate all the tables for that schema

select 'Alter Table'||' '||table_name||' '||'Disable Constraint'||' '||index_name||';' from dba_indexes where owner='&owner' ORDER BY TABLE_NAME

select 'Alter Table'||' '||table_name||' '||'Enable Constraint'||' '||index_name||';' from dba_indexes where owner='&owner' ORDER BY TABLE_NAME

this may help you to disable and enable constraints for that particular schema


 Ramesh
Posted: Jun 25, 2008 09:04:23 AM  

 Total Post: 2
 Joined: Jun, 2008






 
Does it take cares of truncating views , indexes etc in that schema?

 Vish
Posted: Sep 28, 2008 01:16:12 PM  

 Total Post: 84
 Joined: Jan, 2007






 
Dear Ramesh

Views and Index are basaed on table. If there are no raw in Table then View and Index will not have any row.

Correct me if i am wrong

 Time Zone: EDT

  




Forum Rules & Description


Who Can Read The Forum? Any registered user or guest
Who Can Post New Topics? Any registered user
Who Can Post Replies? Any registered user




 








Get FREE Magazines

Top 10 Forum User

  Murtuja Khokhar857
  Mohammed Taj746
  positive fanatic483
  Jayanta Sur479
  Vigyan Kaushik386
  Gopu Gopi327
  Gitesh Trivedi322
  Vinoth Kumar264
  neeraj sharma258
  Ramesh Jois246






oracle Mag



  About Us Advertise Terms of Use Privacy Newsletters Contact Us    

Home   Discussion Forum   FAQs  Articles  Jobs   Newsletters  Directory  Downloads 

Our Premium Sponsor
Confio Software