Skip to content
pvmehta.com

pvmehta.com

  • Home
  • About Me
  • Toggle search form
  • rm_backup_arch_file.ksh Linux/Unix
  • Histogram Overview Oracle
  • cache buffer chain latch Oracle
  • exp syntax in oracle 10g Oracle
  • Jai Shree Ram Oracle
  • SQL_PLAN.sql for checking real execution plan Oracle
  • Vivek Tuning for Row Locks. Oracle
  • How to see which patches are applied. Oracle
  • catting.sh Linux/Unix
  • online_ts_bkup.sql Oracle
  • Python class import from different folders Python/PySpark
  • sql_plan9i.sql Oracle
  • oracle fast start failover best practice Oracle
  • find_log_switch.sql Find log switches in graphical manner Oracle
  • How to Modify the statistics collection by MMON for AWR repository 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

  • How to stop OCSSD Daemon Oracle
  • Find_planinfo.sql Oracle
  • EXTPROC Oracle
  • segment_wise_space.sql segspace.sql Segment wise space usage (allocated and used) Oracle
  • Find execution plan from dba_hist_sql_plan for a specific SQL_ID and PLAN_HASH_VALUE fplan.sql Oracle
  • Configure ssh authentications for RAC 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 (393)
  • PHP/MYSQL/Wordpress (10)
  • POSTGRESQL (1)
  • Power-BI (0)
  • Python/PySpark (7)
  • RAC (17)
  • rman-dataguard (26)
  • shell (149)
  • SQL scripts (342)
  • SQL Server (6)
  • Uncategorized (0)
  • Videos (0)

Recent Posts

  • Complete Git Tutorial for Beginners25-Dec-2025
  • Postgres DB user and OS user.25-Dec-2025
  • Trace a SQL session from another session using ORADEBUG30-Sep-2025
  • SQL Server Vs Oracle Architecture difference25-Jul-2025
  • SQL Server: How to see historical transactions25-Jul-2025
  • SQL Server: How to see current transactions or requests25-Jul-2025
  • T-SQL Vs PL/SQL Syntax25-Jul-2025
  • Check SQL Server edition25-Jul-2025
  • Checking SQL Server Version25-Jul-2025
  • Oracle vs MYSQL Architecture differences (For DBAs)24-Jul-2025

Archives

  • 2025
  • 2024
  • 2023
  • 2010
  • 2009
  • 2008
  • 2007
  • 2006
  • 2005
  • TRUNCATE table and disabling referential constraints. Oracle
  • age_alert.ksh aging out alert.log Linux/Unix
  • Find Time Consuming SQL Statements in Oracle 10g Oracle
  • Absolute file number and relative file number Oracle
  • Changing the Global Database Name Oracle
  • Oracle 11g Training on 29JAN1010 Oracle
  • Rman Notes -1 Oracle
  • oracle 10g on linux Linux/Unix

Copyright © 2026 pvmehta.com.

Powered by PressBook News WordPress theme