Skip to content
pvmehta.com

pvmehta.com

  • Home
  • About Me
  • Toggle search form
  • tuning commmand for cpu, ip and memory stats Linux/Unix
  • Resolving RMAN Hung Jobs Oracle
  • Monitor and Trace Unix processes using truss Linux/Unix
  • fkwoindex.sql /* Find FK without Index */ Oracle
  • Unix split command to split files Linux/Unix
  • fuser to check who is using diretory Linux/Unix
  • longtx.sql with the flag whether session is blocking any DML locks or not. Oracle
  • Kernel Parameters for Solaris Linux/Unix
  • Changing the Global Database Name Oracle
  • Flowers Resize datafiles Oracle
  • OEM-Commnds Oracle
  • Search and Replace vi editor command. Linux/Unix
  • send email from unix mailx with attachment. Linux/Unix
  • Oracle 11g Environment Setup Oracle
  • 10g RAC: Troubleshooting CRS Root.sh Problems 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

  • plan10g.sql good Oracle
  • Drop all SPM baselines for SQL handle Oracle
  • Find nth max and min. Oracle
  • Drop database in Oracle 10g Oracle
  • find_string_in_database.sql Oracle
  • Oracle Material from OTN 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
  • Establishing trusted relationship between dbmonitor( central monitoring) and monitoring targets. Linux/Unix
  • Implementation of key based authentications Linux/Unix
  • Oracle Support Metalink ID 161818.1 Oracle
  • find_idle_cpu.sql Oracle
  • find_pk.sql /* Find Primary Key */ Oracle
  • Move WordPress site from one hosting service to other. PHP/MYSQL/Wordpress
  • How to know Number of CPUs on Sun Box Linux/Unix
  • The most important Tuning Notes Oracle

Copyright © 2025 pvmehta.com.

Powered by PressBook News WordPress theme