Skip to content
pvmehta.com

pvmehta.com

  • Home
  • About Me
  • Toggle search form
  • scripts to take listener.log backup Linux/Unix
  • lck.sql Oracle
  • TABLE SIZING WITH DB_BLOCK ARCHITECTURE Reference : Metalink note : 10640.1 Oracle
  • FGA Part-I Oracle
  • Changing the Global Database Name Oracle
  • Jai Shree Ram Linux/Unix
  • create trigger syntax Oracle
  • Difference between SYNC and AFFIRM Oracle
  • Updated LCK.SQL file. Oracle
  • Logic to chech # of parameters command line parameters Linux/Unix
  • Drop tempfiles from database Oracle
  • How to see which patches are applied. Oracle
  • shr1.sql for MTS or Shared server configuration Oracle
  • Committing distributed transaction using commit force Oracle
  • Running select from V$ views from remote server Linux/Unix

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

  • Alter procedure auditing Oracle
  • V$ROLLSTAT status is Full Oracle
  • Find_stale_dr.sql finding stale physical DR.. Oracle
  • Changing unix system clock when Oracle database is running. Oracle
  • Oracle Standby Database Library Index from Metalink Oracle
  • perf_today.sql Oracle

Leave a Reply Cancel reply

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

Categories

  • Ansible (0)
  • AWS (2)
  • Azure (1)
  • Django (0)
  • GIT (1)
  • Linux/Unix (149)
  • MYSQL (5)
  • Oracle (400)
  • PHP/MYSQL/Wordpress (10)
  • POSTGRESQL (1)
  • Power-BI (0)
  • Python/PySpark (7)
  • RAC (18)
  • rman-dataguard (26)
  • shell (150)
  • SQL scripts (348)
  • SQL Server (6)
  • Uncategorized (3)
  • Videos (0)

Recent Posts

  • Running PDB on single node in RAC09-Apr-2026
  • find_arc.sql09-Apr-2026
  • pvm_pre_change.sql08-Apr-2026
  • find_encr_wallet.sql08-Apr-2026
  • find_pdbs.sql08-Apr-2026
  • Creating a Container Database using dbaascli08-Apr-2026
  • track_autoupgrade_copy_progress.sql01-Apr-2026
  • refre.sql for multitenant01-Apr-2026
  • prepfiles.sh for step by step generating pending statistics files10-Mar-2026
  • tracksqltime.sql05-Mar-2026

Archives

  • 2026
  • 2025
  • 2024
  • 2023
  • 2010
  • 2009
  • 2008
  • 2007
  • 2006
  • 2005
  • Physical Standby switchover with session active Oracle
  • initUOCIOTTO.ora Oracle
  • backspace in SQL Plus not working then..? Linux/Unix
  • Multiple listeners Oracle
  • fkwoindex.sql /* Find FK without Index */ Oracle
  • oradebug ipcrm ipcs Oracle
  • import-export with multiple files Oracle
  • tab.sql Oracle

Copyright © 2026 pvmehta.com.

Powered by PressBook News WordPress theme