Skip to content
pvmehta.com

pvmehta.com

  • Home
  • About Me
  • Toggle search form
  • How to start CRS manually Oracle
  • v$backup.status information Oracle
  • RAC 11g with vmware Oracle
  • logminer and my_lbu Oracle
  • FRA Information. Oracle
  • Kernel Parameters for Solaris Linux/Unix
  • crontab syntax Linux/Unix
  • Rename Tablespace Oracle
  • How to find password change date for user Oracle
  • ORA-01220 Oracle
  • For Perl DBI installation and testing program PHP/MYSQL/Wordpress
  • tab.sql Oracle
  • replace alphabets using sed Linux/Unix
  • Multiple listeners Oracle
  • create a folder in multiple places 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

  • Settting up get_vmstat.sh for colletinf CPU Usage. Oracle
  • Best approach for Oracle database patching sequence to latest/required patchset along with CPU/PSU/any-other-one-off patch ID 865255.1 Oracle
  • DBMS_PROFILER for tuning PLSQL programs. Oracle
  • TABLE SIZING WITH DB_BLOCK ARCHITECTURE Reference : Metalink note : 10640.1 Oracle
  • v$backup.status information Oracle
  • find_log_switch.sql Find log switches in graphical manner 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 (392)
  • PHP/MYSQL/Wordpress (10)
  • Power-BI (0)
  • Python/PySpark (7)
  • RAC (17)
  • rman-dataguard (26)
  • shell (149)
  • SQL scripts (341)
  • Uncategorized (0)
  • Videos (0)

Recent Posts

  • load SPM baseline from cursor cache05-Jun-2025
  • Drop all SPM baselines for SQL handle05-Jun-2025
  • Load SPM baseline from AWR05-Jun-2025
  • Drop specific SQL plan baseline – spm05-Jun-2025
  • findinfo.sql (SQL for getting CPU and Active session info)27-May-2025
  • 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

Archives

  • 2025
  • 2024
  • 2023
  • 2010
  • 2009
  • 2008
  • 2007
  • 2006
  • 2005
  • Implementing Listener Security Oracle
  • Vivek Tuning for Row Locks. Oracle
  • secure crt settings Linux/Unix
  • database trigger failing Oracle
  • Read CSV file using PySpark Python/PySpark
  • To seee semaphores and shared memory segments in Solaris Linux/Unix
  • plan10g.sql good1 Oracle
  • Display the top 5 salaries for each department using single SQL Oracle

Copyright © 2025 pvmehta.com.

Powered by PressBook News WordPress theme