Skip to content
pvmehta.com

pvmehta.com

  • Home
  • About Me
  • Toggle search form
  • How to analyze statspack or AWR report. Oracle
  • myfile Oracle
  • Backup and Recovery Scenarios Oracle
  • The most important Tuning Notes Oracle
  • sbind.sql Find Bind variable from sql_id sqlid Oracle
  • scripts to take listener.log backup Linux/Unix
  • fkwoind.sql fkwoindex.sql Oracle
  • find_err.sql for finding errors from dba_errors. Oracle
  • When to rebuld B-tree index Oracle
  • How to remove blank lines using vi editor command Linux/Unix
  • Adding addidional hard drive and attach it to a linux box. Linux/Unix
  • Find Stale DR Physical Standby Oracle
  • Important Solaris Commands Linux/Unix
  • find_idle_cpu.sql Oracle
  • Oracle Data Direct to TAPE Oracle

before_trunc.sql Before Truncate table needs to execute following:

Posted on 31-Mar-2006 By Admin No Comments on before_trunc.sql Before Truncate table needs to execute following:

/* before_trunc.sql

This script gives disble constrints script before truncating table

*/

accept tblname prompt ‘Enter the Table Name You want to truncate -> ‘

column head heading “Execute Following Statements To Truncate &tblname, as &tblname is referenced by following foreign keys”

select ‘alter table ‘ || lpad(b.table_name, 30) || ‘ disable constraint ‘ || b.constraint_name || ‘;’ as “Head”

from user_constraints a, user_constraints b

where a.constraint_name = b.r_constraint_name

and a.table_name = upper(‘&tblname’);

Oracle, SQL scripts

Post navigation

Previous Post: TRUNCATE table and disabling referential constraints.
Next Post: catall.sh

Related Posts

  • First Entry in RAC Oracle
  • sqlnet.ora paramters Oracle
  • Another export with Query Oracle
  • Adding Datafile on Primary Server and Impact on Standby Server Oracle
  • temp_use.sql diplays usage of temp ts Oracle
  • Very clear article about oracle dataguard Oracle

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Categories

  • AWS (2)
  • Azure (1)
  • Linux/Unix (149)
  • Oracle (387)
  • PHP/MYSQL/Wordpress (10)
  • Power-BI (0)
  • Python/PySpark (7)
  • RAC (17)
  • rman-dataguard (26)
  • shell (149)
  • SQL scripts (336)
  • Uncategorized (0)
  • Videos (0)

Recent Posts

  • SQL Tracker by SID sqltrackerbysid.sql22-Apr-2025
  • How to connect to Oracle Database with Wallet with Python.21-Mar-2025
  • JSON/XML Types in Oracle18-Mar-2025
  • CPU Core related projections12-Mar-2025
  • Exadata Basics10-Dec-2024
  • Reading config file from other folder inside class24-Sep-2024
  • Python class import from different folders22-Sep-2024
  • Transfer SQL Profiles from One database to other database.05-Sep-2024
  • Load testing on Oracle 19C RAC with HammerDB18-Jan-2024
  • Add new columns in dataframe30-Sep-2023

Archives

  • 2025
  • 2024
  • 2023
  • 2010
  • 2009
  • 2008
  • 2007
  • 2006
  • 2005
  • Jai Shree Ram Linux/Unix
  • create a folder in multiple places Linux/Unix
  • Oracle 10g Installation/Applying Patches Tips Oracle
  • tblwopk.sql tablewopk.sql Oracle
  • Exadata Basics Oracle
  • To Find Orphan OS processes. Linux/Unix
  • restarting network in linux Linux/Unix
  • Convert multiple rows to single column Oracle

Copyright © 2025 pvmehta.com.

Powered by PressBook News WordPress theme