Skip to content
pvmehta.com

pvmehta.com

  • Home
  • About Me
  • Toggle search form
  • Proc code Oracle
  • Very clear article about oracle dataguard Oracle
  • login.sql Oracle
  • How do I get Oracle to automatically start when my server boots up? Oracle
  • refre.sql Oracle
  • remove archfiles only when it is applied to DR rm_archfiles.sh Linux/Unix
  • SQL_PROFILE – I explaination Oracle
  • oracle 11g RAC on vmware Oracle
  • Formatter Explain plan Output 1 Oracle
  • database trigger failing Oracle
  • How To Limit The Access To The Database So That Only One User Per Schema Are Connected (One Concurrent User Per Schema) Oracle
  • Processes Parameter decision Oracle
  • Logic to chech # of parameters command line parameters Linux/Unix
  • sid_wise_sql.sql Further explaination Oracle
  • cache buffer chain latch 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

  • Good RAC & Standby Notes Oracle
  • How to Decide upto what level you can decrement your datafile size. ( Shrink Datafile) Oracle
  • CTAS with LONG Column for 7.x and 8 and 8i Oracle
  • 272332.1 CRS 10g Diagnostic Collection Guide Oracle
  • When to rebuld B-tree index Oracle
  • Explain Plan Output 2 Oracle

Leave a Reply Cancel reply

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

Categories

  • Ansible (0)
  • AWS (2)
  • Azure (1)
  • Linux/Unix (149)
  • MYSQL (5)
  • Oracle (393)
  • PHP/MYSQL/Wordpress (10)
  • POSTGRESQL (0)
  • 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

  • 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
  • V$INSTANCE of Oracle in MYSQL24-Jul-2025
  • Day to day MYSQL DBA operations (Compared with Oracle DBA)24-Jul-2025

Archives

  • 2025
  • 2024
  • 2023
  • 2010
  • 2009
  • 2008
  • 2007
  • 2006
  • 2005
  • Follwoing korn shell is used to move files from source folder to destination folder and gzip it in destination folder. mv_iotto.ksh Linux/Unix
  • Clean up Oracle
  • To Find Orphan OS processes. Linux/Unix
  • Drop database in Oracle 10g Oracle
  • Jai Shree Ram Linux/Unix
  • Removing Blank lines from file using grep Linux/Unix
  • pvm_pre_change.sql Oracle
  • db_status.sql Oracle

Copyright © 2025 pvmehta.com.

Powered by PressBook News WordPress theme