Skip to content
pvmehta.com

pvmehta.com

  • Home
  • About Me
  • Toggle search form
  • Global Unique Identifier Generation in Oracle 9.2 SYS_GUID() Oracle
  • Oracle 11g RAC on OEL 5 and Vmware 2 Oracle
  • How do I get Oracle to automatically start when my server boots up? Oracle
  • Find_planinfo.sql Oracle
  • find_cons.sql Oracle
  • Korn Shell Arithmatic Linux/Unix
  • How to specify 2 arch location to avoid any kind of DB hanging. Oracle
  • Search and replace pattern Linux/Unix
  • Find all users who have DML privileges Oracle
  • remove archfiles only when it is applied to DR rm_archfiles.sh Linux/Unix
  • DBMS_UTILITY.ANALYZE_SCHEMA Oracle
  • default permission on ~/.ssh/authorized_keys2 or authorized_keys Linux/Unix
  • replacing ^M character when passing files from Windows to Unix Linux/Unix
  • OEM-troubleshooting on 20-MAY-08 Oracle
  • For Perl DBI installation and testing program PHP/MYSQL/Wordpress

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 find OS block size Oracle
  • ORA-8031 issue and solution if it is occuring due to truncate. Oracle
  • JSON/XML Types in Oracle Oracle
  • Proc code Oracle
  • Goldengate document from Porus Oracle
  • normal maintenance for exp-imp and renaming table 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 (395)
  • PHP/MYSQL/Wordpress (10)
  • POSTGRESQL (1)
  • Power-BI (0)
  • Python/PySpark (7)
  • RAC (17)
  • rman-dataguard (26)
  • shell (150)
  • SQL scripts (343)
  • SQL Server (6)
  • Uncategorized (0)
  • Videos (0)

Recent Posts

  • prepfiles.sh for step by step generating pending statistics files10-Mar-2026
  • tracksqltime.sql05-Mar-2026
  • 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

Archives

  • 2026
  • 2025
  • 2024
  • 2023
  • 2010
  • 2009
  • 2008
  • 2007
  • 2006
  • 2005
  • Disbaling DBA_SCHEDULER_JOBS Oracle
  • Database link password in user_db_links Oracle
  • Gathering statistics with DBMS_STATS Oracle
  • cold backup scripts to copy locally Linux/Unix
  • EXTPROC Oracle
  • tblwopk.sql /* Find Tables Without PK */ Oracle
  • Vivek’s egrep commands to trace problem. (on linux x86-64) Linux/Unix
  • All About Trace Fils Oracle

Copyright © 2026 pvmehta.com.

Powered by PressBook News WordPress theme